MyBB Community Forums

Full Version: Low MySQL and High PHP Usages?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This isn't so much a request for support, but rather a random inquiry out of curiosity.

Generated in 0.0323999 seconds (95.24% PHP / 4.76% MySQL)
SQL Queries: 9 / Global Parsing Time: 0.0153301 / Memory Usage: 3 MB
PHP version: 5.2.4-2ubuntu5.9 / Server Load: 0 / GZip Compression: Enabled

(The "Server Load" value is wrong, so ignore it.)

That's one example, but MySQL usage seems to vary around that range (~5%-7%, and sometimes into the teen values, but rarely higher).

Does the above necessarily indicate that PHP is using more than it should be, or could it be that MySQL is using next to nothing so PHP is left using most of the time? The database (MySQL) is small and the forums new and slow, but I just want to make sure one of them isn't using too much (PHP in this case).

I understand that these aren't "load" kind of values, so a high PHP percentage might not necessarily indicate high PHP usage, per se, but I'm not a master at PHP nor MySQL specifically, so I don't know what "normal" is or what each should be. Does that seem out of the ordinary for what many of you would expect to see on basically a new and fresh install?

Also, state your values (and your database size/traffic levels) if you wish. I'm interested in seeing the values for different setups.
Seems to be that MySQL is just running very quickly. If MySQL is only using 4.76% of a generation time of 3/100 of a second, it's pretty good. One of my forums:

Generated in 0.1686711 seconds (41.80% PHP / 58.20% MySQL)
SQL Queries: 96 / Global Parsing Time: 0.0505841 / Memory Usage: 2.25 MB
I notice you have over ten times the amount of SQL queries I have. That seems to be a major factor? I presume this is because my forum is ridiculously small and not high traffic? You seem to have lower memory usage though (which I presume is PHP), despite this.
Usually you will have a high PHP percentage and a low MySQL percentage. This is because most of the processing is done by PHP, whereas there is only a bit of data being retrieved by MySQL on each page.

You will usually find a higher MySQL percentage on weird server setups (especially if the MySQL server you are using is not on the same network as your web server), or plugins that aren't written well.