Ticket #371 (closed defect: worksforme)

Opened 3 years ago

Last modified 6 days ago

Dynamic FastCGI support in need of TLC

Reported by: sam@… Owned by: anonymous
Priority: normal Milestone:
Component: mod_fastcgi Version: 1.4.5
Severity: normal Keywords: fastcgi dynamic
Cc: Blocked By:
Need User Feedback: no Blocking:

Description

Hi there,

If you are starting a dynamic process:

 "/dynamic/" => 
 ( (
    "bin-path" => "/path/to/script.fcgi",
    "socket" => "/tmp/why",
    "min-procs" => 1,
    "max-procs" => 4,
    "max-load-per-proc" => 4,
    #"port" => 1234,
    "check-local" => "disable",
    "disable-time" => 1,
 ) )

For a start, there is no reason to name the socket. It should be passed on STDIN. However lighttpd does not accept a configuration with no socket or port. If you specify a port but no hostname, you get a tight loop and gigabytes of logs.

Secondly, it seemed to start "max-procs" rather than "min-procs" on startup.

Thirdly, those processes were not disassociated from the terminal on which lighttpd was started. Their STDERR still pointed to the STDERR of the starting terminal. When you daemonize, you need to close all file descriptors, and re-open STDIN, STDOUT and STDERR to/from /dev/null. Though, ideally you'd want the STDERR of dynamically started applications to go to the server error log.

Attachments

Change History

Changed 3 years ago by jan

  • owner changed from jan to anonymous
  • status changed from new to assigned

1. The docs say that adaptive-spawning is disabled since some releases and that min-procs is ignored.

2. STDIN, STDOUT and STDERR are bound by fastcgi process to be routed over the fastcgi-channel. Yes, the fds for STDOUT and STDERR should be closed.

3. The FastCGI process expected that fd=1 (aka stdin) is bound to a socket (unix-domain or tcp/ip). The only other way is using a socketpair (name-less socket) which is currently not implemented.

4. the STDERR of the fastcgi process goes to the server-errorlog.

I advise the check the fastcgi-spec again

http://www.fastcgi.com/devkit/doc/fcgi-spec.html

or to rephrase your concerns.

Changed 6 days ago by stbuehler

  • status changed from assigned to closed
  • resolution set to worksforme
  • pending unset

FastCGI should get detached in current svn versions. Missing feedback anyway.

Add/Change #371 (Dynamic FastCGI support in need of TLC)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.