What is ideal my.cnf and httpd.conf settings for Digital Ocean's 10$ droplet?

March 27, 2015 8.5k views
MySQL Apache Server Optimization Load Balancing


I am using Digital Ocean’s 10$ droplet with Centos 6.5 64 bit + APC + Apache + Google Page Speed Module. My cpu load is high. Here is htop output.

My [mysqld] settings in my.cnf file:

max_connections = 500    
thread_cache_size = 128
key_buffer = 64M  
query_cache_type = 1
query_cache_size = 32M
query_cache_limit = 4M
table_cache = 2000      
low_priority_updates = 1

What do you suggest for my.cnf or httpd.conf settings?

1 comment
3 Answers

It is rather hard to determine why Apache consumes so much resources by the provided details. Can you provide a copy of Apache logs? By default they are located in /var/log/httpd on CentOS (except if you have setted up a custom log location). Just copy as much as you can from the Access and Error logs. You can paste them here: http://pastebin.com/

  • Do you want access_log or error_log files? In /var/log/httpd directory, there is too much access_log file and each** access_log** file size** greater than 700MB**.

  • Yeah, this are the correct files!

    There is no need to have the full file, just copy the last 100 or so lines and paste them in pastebin. Then you can post the link and I will try to check this for you.

  • Here is the last error_log files updates. Why access_log files size is greater than 700MB? Is this a problem?

  • Sorry. I send wrong error_log. Last error_log file for 2 day.

  • Thanks!

    This surely provides some information. Can You also post the access log. There is no need of the full file, only the most recent 100-150 lines.

  • Last access_log file is 800 MB. :( If i download that file this is take a time?

  • You can open the file through console:

    vi /var/logs/httpd/desiredaccesslog_name

  • I reached access_log for 22 March. Here it is.

  • Viko, are you there?

  • Indeed, I am here! :)

    Thanks for the logs. This requires some step-by-step troubleshooting.

    What first came to my attention is that PageSpeed is causing a lot of trouble. Almost all errors are related to it. As I have never needed, nor used PageSpeed, my suggestion is to first temporarily disable it and restart Apache. This will clearly show if it causes the problems.

    New question came in my mind: Are you using a firewall of any kind?

  • Hi Viko,

    We can’t fix Page Speed? I want to use Page Speed. But i can’t understand. Why PageSpeed is causing trouble?

    I don’t use firewall. Just i use CloudFlare.

    Edit: I disabled Page Speed module. What is the next? Thank you so much for your help! :)

  • Hi!

    As I mentioned - I do not have a lot of experience with the pagespeed module, so I can not guide you how to set it up correctly. After disabling it and restarting the Apache web server, how does the Droplet act?
    What are the new messages in the error log?

  • Hi.

    Here it is last 100 line in error_log. It seems this error for APC.

    And i have question for you. In /var/log/httpd directory access_log files is greater than 700MB. It is normal?

    What is the next?

    Thank you again.

  • Hi Viko,

    I fix lastest date.timezone problem. I am edited php.ini.

    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    date.timezone = "Europe/Istanbul"

    What is the next step?

  • Hi Viko,

    My problem has continues.

    I am still waiting for solution and your suggestions.

    Thank you. :)

Have another answer? Share your knowledge.