Portal Home > Knowledgebase > Articles Database > my.cnf + Tuning-primer.sh


my.cnf + Tuning-primer.sh




Posted by threemints, 04-09-2010, 04:02 PM
Hello, I've this server: Intel Xeon E5520 Nehalem 2.26GHz 4x256KB L2 Cch / 8MB L3 Cch Quad-Core 1TB First hard 250GB Second hard 6TB bandwidth 12GB RAM WHM/Cpanel my current my.cnf is I used Tuning-primer.sh and the result The problem is my server is extremely slow and i don't know why. i've to restart the HTTP every 10 minutes to speed up the server again

Posted by drspliff, 04-09-2010, 06:05 PM
Seeing as you posted your MySQL config I might as well comment on it first, however without any more information about *what exactly* is happening on your server then any tweaks to MySQL might be completely useless (if, for example, something entirely different is causing your slowdowns). Wow, your per-thread buffers are HUGE, to the point where if you ever got 100 concurrent MySQL connections you'd be swapping out pretty much everything else or the kernel would just kill it. As far as `read_buffer_size` and the other per-thread buffers go you should take a look at this article on optimal read buffer sizes (I know, it's hard to do similar benchmarking with such a large number of different queries, but it generally holds water). ---- How about a snapshot from top? Would be interesting to see what else is going on

Posted by threemints, 04-10-2010, 12:07 PM
this is a snapshot when the server was extremely slow http://i43.tinypic.com/2d2d9o8.gif i've to restart HTTP every 5 minutes to speed it up again.

Posted by drspliff, 04-10-2010, 01:16 PM
Well, load average is normal, MySQL seems to be running fine, most of your cores are idle and there's almost no IO wait; Apache doesn't seem to be taking much load either. What are your Apache settings like? which MPM, MaxClients etc. What springs to mind first is that your apparent slowdowns are caused by Apache having MaxClients configured far too low which would lead to long connect times for each HTTP request. If you look at the `Net` graph in Firebug (or other similar tool) how much time is spent in the 'connecting' state?

Posted by threemints, 04-10-2010, 02:34 PM
That's what made me confuse, could it be Hard disk or RAM problem? MaxClients is 150

Posted by threemints, 04-10-2010, 02:59 PM
I used firebug and my site loads with 1m 16s size 168.4 KB While it loads WHT with 1.28s size 24.4 KB

Posted by tim2718281, 04-10-2010, 02:59 PM
What do you mean by "extremely slow"? What are you doing, how long is it taking, and how long do you expect it to take?

Posted by threemints, 04-10-2010, 03:09 PM
My old server was Q9650 with 8GB Ram and my new server is Xeon E5520 Nehalem with 12GB Ram any page takes like 3-4 Ms to load, it used to take seconds when i restart the Apache it takes seconds to open any HTML page or scripts like forum or WHMCS, but after few minutes the server becomes slow and i've to restart it again, if i didn't restart it for long time the page will not load at all.

Posted by tim2718281, 04-10-2010, 03:40 PM
OK, together with the TOP info you've posted, that really doesn't sound like a tuning problem, it sounds like some kind of bug. What happens if you restart Apache and then *do nothing* for 15 minutes before opening a page? Will the first HTML page take seconds or minutes? What happens if you install another Apache server on a different port, and just have a few basic HTML pages - no PHP and so on. Will that slow down, too?

Posted by drspliff, 04-10-2010, 03:47 PM
Can you take a screenshot of the firebug `net` view?

Posted by threemints, 04-10-2010, 04:03 PM
I can't restart Apache and *do nothing* my clients *will do*, anyway i reconfigure the Apache by changing: ServerTokens = productOnly StartServers = 15 MinSpareServers = 15 MaxSpareServers = 35 MaxClients = 256 ( couldn't increase it more ) MaxRequestsPerChild = 10000 and so far it running much better than before. BTW shouldn't i've (KeepAlive and KeepAliveTimeout) in httpd.conf i don't see it. Do i just add it to httpd.conf?

Posted by drspliff, 04-10-2010, 04:59 PM
Your MinSpareServers doesn't match up with your `top` screenshot - there should be *at least* 15 `httpd` processes. Are you really sure you're using the prefork MPM and not `worker` ?

Posted by threemints, 04-10-2010, 05:18 PM
I changed the MinSpareServers from 5 to 15. How can i check which MPM i'm using?

Posted by Yapluka, 04-10-2010, 05:23 PM
With this command : httpd -V

Posted by threemints, 04-10-2010, 05:27 PM
from httpd -l httpd -V

Posted by drspliff, 04-10-2010, 05:31 PM
Would be kinda helpful to see exactly where time is spent during requests to the site.

Posted by threemints, 04-10-2010, 05:43 PM
Sorry i didn't see your reply, anyway the problem is in all sites in the server at once and happened suddenly, so i don't think the problem caused by one site and made that slowness suddenly for all sites in the server. And don't forget it was working in the old server without any tiny problem Snapshot http://i44.tinypic.com/f1kqx0.gif

Posted by drspliff, 04-10-2010, 06:01 PM
The graph looks entirely normal, I don't see any massive slowdowns or delays happening, mine for comparison. It could certainly be faster, but it's all application specific issues (combining CSS and Javascript, using css sprites etc.).

Posted by threemints, 04-10-2010, 06:23 PM
as I said the problem not from the site, it from the server the sites return to normal after i reconfigure the Apache

Posted by tim2718281, 04-10-2010, 06:24 PM
But don't you want the graph from the time it took 1m 38 secs?

Posted by drspliff, 04-10-2010, 06:34 PM
It would be helpful yes, but I've been refreshing the site every now and then and haven't seen any differences from the graph that threemints posted... As you can imagine it's kinda hard to analyse a problem when it consistantly looks like there is no problem...

Posted by tim2718281, 04-10-2010, 07:29 PM
OK, working with what we've got ... Let's take the '304' responses. these come in bunches, maybe half a second to a second between each bunch. Now a 304 response means the user's browser has the data in the cache, and is sending a request to the server to see if the file has been updated. If it has not been updated, the server send back a 304. So all the server has to do is check the file timestamp. That can't take half a second. So there's a queue somewhere. But we know that CPU, memory, IO are all low. Ah. 1) Maybe the problem is with KeepAlive and KeepAliveTimeout. They are defaulting (to 5 and 15). If that firebug trace is typical, try setting KeepAlive to 20 and KeepAliveTimeout to 2. 2) You should also try to eliminate as many 304 responses as possible by setting "expires" headers and turning etag off. It's about my bedtime here in the UK; but I'll refer you to Steve Souder's tuning guide: http://developer.yahoo.com/performan...s.html#expires http://developer.yahoo.com/performance/rules.html#etags

Posted by threemints, 04-10-2010, 07:59 PM
I don't have KeepAlive and KeepAliveTimeout in httpd.conf how do i add them?

Posted by drspliff, 04-10-2010, 08:01 PM
Yes, they come in bunches because the browse limits to 2-4 concurrent connections per hostname, those tan coloured bits *aren't* anything to do with the server being slow - it's the browser waiting for the previous requests to finish before sending off more. Every time I view the net graph the amount of time spent setting up the first 4 initial connections is reasonably consistent at ~110ms, and for all requests it's between 120 and 200ms after it's sent the request waiting for the response. This is 100% typical behaviour given the layout & resources referenced by the site - not a server issue.

Posted by tim2718281, 04-10-2010, 11:31 PM
It's the time between the bunches that's the problem. Why does it take half a second for the server to respond that 4 files have not changed and do not need to be resent? If the OP hovers the mouse pointer over one of the bars, firebug will break out what took time within that one request. In any event, the important thing is that it's probably possible to eliminate most of those requests completely by setting an "expires" header and turning off Etag.

Posted by tim2718281, 04-10-2010, 11:38 PM
Oh, I gave the Apache 1.3 version of Keepalive; for Apache 2.2, the default of "KeepAlive On" is fine. Just check that "MaxKeepAliveRequests" is not set. To change KeepAliveTimeout to 2 secs, in httpd.conf specify KeepAliveTimeout 2 What's the network speed of your server? Last edited by tim2718281; 04-10-2010 at 11:43 PM.

Posted by threemints, 04-13-2010, 11:17 AM
100MB the MaxKeepAliveRequests isn't set, do i've to add it?

Posted by tim2718281, 04-13-2010, 11:24 AM
No, the default of 100 is fine. And with 100mbps network speed on a lightly loaded system you would not expect the web server to take so long to send a 304 response. Anyway, it looks now as if the 304 responses are eliminated, and the responses seem much quicker.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
File Permissions (Views: 783)
EZPZ Hosting down (Views: 871)


Language:

LoadingRetrieving latest tweet...

Back to Top Copyright © 2018 DC International LLC. - All Rights Reserved.