Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Performance Metrics

I am currently developing a PHP MVC Framework for a personal project. While I am developing the framework I am interested to see any notable performance by implementing different techniques for optimization. I have implemented a crude BenchMark class that logs mircotime.

The problem is I have no frame of reference for execution times. I am very near the beginnig of this project with a database connection and a few queries but no output (bar some debugging text and BenchMark log). I have a current execution time of 0.01917 seconds.

I was expecting this to be lower but as I said before I have no frame of reference. I appreciate there are many variables to take into account when juding performance but I am hoping to find some sort of metric to
a) techniques to measure performance for example requests per second and
b) compare results for example; how a "moderately" sized PHP application on a "standard" webserver will perform. I appreciate "moderately" and "standard" are very subjective words so perhaps a table of known execution times for a particular application (eg StackOverFlow's executing time).

What are other techniques of measuring performance are there other than execution time?

When looking at MVC Framework Performance Comparisom it talks about Requests Per Second (RPS). How is this calculated? I am guessing with my current execution time of 0.01917 seconds can handle 52 RPS (= 1 / 0.01917 ). This seems to be significantly lower than that quoted on the graph especially when you consider my current limited funcitonality.

like image 842
bigstylee Avatar asked Nov 05 '22 14:11

bigstylee


1 Answers

To benchmark a certain page, use ab. To benchmark a load of pages on the server, try siege.

However... both of those are still mostly artificial tests. I personally add some extra logs too.

  • Page load time in the webserver (or proxy, whatever)
  • Slow query logging in the database
  • Query count logging per page too if possible, that way you'll know how heavy your pages are ;)
like image 141
Wolph Avatar answered Nov 12 '22 16:11

Wolph