php-performance gebremst auf apache2 mit php5

Apache, Lighttpd, nginx, Cherokee
Post Reply
toyflish
Posts: 20
Joined: 2003-11-09 11:46
Location: Kiel
 

php-performance gebremst auf apache2 mit php5

Post by toyflish »

habe ein script das statische seiten generiert, indem es eine dynamische vesion miner Website spidert und statisch ablegt.
Auf meinem apeche1.3 mit php4.3 brauchte es für 500 htmlseiten ca 30 sec und der server hatte hohe load

Auf meinem apache2.0 mit php5 dauert das gleiche script ungefähr 4 min und der server hat dabei geringe load.

gibt es in php5 oder apache2 direktiven, die den server bei sowas bremsen, oder spiderattacken engegenwirken ?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: php-performance gebremst auf apache2 mit php5

Post by Joe User »

Apache/PHP-Version? Welches MPM? Welche Module (Apache/PHP)? Configs? Logs?
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
toyflish
Posts: 20
Joined: 2003-11-09 11:46
Location: Kiel
 

Re: php-performance gebremst auf apache2 mit php5

Post by toyflish »

Apache/2.0.49 (Linux/SuSE)
Module ::
core
prefork
http_core
mod_so
mod_access
mod_actions
mod_alias
mod_auth
mod_auth_dbm
mod_autoindex
mod_cgi
mod_dir
mod_env
mod_expires
mod_include
mod_log_config
mod_mime
mod_negotiation
mod_setenvif
mod_ssl
mod_suexec
mod_userdir
mod_php5
mod_rewrite
mod_fpcgid
mod_proxy
proxy_http

PHP Version 5.0.0 als module
memory_limit 64M

hier is auch noch die phpinfo
http://toyflish.de/info.php

ich hab versucht die verdoppelung der Clients eine höhere rate zu erziehlen, hat aber keine deutlichen unterschiede gebracht
<IfModule prefork.c>
# number of server processes to start
StartServers 10
# minimum number of server processes which are kept spare
MinSpareServers 10
# maximum number of server processes which are kept spare
MaxSpareServers 20
# highest possible MaxClients setting for the lifetime of the Apache process.
ServerLimit 300
# maximum number of server processes allowed to start
MaxClients 300
# maximum number of requests a server process serves
MaxRequestsPerChild 0
</IfModule>

kann es an mod_prefork liegen?
also ich brauch keine besonders komplizierte konfiguration, der server ist die fast immer idle, aber wenn mal was generiert werden soll, soll er auch vollgas geben.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: php-performance gebremst auf apache2 mit php5

Post by Joe User »

toyflish wrote:Apache/2.0.49 (Linux/SuSE)
Apache updaten und (mindestens) folgende Module entsorgen:
toyflish wrote: mod_auth_dbm
mod_autoindex
mod_cgi
mod_expires
mod_include
mod_userdir
mod_fpcgid
mod_proxy
proxy_http
PHP updaten (bitte selbst anpassen):

Code: Select all

cd /usr/src/php-5.0.2
CFLAGS="-O2 -pipe -march=pentium3 -mmmx -msse -mfpmath=sse -fno-strict-aliasing" CXXFLAGS="-O2 -pipe -march=pentium3 -mmmx -msse -mfpmath=sse -fno-strict-aliasing" ./configure --prefix=/usr --datadir=/usr/share/php --mandir=/usr/share/man --bindir=/usr/bin --libdir=/usr/share --includedir=/usr/include --sysconfdir=/etc --with-_lib=lib --with-config-file-path=/etc --with-exec-dir=/usr/lib/php/bin --with-apxs2=/usr/sbin/apxs --disable-all --disable-ipv6 --disable-cgi --enable-cli --enable-sigchild --enable-short-tags --enable-libxml --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-calendar --enable-ctype --with-curl --with-curlwrappers --enable-dio --enable-dom --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-gmp --with-imap --with-imap-ssl --with-mcrypt --with-mhash --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --enable-pcntl --with-pcre-regex --enable-posix --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-spl --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-tokenizer --enable-wddx --enable-xml --with-xmlrpc --with-xsl --with-pear --enable-maintainer-zts --enable-inline-optimization --enable-memory-limit && make && make install
toyflish wrote:kann es an mod_prefork liegen?
Ja. Desweiteren solltest Du Apache nicht als root starten...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
oxygen
Posts: 2138
Joined: 2002-12-15 00:10
Location: Bergheim
 

Re: php-performance gebremst auf apache2 mit php5

Post by oxygen »

Joe User wrote: ... Desweiteren solltest Du Apache nicht als root starten...
Nanu? Wie sollte sich der Apache dann an den Port binden?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: php-performance gebremst auf apache2 mit php5

Post by Joe User »

Sieh Dir mal seine ENV an ;)
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Post Reply