Project

General

Profile

mod_fastcgi: should a FastCGI server exit after a few seconds of inactivity?

Added by Basile_S over 4 years ago

Hello

I have a VPS serving very low traffic websites, mostly static. Running Debian with lighttpd 1.4.45

I am considering writting a (GPLv3+) FastCGI application in C++.

My guess (after glancing into the source code) is that it is preferable that well behaving FastCGI applications would exit gracefully after a dozen of seconds of inactivity, and lighttpd would restart them as needed.

Is that correct? I don't want to overload my VPS (sinnce it is a very cheap one, rented by a private person).

Regards.
--
Basile Starynkevitch
92340 Bourg La Reine, near Paris, in France


Replies (1)

RE: mod_fastcgi: should a FastCGI server exit after a few seconds of inactivity? - Added by gstrauss over 4 years ago

lighttpd comfortably runs on routers with 64MB of memory.

If your server is resource-limited, then you should be aware how much memory is used by your backend. Backend PHP and Python frameworks tend to use MUCH more memory than lighttpd uses. What your C++ uses depends on your application, the libraries you use, and your coding.

My guess (after glancing into the source code) is that it is preferable that well behaving FastCGI applications would exit gracefully after a dozen of seconds of inactivity, and lighttpd would restart them as needed.

That's up to you and the resources used by your application, and whatever else is running on the VPS.

lighttpd does have a configurable feature where, if configured, lighttpd will kill idle backends and will start them up as needed. That feature is different from your FastCGI app. If your FastCGI app exits, lighttpd will restart it if lighttpd is configured to keep it running.

.

BTW, please do not include self-promotion links in your posts. The links have been removed from your post above.

    (1-1/1)