Re: [PHP4BETA] PHP4b3 RC3 Memory usage
| From: | Chris Chabot | Date: | Wed, 10 Nov 1999 12:13:11 +0000 |
| Subject: | Re: [PHP4BETA] PHP4b3 RC3 Memory usage | ||
| References: | 1 2 3 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6102@lists.php.net to get a copy of this message | ||
Ok ive finaly come around to setting up some test cases.
These are the 2 different configurations:
apache 1.3.9 / php 3.0.12
php conf:
./configure --disable-inline --disable-debug --enable-sysvsem --enable-sysvshm \
--enable-track-vars --with-zlib --with-mysql=/usr/local --with-gettext --with-gd \
--with-ttf --with-apache=../apache_1.3.9
CFLAGS=-O2
And
Apache 1.3.9 / php 4b3 RC4
php conf:
./configure --disable-inline --disable-debug --enable-sysvsem \
--enable-sysvshm --enable-track-vars --with-zlib --with-mysql=/usr/local \
--with-gettext --with-gd --with-ttf --with-apache=../apache_1.3.9 \
--with-readline --with-ftp --with-mcrypt --with-mhash
CFLAGS=-O2
Recorded are 3 states. eg startup mem size, mem size after hitting the <? phpinfo(); ?> page a
few times (50k times), and after doing a simple mysql query script (that basicly
does a count(*) from table, fetches result in a list($count) = mysql_fetch_row($res) statement, and
echo's $count.
I also included apache bench's requests a second result, to give some insight into php4's
normal performance. given the nature of the scripts, they shouldnt differ /to/ much since
there both very small scripts where I/O gives more overhead then the scripting envirioment.
Start info query
php3 1500 1868 (no leaks) 1948 (no leaks)
reqs/sec 361.41 349.14
php4 1776 2128 (no leaks) 2208
reqs/sec 225.99 343.11
As you can see php4 is performing a little slower on real simple scripts. but its memory usage on
the info.html and simplequery.html pages is very respectable. A little higher,
ok, but nothing to be upset about.
What strikes me weird here is that the info page is so much slower, but i gues php4 just has a lot
more cool modules to dump in the info page.
Now to do this on the reviewboard code (quite complex, more then 100 variables , and 243 functions
in global scope.
(20k requests)
php3 5088 (no leaks)
php4 starts at 6208 then grows to around 7340 ... keeps hanging around that number.
As u can see, there's no memory footprint problem with the basic configuration, or basic
scripts. But as soon as i unleash some real life big scripts @ it (i tried this w/ other
script bases to, same results) the memory usage is substancialy higher then w/ php 3 ... 3 1/3 megs
per process extra is a killer for a box with 100 httpd's open ... thats 300
megs of memory dude! :) this would definatly scare me away from an upgrade....
if there's any other things i can try, or even give Sascha or rasmus access to one of my test
boxes to they can play with it (cable modem or t1 connects, dont wurry) let me know.
-- Chris Chabot
CTO Reviewboard Magazine
Sascha Schumann wrote:
> On Tue, Nov 09, 1999 at 09:57:42AM -0500, Rasmus Lerdorf wrote:
> > This memory usage issue is definitely something we need to address. The
> > Zend parser should be much more efficient with its memory usage because of
> > the reference counting, and the various extensions should at worst be
> > using as much memory as PHP 3, so going from 3M to 7M per httpd is a
> > mystery to me. I think we need to do a bit of scientific testing
> > here. Have a simple little script that just does a "Hello World" to start
> > with and bang at it with ab or http_load with both PHP 3 and 4.
> >
> > Then make the script do a simple MySQL query and compare the numbers.
> >
> > I'll try to find some time today to do a check on my box to see if I can
> > verify your numbers.
>
> I've just sent the attached email to Chris. The page I
> accessed contained only <?phpinfo()?>, so there is a chance
> that the leak appears only in complex scripts.
>
> --
>
> Regards,
>
> Sascha Schumann
> Consultant
>
> ------------------------------------------------------------------------
>
> Subject: Re: [PHP4BETA] PHP 4.0b3, second try
> Date: Tue, 9 Nov 1999 16:10:48 +0100
> From: Sascha Schumann <sascha@schumann.cx>
> To: Chris Chabot <chabotc@reviewboard.com>
> References: <Pine.LNX.4.04.9911091245580.22365-100000@tjafs.fast.no>
> <38282CB8.CBE01F77@reviewboard.com> <19991109151912.A16464@schumann.cx>
> <382832A7.43210EA0@reviewboard.com>
>
> > ps testing tool i use to test these releases is http_load
> > (http://www.acme.com/software/http_load/)
> > i strongly sugest this program to anyone who wants to do some serious load
> > testing.
>
> How large is the process at startup time? If it grows
> drastically during http_load, you probably have found a
> memory leak.
>
> I've compiled 4.0b3-RC3 with
>
> CFLAGS="-O2 -march=pentiumpro" \
> ./configure \
> --disable-debug \
> --disable-inline \
> --with-apache=../apache_1.3.9 \
> --with-mysql=/local/mysql
>
> Apache was compiled then with
>
> CFLAGS="-O2 -march=pentiumpro" \
> ./configure \
> --prefix=/some/where \
> --activate-module=src/modules/php4/libphp4.a
>
> Now, on startup the process is a little bit larger than 2MB.
> That includes the complete PHP module. After running 70
> parallel HTTP queries against a PHP-generated page, the
> server process hardly grew in size (+70KB).
>
> What does your demo page(s) do? Is the effect similar, if the
> only page you access is "<?phpinfo()?>" ?
>
> --
>
> Regards,
>
> Sascha Schumann
> Consultant
>
> ------------------------------------------------------------------------
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net