NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] peak memory usage


Joined: 29 Jan 2008
Posts: 11
Reply with quote
I swapped out Xcache for PHPExpress to see how it performed and noticed on my development box it gave similar if not slightly faster results but the memory usage spiked. I'm now seeing usage for scripts that before would have a 1.6mb peak memory usage now report a peak of about 4.4mb. The usage reported for the end of script amounts also took off.

I have seen this before on my development box and restarting apache a second time fixes the problem if I recall. So I tried to restart my webserver and my memcache server but the memory usage reports remained high.

Does PHPExpress do something wacky to the memory reporting functions or does it actually cause memory usage to skyrocket?

PHP 5.2.3 w/ PHPExpress 1.4.2
Windows XP
Apache 2.2

[edit: I rebooted and the memory usage still remains high.]
View user's profileFind all posts by stackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Would you please compare non-accelerated php against php accelerated with phpexpress to see if it makes any difference in memory usage?
If it makes, please provide a code sample and name the tool(s) you used to measure memory usage.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jan 2008
Posts: 11
Reply with quote
Without any accelerators
Code:

Size: 25685 bytes | Time: 0.41 secs | Peak Mem: 3.776 MB | Mem: 3.682 MB | Includes: 71
Resources: 71 | Buildup Time: 0.001 secs
View Count: 3 | Render Time: 0.114 secs | View Call Depth 2
Query Count 9 | Query Time: 0.016 secs

I got times in the 0.36 to 0.59 range, 0.47 avg

With PHPExpress loaded with extension=
Code:

Size: 25685 bytes | Time: 0.33 secs | Peak Mem: 3.792 MB | Mem: 3.698 MB | Includes: 71
Resources: 71 | Buildup Time: 0.001 secs
View Count: 3 | Render Time: 0.114 secs | View Call Depth 2
Query Count 9 | Query Time: 0.017 secs

I got times in the 0.31 to 0.39 range, 0.34 avg, second run 0.34 avg

With PHPExpress loaded with zend_extension_ts=
Code:

Size: 25685 bytes | Time: 0.31 secs | Peak Mem: 3.792 MB | Mem: 3.698 MB | Includes: 71
Resources: 71 | Buildup Time: 0.001 secs
View Count: 3 | Render Time: 0.112 secs | View Call Depth 2
Query Count 9 | Query Time: 0.017 secs

I got times in the 0.3 to 0.38 range, 0.31 avg, second run 0.32 avg

With Xcache loaded with zend_extension_ts=
Options (without these options set Xcache isn't REALLY enabled)
xcache.cacher = On
xcache.size = 32M
Code:

Size: 25685 bytes | Time: 0.34 secs | Peak Mem: 1.345 MB | Mem: 1.251 MB | Includes: 71
Resources: 71 | Buildup Time: 0.002 secs
View Count: 3 | Render Time: 0.124 secs | View Call Depth 2
Query Count 9 | Query Time: 0.019 secs

I got times in the 0.33 to 0.41 range, 0.36 avg

With APC (no ini options configured) loaded with extention=
Code:

Size: 25685 bytes | Time: 0.33 secs | Peak Mem: 3.596 MB | Mem: 3.502 MB | Includes: 71
Resources: 71 | Buildup Time: 0.001 secs
View Count: 3 | Render Time: 0.117 secs | View Call Depth 2
Query Count 9 | Query Time: 0.017 secs

I got times in the range of 0.3 to 0.39, 0.34 avg

APC does not appear to let itself be loaded with zend_extension_ts=
??

With eAccelerator (no ini options configured) loaded with zend_extension_ts=
Code:

Size: 25685 bytes | Time: 0.32 secs | Peak Mem: 1.308 MB | Mem: 1.215 MB | Includes: 71
Resources: 71 | Buildup Time: 0.001 secs
View Count: 3 | Render Time: 0.124 secs | View Call Depth 2
Query Count 9 | Query Time: 0.016 secs

I got times in the range of 0.3 to 0.41, 0.32 avg

Once more without any accelerators
Code:

Size: 25685 bytes | Time: 0.39 secs | Peak Mem: 3.776 MB | Mem: 3.682 MB | Includes: 71
Resources: 71 | Buildup Time: 0.001 secs
View Count: 3 | Render Time: 0.114 secs | View Call Depth 2
Query Count 9 | Query Time: 0.016 secs

I got times in the 0.38 to 0.56 range, 0.45 avg

To try to make this unscientific test as fair as possible while run on a development desktop
- I didn't open or close any other applications in between restarts of apache
- I had all applications minimized save for firefox, notepad++, and the services window.
- The dashboard displays are from the last run not the best one.
- I did not include the initial page load after restarting apache and only averaged the 20 refreshes after that initial hit.

I completely take back my concern that PHPExpress was doing something wacky to my memory usage since Xcache and eAccelerator are the ones that do something wacky when compared to runs without accelerators. I'll have to research this.

Also interesting to me was the loading of PHPExpress with zend_extension_ts. I reloaded php_express.dll one more time with extension= to see if other processes on my machine caused the change in times and average. The results I got back were the same as before so I suppose something is gained by loading it that way. I then double checked and reran the zend_extension_ts test and got similar results. Memory usage for each second run matched the first.

I guess this also serves as a simple quick and dirty 'ymmv' benchmark between PHP standalone, PhpExpress, Xcache, APC, and eAccelerator.

The values of Peak and mem come from these php functions memory_get_peak_usage() and memory_get_usage(). I can't release the code to reproduce this page.
View user's profileFind all posts by stackSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
eAccelerator are the ones that do something wacky when compared to runs without accelerators. I'll have to research this

Not needed. They run bytecodes in the shared memory directly and BTW they do this without any locks.
Because they both are turk mmcache successors, there is no difference in the approach and certainly they inherited all pros and cons.



Thanks for your test and feedback provided. Would be even better if you post some details about scripts you used and certain info about platform (CPU, its clock, memory size, memory clock) and software platform (OS, php version, web server version, php startup as FASTCGI/CGI or SAPI module).

Let know if you're interested in further tests. I can provide you with next version of PhpExpress.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
[resolved] peak memory usage
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic