oha icon indicating copy to clipboard operation
oha copied to clipboard

How do I do a load test for POST/PUT apis

Open jo19in1 opened this issue 3 years ago • 3 comments

  1. Please give an example on how to use multiple POST apis for a test. Ex: api A has to be hit at 40k rpm api B has to be hit at 32k rpm api C at 20k rpm and so on.

  2. What configuration machine will I need to achieve the above test?

jo19in1 avatar Sep 19 '22 14:09 jo19in1

Also how do i pass CSV files as input

jo19in1 avatar Sep 20 '22 10:09 jo19in1

Please give an example on how to use multiple POST apis for a test.

oha doesn't support multiple targets. drill maybe better to such a usecase.

But you can run multiple oha parallely in shell.

# `oha` only supports RPS(request per second) so I divided 40k by 60
oha --no-tui -z 10s -q 66000 {API A} &
oha --no-tui -z 10s -q 50000 {API B} &
oha --no-tui -z 10s -q 3300 {API C}

What configuration machine will I need to achieve the above test?

I don't know. Maybe you want to increase the limit of number of open files for a proccess to bigger concurrency (-c option).

Also how do i pass CSV files as input

It depends your API's spec. If you just put a CSV file to body, you can run by

oha -D {path to CSV} {URL}

hatoo avatar Sep 20 '22 12:09 hatoo

Thank you for your answer, I was looking to take data for POST calls from a CSV.

jo19in1 avatar Sep 21 '22 00:09 jo19in1