I created a Sparkle Server with one THttpServerModule. Then I tried to process 100 Connects at the same time, but the server
didn?t create more than 6 threads at the same time and processed all requests in a row. How can I process more threads
at the same time?
I create a lot of parallel requests for testing purposes (a lot of users at the same time are to be expected) that need between 1 and 5 seconds (multiple database operations) each.
After initializing the connections, the IDE threadmonitor displays 6 new threads and a global counter variable I added to the THttpServerModule displays a maximum of 6 threads too.
Our database session monitor shows 6 simultaneous database connections - they are created in the "ProcessRequest" procedure - and debugging shows me that the maximum of TWinThreadPool.FWorkCount is 6. So it seems to me that the threadpool has a maximum number of simultaneous requests of 6.
Eventually all my requests are processed but only 6 at a time.
I hope you get my problem and can help me to raise the number of simultaneous requests.
As I said, that's expected and desired. More threads doesn't mean more performance. How are you managing the connections to the database? Can you maybe post your full source code here, or at least the most relevant parts?
Wagner R. Landgraf2017-01-03 11:17:20
Hi again and sorry, it was our mistake. We used a loop in javascript to generate the requests and as it seems there was the problem. Browsers have a different limit of connections to the same host and exactly that was causing all the trouble.
Sparkle works as intended. Thank you for your support :)