4 ms·
Sounds like macOS sucks at web serving :) I guess one lesson not explicitly mentioned is that doing benchmarking on something like macOS can have lot of pitfal
by zokier 2y ago
Sounds like macOS sucks at web serving :)
I guess one lesson not explicitly mentioned is that doing benchmarking on something like macOS can have lot of pitfalls compared to systems more intended for this kind of workload (Linux...).
But the mention of wrk immediately stood out as a red flag; there is notable problem with wrk called "coordinated omission":
https://github.com/wg/wrk/issues/485 https://github.com/wg/wrk/issues/485
https://github.com/giltene/wrk2 https://github.com/giltene/wrk2
https://news.ycombinator.com/item?id=34148502 https://news.ycombinator.com/item?id=34148502
Benchmarking is difficult. And there is lot of subtlety on how you set up the client(s) and servers that can impact the results a lot.
- jeremyjh 2y agoPeople who read the entire article might have noticed many of these problems were reproduced on Linux.
- datadeft 2y agoThe default limits of MacOS is not really web server benchmark friendly. ulimit -a Maximum size of core files created (kB, -c) 0 Maximum size of a process’s data segment (kB, -d) unlimited Maximum size of files created by the shell (kB, -f) unlimited Maximum size that may be locked into memory (kB, -l) unlimited Maximum resident set size (kB, -m) unlimited Maximum number of open file descriptors (-n) 256 Maximum stack size (kB, -s) 8176 Maximum amount of CPU time in seconds (seconds, -t) unlimited Maximum number of processes available to current user (-u) 5333 Maximum amount of virtual memory available to each process (kB, -v) unlimited Debian's limits are better: ~> ulimit -a Maximum size of core files created (kB, -c) 0 Maximum size of a process’s data segment (kB, -d) unlimited Control of maximum nice priority (-e) 0 Maximum size of files created by the shell (kB, -f) unlimited Maximum number of pending signals (-i) 30744 Maximum size that may be locked into memory (kB, -l) 993336 Maximum resident set size (kB, -m) unlimited Maximum number of open file descriptors (-n) 64000 Maximum bytes in POSIX message queues (kB, -q) 800 Maximum realtime scheduling priority (-r) 0 Maximum stack size (kB, -s) 8192 Maximum amount of CPU time in seconds (seconds, -t) unlimited Maximum number of processes available to current user (-u) 30744 Maximum amount of virtual memory available to each process (kB, -v) unlimited Maximum contiguous realtime CPU time (-y) unlimited For testing I always create an instance somewhere (mostly AWS) and configure the OS to have much higher performance limits to enable better performance outcomes.
- andrekandre 2y agointerestingly macos does have a "server performance mode" you can set with kernel boot args https://apple.stackexchange.com/questions/264958/what-does-serverperfmode-1-actually-do-on-macos#264967 https://apple.stackexchange.com/questions/264958/what-does-s... https://support.apple.com/101992 https://support.apple.com/101992