ID:               27215
 Comment by:       wf at bitplan dot com
 Reported By:      waboring at 3gstech dot com
 Status:           Open
 Bug Type:         Performance problem
 Operating System: Redhat 9
 PHP Version:      5CVS-2004-02-10 (dev)
 New Comment:

We get Apache crashes with this issue. We are loading some 100 PHP
classes that are generated from an UML model. The total number of lines
is some 23.000. Initially the require_once calls for all classes take a
few millisecs. After a while the time rises to 3, 7, 15, 25 or more
seconds until Apache crashes. 

Using __AUTOLOAD does not help much. have a look at this profile:

needed 4765 msecs

start:23:42:07.662623

after GenepiArchitecture include:23:42:07.670712

after GenepiContent include:23:42:10.656884

be/estro/genepi/classNameValueList.php:23:42:10.742749

after session_start:23:42:10.772402

be/estro/genepi/classWebFrameManager.php:23:42:10.977352

be/estro/genepi/classWebFrame.php:23:42:11.376788

be/estro/genepi/classTimer.php:23:42:11.483785

be/estro/genepi/classSystemConfiguration.php:23:42:11.636121

be/estro/genepi/classDatabaseManager.php:23:42:11.807113

be/estro/genepi/classDatabase.php:23:42:12.21742

be/estro/genepi/classSessionManager.php:23:42:12.288590

be/estro/genepi/classSession.php:23:42:12.422696

be/estro/genepi/classUserManager.php:23:42:12.556828

com/bitplan/common/XPath.class.php:23:42:14.405958

be/estro/genepi/classUser.php:23:42:14.745952

be/estro/genepi/classUserRoleManager.php:23:42:14.866260

be/estro/genepi/classUserRole.php:23:42:14.941703

be/estro/genepi/classMenuManager.php:23:42:14.990230

be/estro/genepi/classMenu.php:23:42:15.512703

be/estro/genepi/classMenuItemManager.php:23:42:15.580588

be/estro/genepi/classMenuItem.php:23:42:15.586010

be/estro/genepi/classFunctionCallManager.php:23:42:15.591146

be/estro/genepi/classFunctionCall.php:23:42:15.596076

stop:23:42:16.251670



1.9 secs for XPath.class.php alone ...


Previous Comments:
------------------------------------------------------------------------

[2004-03-23 17:44:26] waboring at 3gstech dot com

Some more data points.  I used apache bench to run the test.php script
in my last post.  I tested against php 4.3.2 and today's cvs php5. 
Here are the results.



php4:

Server Software:        Apache/1.3.26

Server Hostname:        phphtmllib.hemna.corp.qualys.com

Server Port:            80



Document Path:          /test.php

Document Length:        34 bytes



Concurrency Level:      1

Time taken for tests:   9.748 seconds

Complete requests:      100

Failed requests:        0

Broken pipe errors:     0

Total transferred:      22900 bytes

HTML transferred:       3400 bytes

Requests per second:    10.26 [#/sec] (mean)

Time per request:       97.48 [ms] (mean)





php5:

Server Software:        Apache/1.3.26

Server Hostname:        phphtmllib.hemna.corp.qualys.com

Server Port:            80



Document Path:          /test.php

Document Length:        34 bytes



Concurrency Level:      1

Time taken for tests:   39.551 seconds

Complete requests:      100

Failed requests:        0

Broken pipe errors:     0

Total transferred:      24300 bytes

HTML transferred:       3400 bytes

Requests per second:    2.53 [#/sec] (mean)

Time per request:       395.51 [ms] (mean)

------------------------------------------------------------------------

[2004-03-23 17:06:45] waboring at 3gstech dot com

ok with further testing, I have trimmed my configure line down to the
following.



./configure \

-with-apxs=/usr/local/apache/bin/apxs



I then restart apache.

First hit to the test script .097 s

Second hit .187 s

third .264 s

.332 s

.346 s

.392 s  (peaked out here)



In each test, I wait a few seconds to make sure there is no load on the
machine.  I'm using a seperate machine to run the browser as to not
polute the server response times.



The entire php script.



<?php

$_time = explode(" ",microtime());

$start = $_time[1] + $_time[0];



$phphtmllib = "phphtmllib";

include_once( $phphtmllib."/includes.inc");



$_time = explode(" ", microtime());

$stop = $_time[1] + $_time[0];

$elapsed = substr($stop - $start, 0, 5);

echo "<i>elapsed time: ".$elapsed." s </i><br>\n";

?>

------------------------------------------------------------------------

[2004-03-23 16:40:14] waboring at 3gstech dot com

finally bugs.php.net is accessable again.  I wasn't able to hit it
since last friday!  bleh.



Anyway, I have tested w/ an up to date (as of now) cvs tree of php-src
and have re-run the test and am still seeing significant slowdowns just
by doing includes.



I am running the sample script that I have listed in the original
post.



php4 = .075 ms

php5 = .372 ms



php5 is acting strangely.  I do a restart of apache.

First time I hit the test script (php5) I get a time of about .100ms. 
I then wait about 2 seconds and make sure there is no load on the box. 
Then I hit reload in the browser.  That takes .237ms.  I do the same
thing again, and the next time the script takes even longer to execute
at .372ms.  



Here is my configure line.

./configure \

--with-oci8=/u01/app/oracle/product/8.1.7 \

--enable-sigchild \

--with-mcrypt \

--with-gd \

--with-png-dir=/usr \

--with-jpeg-dir=/usr \

--with-zlib-dir=/usr \

--enable-sysvsem \

--enable-sysvshm \

--enable-shmop \

--with-xml \

--with-zlib \

--with-gdbm \

--with-dom \

--with-curl=/usr \

--with-mysql=/usr \

--enable-mbstring \

--enable-tokenizer \

--enable-sockets \

--with-kerberos=/usr/kerberos \

--with-openssl \

--disable-cgi \

--with-xsl \

--with-bz2 \

--with-mhash \

--enable-soap \

--with-sqlite \

--with-flatfile \

--with-inifile \

--with-curlwrappers \

--with-apxs=/usr/local/apache/bin/apxs

------------------------------------------------------------------------

[2004-03-13 05:01:13] [EMAIL PROTECTED]

Can't you test this with some other code which doesn't require  bug
#27227 to be fixed..?



------------------------------------------------------------------------

[2004-03-03 14:28:25] [EMAIL PROTECTED]

Then we leave the status at "Feedback" until you can test again.



Derick

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/27215

-- 
Edit this bug report at http://bugs.php.net/?id=27215&edit=1

Reply via email to