0

On MAC m1, I runned very basic webapi that just responses "OK".

It works as expected of course, but it doesn't work if the concurrent connections were over (around)200.

$ dotnet new webapi

# add a simple Controller that responses just "OK" string.

$ curl http://localhost:5000/dummy
OK

# run ab(Apache Benchmark) with 10 concurrent connections:
$ ab -c 10 -s 5 -t 20 http://localhost:5000/dummy
# WORKS JUST FINE

# run ab with 200 concurrent connections:
$ ab -c 200 -s 5 -t 20 http://localhost:5000/dummy
...
apr_socket_recv: Connection refused (61)
# or,
apr_socket_recv: Connection reset by peer (54)

I confirmed that maxFiles setting on the machine is large enough:

launchctl limit maxfiles

    maxfiles    655360         1048576

And it's able to test to other external end-point as well.

Is there any hidden limitations in Kestrel? or .NET on MAC m1?

edit: I logged at Trace level, but the .NET app itself is working well. There wasn't any errors.

Gongdo Gong
  • 1,000
  • 7
  • 18
  • 1
    Any client OS (macOS or Windows 10/11 for example) shouldn't be used for load testing, as by default they have concurrent connection limits (`maxfiles` is totally irrelevant). Use Linux server or Windows Server please. – Lex Li Aug 12 '22 at 05:23
  • @LexLi can you explain me more please? The client works for other url. – Gongdo Gong Aug 13 '22 at 03:49
  • What if I run load test on Linux docker container in the MAC.Is it okay then? – Gongdo Gong Aug 13 '22 at 03:52
  • For macOS you might get some ideas from https://stackoverflow.com/a/7580233/11182 But I doubt if that's a complete list, as it was written a while ago and macOS is evolving. Windows client OS has the 10 concurrent connection limit which is not removable, as well as other limits. Load testing in a Docker container gives you limited results, as the host OS is bounded. If your work is for a company, ask for dedicated hardware for load testing please, or allocate a powerful enough VM in a private/public cloud. – Lex Li Aug 13 '22 at 05:12
  • ab is the worst load test tool on the planet. There are more modern load tools that aren't as bad. That said, if you're going to use ab to test, you should use the -k option for keep alive requests. – davidfowl Aug 31 '22 at 03:03

0 Answers0