Page 1 of 1
PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 18:36
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
enthält. Hat da jemand Vergleichswerte?
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 18:56
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.
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 19:08
by alexander newald
Code: Select all
-rwxr-xr-x 1 root root 10538610 Aug 14 13:08 /usr/bin/php
Hat da jemand Vergleichswerte?
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 19:13
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
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 19:23
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
steht die fast ganz oben drin.
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 19:32
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
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 19:58
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...
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 20:01
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!
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 20:24
by alexander newald
Hm, also auch mit der Angabe des Pfads für mysql wird es nicht besser?!
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 20:43
by captaincrunch
Wie wär's denn mal mit "strip" ?
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-15 20:48
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:
Re: PHP als CGI - Wie gross bei euch?
Posted: 2003-10-16 15:58
by alexander newald
*nach oben schieb*