beet
May 10 2005, 05:59 PM
Hi,
I have a private rack with 2 servers, where one runs the web stuff like PHP, and the other server runs the database. The server loads on both machines are pretty good (~3 with 4 virtual processors on web, under 1 on database with 4 virtual processors), but the webpages at peak times runs quite slow.
More than enough ram on both machines too.
I'm guessing that since I'm also sending database querys through the switch from each server, that I may be maxing out the switch. Peak times its at 40 bits/sec from the bandwidth logs, but I dont know how much internal traffic is added to that as well.
Is there a way to find out if my swtich is being maxed out with internal traffic included? The bandwidth logs only show traffic external. Would I need a gigabit swtich if that were the case?
Thanks for any help or insight you guys may have.
Ronnie
TechieSurfer
May 10 2005, 06:34 PM
beet -
> I'm guessing that since I'm also sending database querys through the switch from each server, that I may be maxing out the switch
No this does not appear to be the case. As you stated, the maximum on any of these servers is 40 Mbps. The L2 switch can handle 100 Mbps full duplex without issue.
Your servers have an ICMP rate limit and cannot be performance tested. I checked and there are no errors counting on your ethernet ports.
Randy Williams, CTO
beet
May 10 2005, 06:42 PM
Thanks Randy. I'll scratch maxing out the swtich as a possible cause. Looks like I'll probably need to do some load balancing with web servers :eek:
eth00
May 10 2005, 09:41 PM
Look at eaccelerator it can help a LOT! Aside from that you could always try lowering the firewall at peak times and pinging to see if there is really any increased response times. Who knows you might even be having trouble with the firewall slowing it down from the sheer amount of traffic, or apache with additional modules loaded that all take up processing time.
beet
May 11 2005, 12:37 AM
Yeah, I have Eaccelerator installed.
I disabled the firewall and accessed the site manually; I still had that slight hitch before opening the page. I dont know whats causing it.
Its also a simple php page without any remote connections. I looked over all my DNS settings, and they all look fine. The images on the page even take some time to appear.
So its definately not server load related, b/c the load is at ~1.2 right now (no swapping either), and still has that small delay in connecting.
Any other ideas what it could be... should I try upping maxclients in apache maybe? Although, I doubt that would make a difference seeing as though I'm having this problem and its almost close to 1 AM
Add to that, I'm pinging the server at 70 ms. :confused:
eth00
May 11 2005, 06:04 AM
QUOTE (beet)
Add to that, I'm pinging the server at 70 ms. :confused:
70 ms across the switch or from a remote location?
If your site is image intensive you may look at hosting them on a subdomain with thttpd. If you want to check how many clients the server is currently serving in the httpd conf add this:
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
Then restart apache and type "links
http://localhost/server-status". You may have to use lynx or even wget the file and view in a text editor. That should give you some decent information on what is happening with apache and how busy it is.
If that looks ok the next step is to run mytop and see if the mysql server is having trouble processing the queries.
beet
May 11 2005, 08:04 AM
Thanks for the suggestions Eth. I'll give 'em a go
eth00
May 11 2005, 08:06 AM
If the logs are at or close to 2gb it can slow the server down. If they hit 2gb it will usually severly slow the server down.
beet
May 11 2005, 09:33 AM
^ I'm now leaning on that as a possible cause. The logs I generate are quite large, in the order of gigabytes per day. It would make sense too, because this morning the server is lighting quick.
If I experience a slowdown later this evening, I'll look around to see what avenues I can take to reduce log size (rotate logs more than once per day?).
theuruguayan
May 11 2005, 09:38 AM
Yes, if you have logs so big, rotate them more than 1 time and it will help load and speed of apache.
Do you have mysql running or just php ? Can you post your my.cnf ? because that can be making the site slow too.
beet
May 11 2005, 09:54 AM
Its simple PHP file without any database querys that was running slow last night. The php page also contains very little code - just a few includes. I think I'll try rotating logs mid-day today, and see how that goes.
theuruguayan
May 11 2005, 09:59 AM
can you paste your apache configuration? Perhaps reducing Timeout on the apache server will help reduce the load and improve speed.
How is ping between each server?
beet
May 11 2005, 10:15 AM
Timeout 30 (this is pretty low already?)
Keepalive on
Keepalivetimeout 2
Maxkeepaliverequests 500
Maxrequestsperchild 5000
I did a lot of Apache tweaking and benchmarking, and the above configuration seems to be the best in terms of server load, and speed at which pages are loaded for my website (of course, before the evening slowdown!).
Ping between the servers is exceptional: 0.2-0.4 ms.
beet
May 11 2005, 06:50 PM
Ok, everything is lightning fast and its during the time yesterday I'd expect a slowdown. It therefore was definately b/c I had large logs for apache to append to.
How foolish of me to blame the network
Thanks guys for all your help!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.