Thread: [Cppcms-users] How to prevent server goes down when crash?
Brought to you by:
artyom-beilis
From: 李明 <lim...@gm...> - 2011-08-19 02:12:01
|
I used Apache to configure an external application server with fastcgi mode in Windows. Fastcgi is process isolation, so I try to make my application based on cppcms crash to see how will happen to server, but it went down when crash happen. How to prevent this happen? Do I need to do some configuration to enable multi thread? Thanks. |
From: Artyom B. <art...@ya...> - 2011-08-20 10:18:22
|
>Subject: [Cppcms-users] How to prevent server goes down when crash? > > >I used Apache to configure an external application server with fastcgi mode in Windows. > > > Fastcgi is process isolation, so I try to make my > application based on cppcms crash to see how will happen > to server, but it went down when crash happen. How to prevent > this happen? Do I need to do some configuration to enable multi thread? > > To be honest I don't understand the question? How crash of cppcms programs crashes the web server? CppCMS runs different process, maximum you should get 500 HTTP Error. Another thing, on POSIX platforms you can set "service.worker_processes" to 1 and it would allow CppCMS to control its own lifetime and restart the process when it goes down automatically. http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#service.worker_processes Artyom >Thanks. >------------------------------------------------------------------------------ >Get a FREE DOWNLOAD! and learn more about uberSVN rich system, >user administration capabilities and model configuration. Take >the hassle out of deploying and managing Subversion and the >tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: 李明 <lim...@gm...> - 2011-08-22 01:27:18
|
I didn't work on posix platform. I use microsoft vs to build it and use apache in windows to run it. This is what I did: 1. Added a (*(char *) 0) = 0 in the hello:main() function. This should make process crash when user try to access the URL. 2. Configure hello.exe run as fastcgi mode and start the it as hello.exe -c config.js 3. Configure apache to run hello.exe independently( http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start ) 4. Try to access http://localhost:8080/hello Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I don't fully understand how to run it as multi-thread. On Sat, Aug 20, 2011 at 6:18 PM, Artyom Beilis <art...@ya...> wrote: > >Subject: [Cppcms-users] How to prevent server goes down when crash? > > > > > > >I used Apache to configure an external application server with fastcgi > mode in Windows. > > > > > > Fastcgi is process isolation, so I try to make my > > application based on cppcms crash to see how will happen > > to server, but it went down when crash happen. How to prevent > > this happen? Do I need to do some configuration to enable multi thread? > > > > > > To be honest I don't understand the question? How crash of cppcms programs > crashes the web server? CppCMS runs different process, maximum > you should get 500 HTTP Error. > > Another thing, on POSIX platforms you can set "service.worker_processes" > to 1 and it would allow CppCMS to control its own lifetime and restart > the process when it goes down automatically. > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#service.worker_processes > > Artyom > > > > > > > > > > > > > >Thanks. > > >------------------------------------------------------------------------------ > >Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > >user administration capabilities and model configuration. Take > >the hassle out of deploying and managing Subversion and the > >tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > >_______________________________________________ > >Cppcms-users mailing list > >Cpp...@li... > >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom B. <art...@ya...> - 2011-08-22 08:27:45
|
> >I didn't work on posix platform. I use microsoft vs to build it and use apache in windows to run it. > > >This is what I did: >1. Added a (*(char *) 0) = 0 in the hello:main() function. This should make process crash when user try to access the URL. >2. Configure hello.exe run as fastcgi mode and start the it as hello.exe -c config.js >3. Configure apache to run hello.exe independently( http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start ) >4. Try to access http://localhost:8080/hello > > >Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I don't fully understand how to run it as multi-thread. > Obviously... The hello runs as independent FastCGI Server and if it crashes it crashes like any other program. I though you told me that "web server" crashes, but hello.exe is not web server. If you want hello.exe to be restarted you need to do it on your own (at least on Windows that does not support fork() system call). Simple bat script can do this for you. You can also configure the web server to control the life time of the "hello.exe", start it, shut it down or restart. This is what described in the link below. http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Start.by.Web.Server Thus apache would restart CppCMS service when it crashes for you. AFAIK there are users that run CppCMS this on Windows with Apache that is controlled by Apache and I even get patches for graceful shutdown by apache support. See this thread: http://thread.gmane.org/gmane.comp.lib.cppcms.user/551 Artyom |
From: Cristian O. <one...@gm...> - 2011-08-22 08:33:01
|
2011/8/22 Artyom Beilis <art...@ya...>: > >> >>I didn't work on posix platform. I use microsoft vs to build it and use apache in windows to run it. >> >> >>This is what I did: >>1. Added a (*(char *) 0) = 0 in the hello:main() function. This should make process crash when user try to access the URL. >>2. Configure hello.exe run as fastcgi mode and start the it as hello.exe -c config.js >>3. Configure apache to run hello.exe independently( http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start ) >>4. Try to access http://localhost:8080/hello >> >> >>Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I don't fully understand how to run it as multi-thread. >> > > Obviously... The hello runs as independent FastCGI Server and if it crashes it crashes > like any other program. I though you told me that "web server" crashes, but hello.exe > is not web server. > > > If you want hello.exe to be restarted you need to do it on your own > (at least on Windows that does not support fork() system call). > Simple bat script can do this for you. > > > You can also configure the web server to control the life time of the "hello.exe", > start it, shut it down or restart. > > This is what described in the link below. > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Start.by.Web.Server > > Thus apache would restart CppCMS service when it crashes for you. I can confirm this behavior. Regards, Cristian > > AFAIK there are users that run CppCMS this on Windows with Apache that is controlled by Apache > and I even get patches for graceful shutdown by apache support. > > See this thread: > > http://thread.gmane.org/gmane.comp.lib.cppcms.user/551 > > > Artyom > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: 李明 <lim...@gm...> - 2011-08-22 08:33:23
|
Great reply. Thank you. On Mon, Aug 22, 2011 at 4:27 PM, Artyom Beilis <art...@ya...> wrote: > > > > >I didn't work on posix platform. I use microsoft vs to build it and use > apache in windows to run it. > > > > > >This is what I did: > >1. Added a (*(char *) 0) = 0 in the hello:main() function. This should > make process crash when user try to access the URL. > >2. Configure hello.exe run as fastcgi mode and start the it as hello.exe > -c config.js > >3. Configure apache to run hello.exe independently( > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Independent.start > ) > >4. Try to access http://localhost:8080/hello > > > > > >Obviously hello.exe crash and exit. Maybe I ran it as wrong way but I > don't fully understand how to run it as multi-thread. > > > > Obviously... The hello runs as independent FastCGI Server and if it crashes > it crashes > like any other program. I though you told me that "web server" crashes, but > hello.exe > is not web server. > > > If you want hello.exe to be restarted you need to do it on your own > (at least on Windows that does not support fork() system call). > Simple bat script can do this for you. > > > You can also configure the web server to control the life time of the > "hello.exe", > start it, shut it down or restart. > > This is what described in the link below. > > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tut_web_server_config#Apache..FastCGI..Start.by.Web.Server > > Thus apache would restart CppCMS service when it crashes for you. > > > AFAIK there are users that run CppCMS this on Windows with Apache that is > controlled by Apache > and I even get patches for graceful shutdown by apache support. > > See this thread: > > http://thread.gmane.org/gmane.comp.lib.cppcms.user/551 > > > Artyom > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |