4
votes

We have ported an important module of a website to Symfony from plain PHP.

This module has a lot of page hits, and we need to judge additional hardware requirements (if any) because of this. We want to benchmark the extra memory and CPU cycles web pages take after porting.

Is there any existing tool or a function in PHP to get these statistics? I have come across the getrusage function in php, but it does not seem to be reliable.

5
Don't mean to be pedantic, but it's spelled "Symfony". - Berry Langerak

5 Answers

3
votes

XDebug can be used to create callgrind files and function traces.

Former explains where in a request time has been spent at, counts of function calls and such. KCacheGrind can be used to inspect that data, for example.

Latter can be used to see how certain function paths in reality works, inspect memory usages of functions and such in per-function basis.

0
votes

Symfony and most other frameworks ive seen offers an inbuilt benchmarking system which ive found quiet useful.

Also see if you find this useful. http://www.markround.com/archives/30-LigHTTPd-and-Apache-Symfony-benchmarks.html

0
votes

Instead of benchmarking this way, you could maybe make a stress test on a development server that is equivalent to the production one, with equivalent requests per second, for example Apache Benchmarking Tool. (And don't forget to install an op-code cache).

0
votes

enter image description here

Symfony is one of the best frameworks for profiling PHP projects. It has some great tools built in.

There was a great talk about your options at Symfony Conf 2010.

The slide show is here http://www.slideshare.net/old_sound/debugging-and-profiling-symfony-apps

0
votes

See our PHP Profiling Tools. You can get relative counts with minimal overhead, or you can get timing on methods and call trees.