On Mon, 2009-03-09 at 17:21 +0000, Mark Rogers wrote:
I have a server which was originally a low spec virtual machine with 128MB RAM, but which is now running on 4-times that RAM (shortly to be doubled again) and a faster "CPU". Available bandwidth has also been doubled.
With the increase I'm disappointed not to be seeing much difference in the performance of websites on the server. Many of them are heavily database dependent with lots of queries, so the real fix is to optimise the code itself, but in the short term the CPU and memory hike needs to be showing some kind of benefit.
If increasing RAM and CPU power has made little difference the conclusion surely is that the performance is I/O limited. Where was the increase in bandwidth - between the server and the clients? If so perhaps the disk I/O bandwidth is the bottleneck.
Tuning the SQL is probably useful and I'd start by timing each query so as to tune the slowest, frequently used query first.
It may also be possible to tune the database. For example, now you have more RAM could you make it do hash joins (with the hash index in RAM) rather than external joins like sort/merge and indexed?
The behaviour of the server is to work fine then suddenly run like a dog for a while, then come back up.
In that case I'd note the times when the performance is poor and try to work out if there is regular job that runs at that time. If, for example, disk I/O is the bottleneck something that does some kind of disk scan (like updatedb - part of locate) could reduce performance for a while.
How do I go about finding what the bottleneck is? ("top" showed both before the upgrade and since that no swap is being used and CPU usage is never particularly high, with Apache sometimes hitting ~20% but mostly not showing.
It seems to me a 'top' for I/O may be useful so I googled it and found the following:
http://linuxpoison.blogspot.com/2008/07/iotop-io-performance-meter-like-top....
Regards, Steve.