in reply to Re^2: CGI Header Breaks on Second AJAX Call
in thread CGI Header Breaks on Second AJAX Call
a utility written using PSGI and Perl where the author lamented having to write additional scripts to ensure the services were running.
Same problem as with almost any setup where webserver and applications run on in different processes. PSGI is perl-specific, FastCGI is not. FastCGI keeps your application running in an isolated process, so crashing the webserver does not kill the application, and crashing the application does not kill the webserver. Getting the application process running is a problem.
You could start it manually. Every time your application crashes.
You could construct something crazy, involving hand-started scripts, cron jobs, and I don't know what else to start the application process.
Or you could make starting your application a problem for the operating system. After all, it is able to start the webserver without manual intervention, so it can do the same to your application. (With daemontools and runit, you simply need a shell script to invoke your application. With systemd, you write an INI-style configuration file to do the same job in a much more complicated way. With a classic init system, you set up a daemon by an init script, or invoke it directly from init. On Windows, you need to set up a service.)
Apache also offers mod_fcgid to manage your FastCGI application process(es) for you, instead of using operating system services. Other webservers might offer similar modules. This has the advantage that you don't need to keep the application process(es) running if there are no requests for them. The disadvantage is that they are not as isolated from the webserver as a process started as an independant daemon started by init, daemontools, runit, or systemd.
Alexander
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: CGI Header Breaks on Second AJAX Call
by karlgoethebier (Abbot) on Apr 14, 2025 at 09:17 UTC | |
by afoken (Chancellor) on Apr 14, 2025 at 22:09 UTC | |
by karlgoethebier (Abbot) on Apr 15, 2025 at 10:35 UTC | |
by afoken (Chancellor) on Apr 15, 2025 at 20:00 UTC | |
by hippo (Archbishop) on Apr 15, 2025 at 20:40 UTC |