Once you know you’ve got a server performance issue, how do you know what to fix? Here are some server performance issues that may be slowing down your server.
Memory leaks
Leaks can accumulate maxing out the memory of your server and slowing it to a crawl.
Solution: You can of course increase the memory in your server, but the best fix would be to locate the memory leak and recode the offending script.
Too many processes / connections
Programs that keep spawning processes or don’t release server connections can bog down your server response time.
Solution: rewrite the code to release resources upon completion.
External resource delays
Loading JavaScript or other resources from off-site can cause indeterminate delays for your own site. JQuery, advertising scripts, Google Plus One, Facebook, and other external resources are typically loaded with a remote JavaScript call to Google, Facebook, or some other busy site. Loading infrequently changing resources (like a programming library) remotely introduces DNS and network overhead, and indeterminate delay from a server you don’t control.
Solution: Periodically cache the resource locally on your server and serve locally. Use a CRON script to copy the resource.
Inefficient SQL Queries
Database queries that are written poorly can cause slowdowns to web sites. Databases that aren’t indexed properly can also cause slowdowns.
Slow database calls
Each additional plugin can make calls to a database, which can add up.
Solution: Disable any unnecessary plugins in Wordress or your favorite CMS.
Insuficient server resources
Low memory, bandwidth caps, or limited disk space can cause paging and poor server response times.
Solution: Use VMStat, Top, etc. to locate bottlenecks and either decrease resource usage or increase resources (more memory and disk space can’t hurt).
Overloaded Shared Servers
Some hosting companies put too many sites on the same shared server. Servers have limited resources and these can be taxed (memory, processes, bandwidth, etc.) by having too many sites competing for the same resources. Just one heavily loaded site hosted on a shared server can slow down all the other sites hosted. Solution: Move to a lightly loaded shared server, or a dedicated server where you have complete control. .
Inconsistent website response times
If your site is slower during different parts of the day (say near lunch time for example), it may be due to increased load on the server slowing down your response time due to maxed out resources (processes, memory, disk space, bandwidth).
Solution: Find which resource(s) are highly utilized (CPU, memory, processes etc) during high load and profile and fix “hot code” to help minimize the impact of your scripts. Increasing the resources allocated to your server may help (number of processes for example).