What's the best php/mysql/apache configuration for the $10/mo, $20/mo plan droplet?

February 24, 2015 846 views

I'm running a Drupal website on my $10/mo droplet(I'm going to upgrade to $20/mo), but sometimes it crash with 200~250 concurrent users, I was thinking on give more resources to php/mysql/apache processes but don't know where to start or what configurations are needed.

PD: I have optimized my Drupal website, so I'm just looking for php/mysql/apache.

1 comment
  • The best way to proceed would be to identify the cause of the crash before doing anything at all.

    The reason is that no optimization can be done before identifying what's the bottleneck in the first place.

    Then you fix that problem, test again, find the next thing that breaks with 200/250 concurrent users, fix that, and so on.

2 Answers

If you're seeing services crash under high load there is a good chance your droplet is exhausting it's available memory. The first thing I would recommend is to set up a swap file.

This should help prevent the crashes as a service would not simply run out of memory when the physical RAM is all in use. Instead of a crash you may see some slowdown in responses since your system would be swapping out memory to disk rather than simply crashing. This is a good stop-gap but you would then want to dig into things to see what you can further optimize or whether you need to upgrade to a larger droplet.

Another thing that may provide some relief to your server is to set up CloudFlare's reverse proxy service for your domain. This provides a cache between your droplet and your users and can significantly reduce the load on your droplet, especially when you are seeing a lot of visitors.

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.

If your site has a lot of database queries you might consider memcached (if mysql is crashing) I recently had an issue with Joomla running a custom application that was very database intensive and memcached solved things..although I already had a swap partition as well.

Have another answer? Share your knowledge.