Tips for a stream-lined VPS

VPS

One of the best things about Dreamhost’s VPS offering is the wide range of configuration options it allows.

Yet a lot of our VPS customers aren’t really “power-user” tech types and simply want their sites, –predominantly WordPress installs– to run as fast as possible. But having available memory won’t necessarily make your website any faster; you should take advantage of that memory, and put it to use!

1.  Use XCache

Caching takes your dynamic sites and makes them semi-static by storing site content in a cache. Usually cache is stored within memory or on disk. This gives you the robust tools of a dynamic site, and the fast load times of a purely HTML-driven site.

While you can enable disk-based caching on any of our servers, DreamHost VPS adds the option of utilizing ‘XCache,’ which is a compiled code cache meant to improve PHP performance. What this means is that your cache is stored in memory, rather than disk, which greatly improves your site’s performance. Even with fast, server-grade hard disks, memory operations can be significantly faster than the same operations would be on a disk. XCache won’t help speed things up unless your software is also taking advantage of its availability. Different software has different levels of XCache support, so look into the best method of implementing this cache type. For example, Joomla has support built right in, which can be activated under the “Global Config” > “Cache” menu. WordPress doesn’t support it out of the box, but the “w3-total-cache” plugin has comprehensive XCache support.

We recommend setting up XCache on a per domain basisbecause there’s no reason to enable it on domains that won’t take advantage of it. You can enable it within the DreamHost web panel via “Domains” > “Manage Domains”, “Edit”,  checking the “PHP XCache Support” option, then clicking “Change Settings.”

2.  Disable unnecessary services

We offer some pretty cool services on VPS, but you may not be using them! So, disable them unless you plan to use them. Do you only use SSH to connect? Disable the FTP service! Use SMTP for your site’s mail functionality? Disable the local mail server! Each enabled service eats up more memory, so disabling those you don’t use helps keep your VPS lean & mean.

These services can be disabled from within the panel via “VPS” > “Configure Server”.

3. Remove extraneous plugins & modules

Each plugin your site uses eats up memory too, and will increase load times. Plugins are usually loaded on each page view, thus increasing processing time and memory usage.That leads to increased VPS charges and a thinner wallet. So, take a look at each active plugin, and if you’re not sure that its functionality is worth the tradeoff, get rid of it! As much as you may love the idea of dynamically re-generating your favicon file on each page load, it may not be the best idea in terms of resource usage.

The leaner your installation, the less memory you’ll use, and the faster your site will load. It’s also important to note that you should ensure you don’t have plugins installed with overlapping functions. Those can cause weird side effects, including erratic memory consumption, headaches, dizziness and loss of appetite.

4. Nginx

Nginx is a lightweight, high-performance web server alternative to Apache.  Like XCache, Nginx is an option we’ve made available only for our VPS customers; it’s not available on the shared platform. Nginx often uses dramatically less memory than Apache and decreases load times even in well-optimized environments. We’re really excited to offer it!

While you can enable Nginx from within the panel, there are some additional setup steps. As Nginx doesn’t use .htaccess files, you’ll need to generate Nginx configuration files for URL rewriting.

If you’re interested in giving Nginx a try, , check out this article that includes setup scenarios and sample Nginx configuration files for WordPress, Drupal, MediaWiki and phpBB:

The caveat is that Nginx handles PHP threads differently than Apache. We employ a home-grown PHP management setup that utilizes the supervisor daemon for PHP process management. This scales the number of PHP processes to match the amount of available memory on your VPS. Since this setup is unique to our systems, the PHP process manager for Nginx is not available to VPS customers with an admin user.

If you  have an admin user, and would like to try Nginx on your DreamHost VPS, just remove your admin user, or set up your own third party solution, such as PHP-FPM.

Different use-case scenario?

In the real world, one size doesn’t fit all. So our support team is here for you 24 / 7. Drop us a line – we’ll be happy to help you utilize your DreamHost VPS to its best ability!