Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
iWeb Posted April 2, 2011 Posted April 2, 2011 I was trying to optimize my httpd.conf & my.cnf and end up doing more harm then good. I don't remember the default settings either and now I'm stuck with a super lagging server. Can someone please help me re-config these files?Current Server Load 58.49 Total Server Memory 1536 MB Available Server Memory 17 MB Server Spec768 MB Guaranteed (1.5 GB Burst RAM) CentOS 5 Operating System httpd.confTimeout 300 TraceEnable Off ServerSignature Off ServerTokens ProductOnly FileETag None StartServers 5 <IfModule prefork.c> MinSpareServers 5 MaxSpareServers 20 </IfModule> ServerLimit 150 MaxClients 150 MaxRequestsPerChild 1000 KeepAlive On KeepAliveTimeout 5 MaxKeepAliveRequests 300 my.cnf [mysqld] skip-networking skip-innodb log-slow-queries safe-show-database local-infile = 0 max_connections=200 table_cache=256 max_delayed_threads=20 max_tmp_tables=32 query_cache_type=1 query_cache_size=4M thread_cache_size=4
Luke Posted April 2, 2011 Posted April 2, 2011 Not sure about the Apache config. Looks "ok", although that would depend on your traffic. Hard to say. The MySQL config looks really low. You could probably download the source code to MySQL and get the default config. They have several "recommended" configs for different situations.
iWeb Posted April 3, 2011 Author Posted April 3, 2011 I get about 500 users per hour. I found the my-medium.cnf, but it not listing what my host had on their default (thought I did play with the values a bit). Should I just remove everything I had on and replace with this (my-medium.cnf)?skip-locking key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M
Luke Posted April 3, 2011 Posted April 3, 2011 You could just try merging them. Use your best judgement. Hard to say without knowing what you had before (that was working). Any value in my-medium.cnf just replace. Keep track of your changes though. You could just try using my-medium.conf.
cargelock Posted April 3, 2011 Posted April 3, 2011 Turn slow-query log offf if you don't need it. You could also use mysqltune.pl (or similar) which will pretty much give you a good base to work from
iWeb Posted April 3, 2011 Author Posted April 3, 2011 How do I turn off "log-slow-queries"? Do I simply remove it from the my.cnf or should it look something like this: "log-slow-queries OFF" ? I'm not very familiar with perl scripts, I actually never even executed them before. How do I run it on my server?
cargelock Posted April 3, 2011 Posted April 3, 2011 slow_query_log = 0 to run perl script, upload it to your home directory, make sure it can execute (probably chmod 700 mysqltune.pl) then run eg: perl mysqltune.pl or perl mysqltune.pl > mysqltuneresults.txt (which you can grab and keep the results for reference)
iWeb Posted April 3, 2011 Author Posted April 3, 2011 OMG -- I'm going to shoot myself for being an idiot! I should had ran the script and tested it before ordering a dedicated server (currently running on a VPS) Sigh.. . I asked my hosting for help and they kept telling me I needed to upgrade and they where not able to find what's eating up all the resource. They claimed they had been looking in to it for days. I suggested there might be a problem with my my.cnf or httpd.conf, but he said there was nothing wrong with it and it's optimized to it's full potential. I'm actually pretty surprised they would lie about it just to get me to upgrade since they are a respected host. Oh well, I end up going on a different host with more resource then I actually need. Too bad they don't do refunds. :( Anyway, thank you Cargelock! The script was a HUGE help and will be most useful on my new server. Do you know if there a script that would help with "httpd.conf"? :D
cargelock Posted April 3, 2011 Posted April 3, 2011 I don't think there is an apache tuner of sorts, although that doesn't mean there isn't one somewhere. Generally, I tweak a few ssettings in apache.conf and then bombard my server (usually a test server with same specs) using apachebench
iWeb Posted April 4, 2011 Author Posted April 4, 2011 I guess trial will have to do... expect this time I'll copy down the defaults before making changes. :P
Recommended Posts
Archived
This topic is now archived and is closed to further replies.