There are many reasons for this. Your first place to look would be anything I/O (disk) related as this is the slowest component of any system. If you run top
when accessing one of the sites, and you observe that the value for %wa
is consistently high (50%+ for a 2 CPU system), it's likely you're saturating your disks. You can run vmstat 1
as well which will give you a better breakdown of what your system is doing. The wa
value (usually the second last column under the cpu
heading) is the same as the one in top
. You could be out of RAM and therefore swapping, or your database(s) could be hitting the disks too often. In this case, I recommend increasing the RAM on the VM.
Second place to look is CPU contention. If yous CPU is constantly high between the user and system values (us
and sy
values in vmstat), you likely need more CPUs on the system.
I/O and CPU contention are typically the causes of poor performance. As you can tell from this answer, there's no simple solution. Between top
, vmstat
and even iostat
, you should be able to pinpoint what your system is doing.