FCGI - how many processes, restarting when?

Hello?

Please allow me a quick question, and feel free to reply with a link if this has been answered somewhere already. :)

I'm experimenting a bit with FCGI instead of mod_php, and since I wish to still use the XCache extension (which basically works all okay in FCGI), I'm interested in these two things:

  • How is the number of FCGI processes for a domain determined? At this time, I see two processes for a specific domain and three for another.

  • When are FCGI processes restarted? Since every restart means that the cache is cleared (XCache only uses memory cache, no disk cache), degrading performance for a bit, I'd probably want them to restart as rarely as possible.

Thanks in advance for help! :)

Status: 
Closed (fixed)

Comments

Hmm, I think I can answer this myself... Would the Apache directives like FcgidProcessLifeTime and others from the Fcgid group be the way to go?

  1. FCGI processes get started as needed, based on the number of concurrent requests. As far as I know, there is no upper limit.

  2. The process lifetime can be set in Virtualmin, on the Website Options page. The field is called "Max PHP execution time", but it actually sets the FCGI timeout as well..

  1. FCGI processes get started as needed, based on the number of concurrent requests. As far as I know, there is no upper limit.

  2. The process lifetime can be set in Virtualmin, on the Website Options page. The field is called "Max PHP execution time", but it actually sets the FCGI timeout as well..

Okay yeah, I can see that function change the MaxExecutionTime directive in the vserver's PHP ini file... Though I can't see how it makes an entry for the FCGI process lifetime... Shouldn't that go into /etc/apache2/sites-available/domainname.conf?

EDIT: I just see it modifies the directive "IPCCommTimeout". Apache documentation lists that under this paragraph:

The following changes have been made in the ASF release of mod_fcgid and should be considered when upgrading from the original version by Ryan Pan (Pan Qingfeng). All directives have been renamed in order to use a common prefix "Fcgid". Underscores in directive names have been eliminated in favor of CamelCase. The old directive names will still work but are deprecated.

That directive is now named FcgidIOTimeout. Also, according to the same documentation, it has nothing to do with FCGI process lifetime, but does this:

This is the maximum period of time the module will wait while trying to read from or write to a FastCGI application.

Any insights on this? :)

My mistake, you are correct .. that sets the max execution time of a single script, not the total fcgi process lifetime. For the latter, you'd need to set FcgidProcessLifeTime manually.

Okidoki, thanks! Case closed. :)