Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel Requests #17

Open
defjamuk opened this issue Nov 25, 2019 · 4 comments
Open

Parallel Requests #17

defjamuk opened this issue Nov 25, 2019 · 4 comments

Comments

@defjamuk
Copy link

defjamuk commented Nov 25, 2019

Hi,

Just a quick question (hopefully). I have just tested the CEEN library using the timeofday example in your notes. The server works well but when ramping up the requests, it seems that I cannot get anymore than 20 parallel requests before I get errors. I have downloaded (and debugged) the source and I cannot see any errors. It seems that the TCP connection is being refused (although I could be wrong).

Any ideas on where I could look?

C# VS2019 .NET 4.7.2

KR
Andy


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kenkendk
Copy link
Owner

That is always a difficult topic to debug. Based on your setup description, I am guessing that you are on Windows.

One setting you can fiddle with is the backlog (number of pending requests). It could be a warmup issue, where .Net does not spin up threads before they are needed, so if you are using all threads there will be a little lag before the threads are spinning up and handling requests. If you are using the CLI-based approach, just add a line with SocketBacklog 100 to the configuration file. Otherwise, set it on the ServerConfig instance.

I have not tried any extensive testing on Windows, but I assume the async calls map to the most efficient Windows socket calls.

What are you using to test with? I have had trouble with ApacheBench because it crashes when it tries to open too many sockets (fails in the AB tester process, not the server). I have included the PerfTester tool that I have used to load-test it under macOS and Linux.

If you are using the isolated process or isolated app-domain setup, try disabling that to see if changes anything.

@defjamuk
Copy link
Author

Hi Ken,

We are testing on windows. Upping the socket backlog has indeed increased the performance -- We are using "loadtest". This is mostly the NPM equivalent of Apache ab.

We have managed to increase the parallel requests to 200 using the test code (timeofday). Going over 200 we are seeing the same errors.

I think 200 will be OK for our usage, but I am curious to find out why and what limits the parallel sockets.

Thanks for you input -- I will try the perftester tool and investigate the appdomain settings.

KR
A

@jchristn
Copy link

jchristn commented Dec 8, 2020

I haven't used this library, but have seen this issue with my HTTP and TCP libraries. Have you tried adjusting the threadpool?

https://stackoverflow.com/questions/6000834/threadpool-max-threads

@kenkendk
Copy link
Owner

kenkendk commented Dec 9, 2020

@jchristn Yes, that could also play a role. I have traced that flushing the data will not always happen asynchronosly and that might tie up a thread, limiting the maximum number of concurrent requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants