Hi there!
Recently, I moved a website to a Linode 1024, and although I'm happy with the performance of the server, I think I can improve the speed a bit more. Before someone warns me about the same, yes, I read other threads about Apache/PHP/MySQL optimization, I searched in Google, etc.
I run Ubuntu 10.04 and Apache with PHP as a module, and MySQL, all upgraded to the latests versions available for the distribution. I just want to compile general tips about optimization for these servers. In my case, my CPU usage is high, it ranges from 0.5 to 1.0. Memory consumption is about 30% in the entire system, so I have a huge margin here. Note that I'm not an expert in servers administration, but I don't consider myself a noob
In
MySQL, I run the Slow Queries Log, with
long_query_time as low as 0.15 for it to log something. I've targeted some queries that are executed with these times. Yes, they're low times, but these queries are executed very often, so they imply high load. In fact, disabling them reduces MySQL's CPU usage from 20-30% to 0-3%. Although they use properly indexed tables, I will simplify them.
I also run MySQL Tuner script. It made some recommendations, I applied them, but didn't notice any improvements in the server. Now, considering the characteristics of my Linode 1024, what values do you think I should modify at
my.cnf to reduce CPU usage even more? I don't want to show my present settings, so they don't influence what you may say.
Regarding
Apache, I have disabled
AllowOverride directive and moved the content of all
.htaccess files to the sites definition files, so that
.htacess is not read every time a page is loaded, and all the settings loaded with Apache. This reduced server load about 10-15%. Again, what values do you think I should modify at
apache2.conf to reduce CPU usage even more?
And finally, about PHP... Well, I think this is more related to the script than PHP's settings, but any tip will be welcome.
As I said, my priority is to reduce CPU. I don't mind to increase memory or disk consumption.
Thanks in advance!