Re: [Cppcms-users] Multiprocesses and cppcms_scale
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-04-06 21:35:00
|
> >1. cppcms_scale > Here in this page, it mentioned "cppcms_scale" > http://cppcms.com/wikipp/en/page/cppcms_1x_high_performance > and I found the built binary cppcms_scale.exe as well. > It is supposed to provide triggered cache, and cross process session support? I can't any wiki page talking about its usage. > I found here is something about "cppcms_tcp_scale" > http://cppcms.com/wikipp/en/page/ref_utils > Are they the same thing? It would be great if can have a page/sample talking more about how to scale up. Thanks. > Yes, cppcms_scale allows to shared both cache and sessions over the network similarly to memcached. See: http://cppcms.com/wikipp/en/page/cppcms_1x_config#cache.tcp http://cppcms.com/wikipp/en/page/cppcms_1x_config#session.server.storage This way multiple cppcms services can share the cache and sessions over the network. > >2. Multi-Processes >Here in this page, http://cppcms.com/wikipp/en/page/tut_concept it mentioned CppCMS can have a pool of threads or processes. >But here when configure with web servers, http://cppcms.com/wikipp/en/page/cppcms_1x_tut_web_server_config#Configuring.Other.Web.Servers >document mentioned "be sure it starts only a single process". Otherwise the cache & session will be messed up, due to not cross process. >Is this the problem cppcms_scale targeted to solve ? Yes and no. Generally running CppCMS as a single service instance is good as it allows to handle cache withing the same process. Sometimes web server is not aware of the fact that the FastCGI server is multi-threaded and would start multiple instances and this is wrong. And yes cppcms_scale can solve it but generally it is better not to use cppcms_scale as long as you running the application on a single server. > If true, how can we configure CppCMS > with modern web servers, to run as multiple > processes and multiple threads, in fastcgi env? > > CppCMS handles both thread and process pool http://cppcms.com/wikipp/en/page/cppcms_1x_config#service.worker_threads This allows the process to share for example the cache using shared memory and not IPC. However if you scale to multiple network nodes you do need cppcms_scale for cache. Small note: under Windows CppCMS supports only multiple threads pool and can't fork multiple processes (as Windows does not have fork() system call) So if you do want to run multiple CppCMS processes under Windows you need to start them independently and use cppcms_scale to solve cache consistency issues >Thanks for the great work! I'd like to use CppCMS in my production environment soon. > > >Cheers, >William L. Regards, I'd be glad to hear about it. Artyom |