Improving Performance on RunCloud
If you feel your server has developed a sluggish performance, there are several things that you can do to improve its responsiveness.
- Block Bad Bots: A large portion of internet traffic is made up of robots that constantly scrape websites. You can block these robots from accessing your site. This will free up resources to serve other customers. Read our knowledgeable post on How To Block “Bad” Bots from Your Web Apps & Servers to learn more.
- Block Hotlinking: Some sites embed resources from other websites to save their resources. If someone embeds your assets, it will put additional strain on your server without providing any value to you. Blocking image hotlinking can save your bandwidth and prevent unauthorized use of your content. Read our knowledge base article in which we have covered several ways to prevent image hotlinking.
- Add Caching: Implementing caching can drastically enhance the performance of your site. You can use a WordPress caching plugin such as RunCloud Hub to create and store static versions of your pages. This reduces the load on your server and improves your site’s performance. You can also consider using Cloudflare CDN to cache and deliver your static assets, such as images, CSS, and JavaScript files, from their global network of servers. Read our Knowledge base post on an introduction to caching on RunCloud to learn more.
- Disable WP-Cron: WordPress has a built-in feature that performs basic tasks such as checking for updates and posting scheduled posts when a visitor visits your site. If your site is receiving a lot of traffic, this can cause unnecessary additional overhead. Read our post on understanding WP-Cron to learn more, or jump directly to How To Add Cron Jobs.
- Monitor Infrastructure to identify bottlenecks: If you are still facing performance issues, you might be limited by the capabilities of your hardware. You can install the New Relic agent on your RunCloud server to track various metrics such as CPU, memory, disk, network throughput, response time, error rate, etc. We have created a step-by-step guide for installing New Relic monitoring on RunCloud.
Do You Need a Load Balancer?
A load balancer distributes incoming traffic among a network of servers, ensuring that no single server is overloaded. This improves the performance and availability of your website. A load balancer can also provide security features, such as SSL encryption and DDoS protection.
You may need a load balancer for your WordPress website if you have high traffic volume, multiple servers, or complex web applications. If a single server cannot handle all of your web traffic, then a load balancer can help. Splitting the traffic across multiple servers will provide redundancy and failover protection in case one of your servers goes down.
However, load balancing also comes with some drawbacks, such as increased complexity and higher costs. Therefore, you should weigh the pros and cons of load balancing before deciding whether you need it or not.
There are different types of load balancing, such as hardware-based and software-based. Hardware-based load balancers use dedicated devices to distribute traffic among a group of servers, while software-based load balancers use software running on a general-purpose server to perform the same task. If you are just getting started, it is better to use software load balancing as it doesn’t require investing in infrastructure.
How Do I Tell the Difference Between Caching, Memory, CPU, and PHP-FPM Issues?
Here are some possible ways to diagnose and troubleshoot common performance problems related to caching, memory, CPU, and PHP-FPM:
Caching Issues
Caching can cause issues if it is not configured properly or if it is outdated. If your site is facing one of the following issues, it might be caused due to caching.
- Your site is not reflecting the latest changes or updates you made.
- Your site is showing inconsistent or incorrect content or behavior.
To fix caching issues, you can try the following steps:
- Clear your browser cache and cookies.
- If you have enabled WordPress caching, purge your cache.
- Check your .htaccess file for any caching rules that may be interfering with your site.
Memory Issues
Memory issues occur when your server does not have enough RAM to handle the requests it receives. Some signs of memory issues are:
- Your site is crashing or returning errors such as “Out of Memory” or “Allowed Memory Size Exhausted“.
- Your site is loading slowly or incompletely.
- Your server has started using a lot of disk space for swap files.
- The system is logging error messages indicating that a process was killed due to memory usage.
- Server health and performance metrics on the RunCloud dashboard show high memory usage.
To fix memory issues, you can try the following steps:
- Increase your server’s RAM by upgrading your plan or adding more resources.
- Optimize your WordPress application by disabling unused plugins and themes, enabling caching plugins, increasing memory limits, and optimizing your MySQL database.
CPU Issues
CPU issues occur when your server’s processor is overloaded or overwhelmed by the requests or processes it receives. You can generally identify CPU issues in the following ways:
- Your site is crashing or returning errors such as “503 Service Unavailable” or “504 Gateway Timeout“.
- Your site is loading slowly or incompletely.
- Your server’s load average is high or spiking.
- Your RunCloud dashboard consistently shows that CPU usage is high on your server.
To fix CPU issues, you can try the following steps:
- Increase your server’s CPU by upgrading your plan or adding more resources.
- Optimize your WordPress application by disabling unused plugins, enabling caching plugins, and updating your PHP version.
PHP-FPM Issues
PHP-FPM is a fast and flexible process manager for PHP applications. It can improve your site’s performance by handling requests efficiently, and allowing you to customize various settings. However, PHP-FPM can also cause issues if it is not configured properly or if it has bugs. Some signs of PHP-FPM issues are:
- Your site is crashing or returning errors such as “502 Bad Gateway” or “500 Internal Server Error”.
- Your PHP-FPM processes are using too much CPU or memory.
- Your PHP-FPM error log is logging new entries.
To fix PHP-FPM issues, you can try the following steps:
- Check whether you have allocated the necessary memory.
- Increase the time limit to complete a request.
Have a Question That Isn’t Covered Here?
Do you have a question that was not addressed here? Feel free to post a message in the RunCloud Community.