Overview
The following provides a few suggestions to help you identify common memory issues and optimize your DreamHost VPS. Optimizing your VPS helps ensure less memory usage while speeding up your websites.
How to 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.Preventing 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 to cache your 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 Cloudflare: You can also enable a third-party service such as Cloudflare, which 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.
Optimizing 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.
Configuring 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.