[Cppcms-users] How can I limit the total maximum number of synchronous application object in the po
Brought to you by:
artyom-beilis
|
From: Jean-Frédéric G. <jfg...@gm...> - 2014-02-13 16:27:35
|
Thanks a lot for creating CppCms, it is a wonderful framework. I made a simple project, with a synchronous application pool (like hello_world), and I was hoping I could create a DB connection inside each application object and keep it cached for reusing. Now, I am using the configuration service.applications_pool_size to set my pool size, but it seems this configuration is only for the number the maximum number of app object to cache, it does not limit the maximum number of objects created at any time. For instance, I have set the service.applications_pool_size to 24, and if I run a load test and increase the number of concurrent requests, I am able to go over 24 app objects. In fact I don't really see a limit easily, it would go over 200 app objects living at any time (in my case this translates to 200 DB connections), as long as I am hitting the service with over 200 concurrent requests. Even if I play with the worker_thread config it does not seem to limit in any way the max number of app objects. Once I stop my load test, I will see the number of app objects/db connections go back to the service.applications_pool_size I have configured. Is there any way to really limit the app pool size so that it will only go up to a maximum setting configured? Under heavy load, once this limit is reached, it should queue the requests and dispatch them at the next available application object. Also, I am using nginx with my cppcms app configured as fastcgi. I tried to see if I could limit the concurrent requests in nginx to queue them but could not find how or if this is possible. Overall, I find that being able to control the maximum number of app objects is important, in order to properly manage the memory and CPU resources used under heavy load. Also, please let me know if I'm missing something, I am just starting with cppcms but I find great potential. Thanks, Jeff |