1

Current wrk configuration allows sending continuous requests for seconds (duration parameter).

Is there a way to use wrk to send requests and then exit.

My use case: I want to create large number of threads + connections (e.g. 1000 threads with 100 connections per thread) and send instantaneous bursts towards the server.

Bhakta Raghavan
  • 664
  • 6
  • 16

3 Answers3

1

You can do it with LUA script:

local counter = 1

function response()
   if counter == 100 then
      wrk.thread:stop()
   end
   counter = counter + 1
end

Pass this script with -s command line parameter.

Artem Klevtsov
  • 9,193
  • 6
  • 52
  • 57
1

I make changes to wrk to introduce new knobs. Let me know if anyone is interested in the patch and I could post it.

I added a -r to send exactly requests and bail out.

Bhakta Raghavan
  • 664
  • 6
  • 16
1

Artem,

I have this code-change in my fork:

https://github.com/bhakta0007/wrk

Bhakta Raghavan
  • 664
  • 6
  • 16