guzba / mummy

An HTTP and WebSocket server for Nim that returns to the ancient ways of threads.
MIT License
281 stars 11 forks source link

Bad performance on windows os due to failed "Maximum number of descriptors is exhausted!" #95

Closed me7 closed 1 year ago

me7 commented 1 year ago

I tried wrk_mummy.nim per https://github.com/guzba/mummy#mummy-1 example but it's fail "Maximum number of descriptors is exhausted!" and die everytime. What I assume is because FD_SETSIZE in std/selectors is set to 1024 and exhaused so it's get this error when concurrent connection is set to 100 image

when reduce concurrent connection to 50 server is working ok with about 4.4k requests/second image

How to resolve this issue? Otherwise I think it's cannot use on windows system.


note 1. I use plow to benchmark due to wrk is not available on windows. note 2. for comparison, simple node http server can easily handle 100 concurrent connection with 13k requests/second but right now mummy will die if concurrent connection is more than 50. image

guzba commented 1 year ago

Windows support is only present to enable development for those that prefer to work on Windows. Benchmarking or running Mummy in production is always expected to be on Linux. Benchmarks on Windows will be of no value to a Linux production environment.

me7 commented 1 year ago

Thank you for clarification. So this mean mummy is not design to run in production for windows os?

Not offending, just curios because now I use Jester on windows and it's not have this problem of "file descripter exhausted" I want to change my app to use mummy instead of jester due to it's native support for websocket, but if this is by design to run better on linux I will stay with jester.

guzba commented 1 year ago

No prob to ask. That is correct, Mummy is not not tested nor intended to be run in production on Windows. I'm not aware of any HTTP servers other than .NET stuff that is actually intended to run on Windows in production as that is quite rare.