giltene / wrk2

A constant throughput, correct latency recording variant of wrk
Apache License 2.0
4.23k stars 381 forks source link

Compile on Apple silicon #128

Open galderz opened 2 years ago

galderz commented 2 years ago

An attempt to make wrk2 work on Apple silicon. Tried and tested things based on what wrk had done (iow, I'm no expert on this). Feel free to improve it as necessary.

Here's some output to demonstrate that it appears to work:

$ ./wrk --version
wrk 4.0.0 [kqueue] Copyright (C) 2012 Will Glozer
...
$ ./wrk -H 'Host: localhost' -H 'Accept: text/plain,text/html;q=0.9,application/xhtml+xml;q=0.9,application/xml;q=0.8,*/*;q=0.7' -H 'Connection: keep-alive' --latency -d 15 -c 256 --timeout 8 -t 32 -R 480000 http://192.168.1.163:8080/plaintext -s pipeline.lua -- 16
...
  Latency Distribution (HdrHistogram - Recorded Latency)
 50.000%    1.57ms
 75.000%    6.44ms
 90.000%   24.43ms
 99.000%   53.76ms
 99.900%   69.82ms
 99.990%  163.97ms
 99.999%  213.25ms
100.000%  221.18ms
...
  7192122 requests in 15.00s, 0.99GB read
Requests/sec: 479576.53
Transfer/sec:     67.69MB
...
$ uname -a
Darwin m22 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
galderz commented 2 years ago

LOL, seems others have already sent a PR. https://github.com/giltene/wrk2/pull/110. I'll add both PRs to the issue (which should have really been linked there for ref)

orefalo commented 2 years ago

It worked! compiled on M1! thank you

kklis commented 5 months ago

Thank you, it worked brilliantly!