Pinpointing bottlenecks
Before diving in and making changes to your website, it makes sense to first identify the most significant bottlenecks. That helps you prioritize areas to fix, so that you make the best use of your time.
Memory
First check whether the server is running out of memory. If it does, that will increase CPU usage and disk I/O (input/output), meaning that solving memory pressures will automatically reduce pressures on the CPU and Disk as well.
Shortage of memory increases CPU usage and disk I/O because when the server runs out of memory, it makes room by swapping pages of less-used data in memory to a swap file on disk, named pagefile.sys
. Now when that data is needed again, and the server can't find it in memory, it causes a hard page fault, meaning that the server has to retrieve the data from the disk. All this takes much more CPU usage and disk I/O than a simple memory access.
The tool to use to see how much page swapping is going on depends on your operating system.