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

http_listener odd behavior #87

Open
kreuzerkrieg opened this issue Mar 9, 2016 · 2 comments
Open

http_listener odd behavior #87

kreuzerkrieg opened this issue Mar 9, 2016 · 2 comments

Comments

@kreuzerkrieg
Copy link
Contributor

Before I'm starting to debug cpp REST SDK code...
I've implemented server/client using http_listener and http_client. Everything is made by the book, every get/wait wrapped with try/catch and, surprisingly, everything works as expected. Except one thing. The client API has function in two flavors sync and async, the sync just uses the async and calls get. I have two tests, one "for" loop running sync client function 100 times and the same "for" loop for async. Everything is OK, even if I run above "for"s in infinite loop for an hour. BUT, if I increase the number of repetitions in the async "for" loop from 100 to 1000 the following happens, the server jumps to ~570 threads, client dies on timeout and the server is no more responding. is there some kind of internal thread pool which cant grow beyond some point and crossing that bound kills the listener? is it configurable? any workaround in case I have to accept large number of requests simultaneously?

@ras0219-msft
Copy link
Contributor

We do use a threadpool, however there should be no strict maximum that kills the program. On Windows with VS 2015, we use the Windows Threadpool (which dynamically scales as needed). On OSX/iOS we use Grand Central Dispatch (I believe this also dynamically scales). On Linux/Android we use a fixed size boost threadpool which defaults to 40 threads.

I'm not sure why you'd see the program crash though; all the above pools should support at least 1000 open connections.

Could you try testing the listener and client separately against some "known good" implementations? Our client is much more polished than the listener, so it would be useful to know where the problem lies between the two.

@kreuzerkrieg
Copy link
Contributor Author

I dont suspect the client, we use it extensively and it runs on various scenarios in production code and everything is just fine. I will try to setup simple tester to reproduce the problem in the listener.

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

2 participants