fcgi Starter-Aufruf zu langsam (lenny)

Apache, Lighttpd, nginx, Cherokee
floos
Posts: 29
Joined: 2009-01-18 18:04

fcgi Starter-Aufruf zu langsam (lenny)

Post by floos » 2009-03-28 23:26

Hallo
nagelneuer Root mit Lenny amd64 mit Apache+fcgi+suexec
Der Erstaufruf einer php-Seite dauert immer 10 bis 15 sec. Alle anderen Klicks dann ohne Verzögerungen.
Wenn der mod_fcgid: process dann nach (IdleTimeout 600) beendet wird, fängt die Warterei von vorne an. (sofern kein anderer User die Seite aufgerufen hat). Ebenso nach jedem Reload des Apachen (z.B. wegen Änderungen an den VHosts).
Also immer wenn die Starterup-Datei ausgeführt wird, gibt es diese Wartezeit.

Das war unter Etch nicht der Fall und ich finde trotz intensiver Suche in den Logs und Verstellung der Parameter keine Abhilfe.
Hat hier jemand eine Idee?

Im den Logs finde ich nichts außergewöhnliches:
Im error.log wenn eine Startup-Datei aufgerufen wird. Dann Wartezeit. Keine weitere Meldung

Code: Select all

[Sat Mar 28 23:07:41 2009] [notice] mod_fcgid: call /var/www/virtual/hp123/htdocs/index.php with wrapper /var/www/conf/hp123/startphp

nach 600 sec wird der Prozess beeendet. Nächste Klick auf der Seite würde danch wieder die startup-Datei aufrufen.

Code: Select all

[Sat Mar 28 23:06:49 2009] [notice] mod_fcgid: process 15190 going graceful shutdown, sending SIGTERM
[Sat Mar 28 23:07:01 2009] [notice] mod_fcgid: process /var/www/vhcs2/gui/index.php(15190) exit(idle timeout), terminated by calling exit(), return code: 0



/etc/apache2/mods-available/fcgid.conf

Code: Select all

<IfModule mod_fcgid.c>

# IdleTimeout n (300 seconds)
# An idle fastcgi application will be terminated after IdleTimeout seconds.
IdleTimeout 600

# IdleScanInterval n (120 seconds)
# The scan interval for idle fastcgi applications.
IdleScanInterval 240

# BusyTimeout n (300 seconds)
# A fastcgi application will be terminated if handing a single request
# longer than busy timeout.
BusyTimeout 300

# BusyScanInterval n (120 seconds)
# The scan interval for busy timeout fastcgi applications.
BusyScanInterval 120

# ErrorScanInterval n (3 seconds)
# The scan interval for exit pending fastcgi applications. fastcgi
# applications will be terminated within this scanning.
ErrorScanInterval 6

# ZombieScanInterval n (3 seconds)
# The scan interval for zombie process.
ZombieScanInterval 6

# ProcessLifeTime n (3600 seconds)
# A fastcgi application will be terminated if lifetime expired,
# even no error is detected.
ProcessLifeTime 3600

# SocketPath path (logs/fcgidsock)
# The directory to put the UNIX domain socket. (UNIX only)
# This directory should be writable only by apache user
SocketPath /var/lib/apache2/fcgid/sock

#SharememPath path (logs/fcgid_shm)
#The share memory file path. (UNIX only) (version >= 2.1 only)
SharememPath /var/lib/apache2/fcgid/shm

# SpawnScoreUpLimit n (10)
# The spawn-speed control score up water limit. Score increases while
# a process is spawned or terminated, and decreases as time progresses;
# while the score is higher than SpawnScoreUpLimit, the spawning will be
# held for a while. The higher this number is, the higher speed of the
# spawning can be.
SpawnScoreUpLimit 20

# SpawnScore n (1)
# The weight of spawning.  This weight will be plused to the spawn-control
# score on every spawn. The higher this number is, the lower speed of
# spawning can be.
SpawnScore 1

# TerminationScore n (2)
# The weight of termination. This weight will be plused to the score while
# fastcgi process terminates. The higher this number is, the lower speed
# of spawning can be.
TerminationScore 2

# MaxProcessCount n (1000)
# The max count of total fastcgi process count.
MaxProcessCount 250

# DefaultMaxClassProcessCount n (100)
# The maximum number of fastcgi application instances allowed to run for
# particular one fastcgi application.
DefaultMaxClassProcessCount 20

# DefaultMinClassProcessCount n (3)
# The minimum number of fastcgi application instances for any one fastcgi
# application.
# Idle fastcgi will not be killed if their count is less than n
# Set this to 0, and tweak IdleTimeout
DefaultMinClassProcessCount 0

# DefaultInitEnv  env_name env_value
# The default environment variables before a fastcgi application
# is spawned. You can set this configuration more than once.

# IPCConnectTimeout n (3 seconds)
# The connect timeout to a fastcgi application.
IPCConnectTimeout 60

# IPCCommTimeout n (20 seconds)
# The communication timeout to a fastcgi application. Please increase this
#  value if your CGI have a slow initialization or slow respond.
IPCCommTimeout 240

# OutputBufferSize n (64k bytes)
# CGI output cache buffer size.

# PHP_Fix_Pathinfo_Enable n(n=0/1, default 0)
# If you are using PHP and set cgi.fix_pathinfo=1 in php.ini, set PHP_Fix_Pathinfo_Enable 1.
# From php.ini:
# cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
# previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
# what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
# this to 1 will cause PHP CGI to fix it's paths to conform to the spec.  A setting
# of zero causes PHP to behave as before.  Default is zero.  You should fix your scripts
# to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
# cgi.fix_pathinfo=1
PHP_Fix_Pathinfo_Enable 1


#MaxRequestsPerProcess 500


</IfModule>


eine Starter-Datei: (startphp)

Code: Select all

#!/bin/sh
PHPRC='/var/www/conf/hp123/'
export PHPRC
PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN
exec /usr/bin/php5-cgi


innerhalb des vhost-Konfiguration

Code: Select all

        AddHandler fcgid-script .php
        FCGIWrapper /var/www/conf/hp123/startphp .php

floos
Posts: 29
Joined: 2009-01-18 18:04

Re: fcgi Starter-Aufruf zu langsam (lenny)

Post by floos » 2009-03-30 14:41

Die Lösung wurde gefunden:
Es ist das php-Modul imap.so. Wenn man es wegläßt startet php ohne Verzögerung.
Die genauee Ursache, warum das so ist muss noch geklärt werden.