PHP als CGI - Wie gross bei euch?

Apache, Lighttpd, nginx, Cherokee
Post Reply
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

PHP als CGI - Wie gross bei euch?

Post by alexander newald »

Hallo,

ich habe PHP als CGI laufen und habe mich schon immer über die Grösse im Ram gewundert:

Code: Select all

alex    17371  1.5  1.1 40176 2752 pts/1    S    18:36   0:00 /usr/bin/php ./test.php
Wobei test.php nur

Code: Select all

<?php
sleep(10);
?>
enthält. Hat da jemand Vergleichswerte?
jjay
Posts: 14
Joined: 2003-10-15 11:15
 

Re: PHP als CGI - Wie gross bei euch?

Post by jjay »

ich habe gerade keine Werte da, aber das PHP-Binary an sich sit schon verdammt groß, mach mal ein
$ ls -l /usr/bin/php
Von daher sollte man schon schauen welche Extensions man mit einkompiliert.
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by alexander newald »

Code: Select all

-rwxr-xr-x    1 root     root     10538610 Aug 14 13:08 /usr/bin/php
Hat da jemand Vergleichswerte?
jamesb
Posts: 661
Joined: 2002-05-08 15:35
Location: Karlsruhe
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by jamesb »

Code: Select all

-rwxr-xr-x    1 root     staff     1674444 Aug 31 16:51 /usr/local/bin/php
Irgendwas scheint bei dir faul zu sein... Hast du das Binary vielleicht statisch gelinkt? :)

JamesB
jjay
Posts: 14
Joined: 2003-10-15 11:15
 

Re: PHP als CGI - Wie gross bei euch?

Post by jjay »

Code: Select all

$ ls -l /usr/local/bin/php
-rwxr-xr-x    1 root     root      5924346 Aug 26 21:33 /usr/local/bin/php
wobei mein (recht altes) PHP5-cvs

Code: Select all

$ ls -l /opt/php5/bin/php
-rwxr-xr-x    1 root     root     12481033 May 18 13:36 /opt/php5/bin/php
auch nicht klein ist. Habe nochmal auf der anderen Mashine nachgeschaut, da hat mein PHP4.3.3

Code: Select all

$ ls -l /usr/bin/php
-rwxr-xr-x    1 root     root      3902577 Jul 22 21:57 /usr/bin/php
Da habe ich auch nur recht wneig einkompiliert. Wie lautet Deine configure-Zeile? Wenn Du die nciht zur Hand hast: In der Ausgabe von

Code: Select all

<?php
  phpinfo();
?>
steht die fast ganz oben drin.
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by alexander newald »

Die habe ich:

Code: Select all

./configure                                                     
        --prefix=/usr                                           
        --sysconfdir=/etc                                       
        --enable-discard-path                                   
        --with-openssl                                          
        --with-zlib                                             
        --enable-bcmath                                         
        --with-bz2                                              
        --enable-calendar                                       
        --enable-dba                                            
        --with-gdbm                                             
        --enable-dio                                            
        --enable-ftp                                            
        --with-gd                                               
        --with-jpeg-dir=/usr                                    
        --with-png-dir=/usr                                     
        --with-zlib-dir=/usr                                    
        --with-freetype-dir=/usr                                
        --enable-gd-native-ttf                                  
        --with-gettext                                          
        --enable-mbstring                                       
        --enable-mbregex                                        
        --with-mime-magic                                       
        --with-mysql                                            
        --disable-overload                                      
        --with-readline                                         
        --with-mm                                               
        --enable-sysvmsg                                        
        --enable-sysvsem                                        
        --enable-sysvshm                                        
        --with-expat-dir=/usr                                   
        --disable-debug                                         
        --enable-versioning                                     
        --with-imap=/usr/local/imap-c-client                    
        --with-imap-ssl                                         
        --enable-memory-limit
jjay
Posts: 14
Joined: 2003-10-15 11:15
 

Re: PHP als CGI - Wie gross bei euch?

Post by jjay »

mir fällt das --with-mysql auf, da solltest Du den Pfad einer lokalen lokalen MySQL-Client-Lib angeben. Ohne Pfadangabe wird eine recht alte mitgelieferte verwendet, die dann auch statisch gelinkt wird. Wie sich das auf den RAM-Verbrauch auswirkt weiß ich aber nicht anosnten fällt mir nichts auf. Je nach expertierfeude und notwendigkeit kannst Du jedoch mal imap und gd rasunehmen und schauen was das ausmacht...
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by alexander newald »

Ich lasse gerade mal ein Zyklus durchlaufen, wo immer eine Option mit mehr aufgenommen wird. Mal schauen, was da jeweils die Dateigrössen sagen. Ansonsten werde ich das mal mit der Pfadangabe für mysql probieren!
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by alexander newald »

Hm, also auch mit der Angabe des Pfads für mysql wird es nicht besser?!
captaincrunch
Userprojekt
Userprojekt
Posts: 7066
Joined: 2002-10-09 14:30
Location: Dorsten
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by captaincrunch »

Wie wär's denn mal mit "strip" ?
DebianHowTo
echo "[q]sa[ln0=aln256%Pln256/snlbx]sb729901041524823122snlbxq"|dc
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by alexander newald »

Hm, na ja jetzt ist die Datei nur noch 2667176 Byte gross, aber der Arbeitsspeicherverbrauch ändert sich dadurch nicht (Es ging mir eher um den Arbeitsspeicher als um den Festplattenplatz). Ich finde:

Code: Select all

alex    17371  1.5  1.1 40176 2752 pts/1    S    18:36   0:00 /usr/bin/php ./test.php
ist irgendwie viel!?

Zumal das ganze, wenn das PHP Skript sich beendet so aussieht:

while true;do ps xau|grep "test.php";done

Code: Select all

admin     3391  0.2  1.1 40176 2748 pts/5    S    20:48   0:00 ./php /home/admin/test.php
admin     3391  0.2  1.1 40176 2748 pts/5    S    20:48   0:00 ./php /home/admin/test.php
admin     3391  0.2  1.1 40176 2748 pts/5    S    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.3  8.2 40176 20372 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.4  9.2 40176 22796 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 10.9 40176 26948 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 10.9 40176 26948 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 10.9 40176 26948 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 10.9 40176 26948 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.9 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.9 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.9 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
admin     3391  1.7 12.2 40176 30384 pts/5   R    20:48   0:00 ./php /home/admin/test.php
(Es spielt übrigens keine Rolle, ob als Benutzer Alex oder Admin)

Und in dem test.php steht einfach nur:

Code: Select all

<?php
sleep(10);
?>
alexander newald
Posts: 1117
Joined: 2002-09-27 00:54
Location: Hannover
Contact:
 

Re: PHP als CGI - Wie gross bei euch?

Post by alexander newald »

*nach oben schieb*
Post Reply