By Josh
I have the $20/month server and I am hosting a sales page, user panel and API.
The API gets a lot of traffic and the static homepage too. The entire site, all 3 parts, are built with Django/Python with Apache.
The settings I’m running are:
Timeout 10 MaxClients 75 MaxRequestWorkers 512 ServerLimit 32
Daily average traffic stats: 1500 Page Views 500 Unique Visits 200 First Time Visits 300 Returning Visits
The server will go down about once an hour for 1-2 minutes. Are there any configurations I should be using or considering?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
We’d definitely need to see the logs in this case – for Apache, MySQL, and Django; unless you know which service is going down, in which case we should take a look there first.
Traffic wise, 500-1,000 visitors a day shouldn’t cause that much stress on a 2GB Droplet, so my initial thought would be that you need to fine-tune Apache + MySQL.
What I would recommend starting with is Apache unless your application doesn’t rely on caching of MySQL queries and fetching cached data (for repeated requests for the same thing, in cases where data doesn’t change instantly from requests to request). In this case, you may need to do both.
To start with Apache, backup your current configuration, then try something such as:
KeepAlive On
KeepAliveTimeout 10
MaxKeepAliveRequests 100
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 300
In your configuration, you have both MaxRequestWorkers and MaxClients – looking at the Apache documentation, MaxRequestWorkers is what it’s called now, so you’re essentially setting the same thing twice. So you can remove the MaxClients setting altogether.
‘MaxRequestWorkers was called MaxClients before version 2.3.13. The old name is still supported.’
https://httpd.apache.org/docs/2.4/mod/mpm_common.html#maxrequestworkers
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.