Overview
This article provides suggestions to reduce memory usage and speed up your DreamHost VPS — block abusive bots, prevent image hotlinking, enable caching (Bunny CDN, Cloudflare, or OPcache), and optimize WordPress. Note that IP tables cannot be customized on a VPS.
How do I block abusive bots?
A common problem for websites is caused by search engine indexing bots repeatedly hitting the website. The following can help you troubleshoot this issue.
Creating a robots.txt file: To minimize the issue of abusive bots, you should set up a robots.txt file. This file helps to control what bots are allowed to search and how often.
Viewing your access.log file: Finding abusive bots can often be more of an art than a science, but you can get some data on this by analyzing the access.log file for your websites. See this article to learn more about how to check your access.log file and see where the most traffic is coming from.How do I prevent image hotlinking?
Hotlinking is when another website uses an image from your website. This happens when the full URL of an image on your site is used on their own site. This can cause massive problems as even a relatively low-traffic site can cause poor server performance.
View the Prevent image hotlinking article for more information on how to prevent this from happening.
How do I cache my site?
Caching helps to store website files, making them faster to access by your visitors. Ensure your website's software uses some caching functionality to prevent memory issues and improve overall performance.
Working with PHP processes: PHP processes can take up a significant amount of memory. If your site is getting a lot of traffic, enabling caching will help reduce the number of PHP processes spawned. Caching renders a PHP script and then "caches" that HTML output as a file. The next time that page is accessed, the server outputs the static HTML page rather than processing the PHP script again.
Using a Content Delivery Network (CDN): You can also enable a CDN such as Bunny CDN or a third-party service such as Cloudflare. This provides additional caching options for your websites if you expect a large volume of visitors.
Using OPcache for PHP sites: OPcache is a caching engine built into PHP that, when enabled, dramatically increases the performance of PHP-based websites. See this article to learn more about how to use OPcache with your website.
How do I optimize WordPress?
Review the WordPress Optimization category for detailed articles if you're running multiple instances of WordPress on your VPS. Make sure to do the following with each installation:
- Always run the most recent version of WordPress.
- Install only essential plugins.
- Keep your plugins up-to-date.
- Remove/delete unused plugins as opposed to just deactivating them.
- Confirm your active theme isn't generating any errors in your error.log file (located in the same directory as the access.log).
- View Optimizing Page Load Time and make sure you have a popular WordPress caching plugin installed and configured. For example, W3TC or WP Super Cache.
- Compress your image files, which improves loading time and reduces overall memory usage.
Can I configure IP tables?
It is not possible to customize IP tables on a DreamHost VPS. This is because the IP tables are configured on a single host machine to which there is no access.
If you need to run your own custom IP tables, the only option would be to upgrade to a Dedicated Server or DreamCompute and manually install this software.
See also
DreamHost links
- Managing your VPS memory usage
- Simulating high traffic
- Using the 'ps' command to troubleshoot your website
- Web server performance comparison
- Restart a VPS
Third-party links