|
|
Link #1 |
|
AT Field
Join Date: Apr 2003
Location: #animesuki
Age: 16
|
web server load
i just got a massive load on my server yesterday thanks to some advertisment
![]() the problem is that i got more than 600 hits per hour (including the bt tracker), and my comp got beaten after 24h saying (the web server and every network oriented app) "no more buffer to create connections" or "socket operation error" so i tweaked a little bit the apache conf file, reducing the timeouts, allowing more threads per child, by cutting persistent connection with the tracker. will it do the trick? is there anything else to do (i don't want to hear about "use *nix plz", i can't atm, and my hdd performance is way too poor)? thx
__________________
|
|
|
|
|
|
Link #2 |
|
r00t for life
Join Date: Jun 2003
Location: /dev/null
|
yey apache thread =)
Anyway why you keep server on that kinda hardware? From my experience here are some things you can do: -Well load balancing. There are hardware load balancers out there which work very well at place I work. -Round robin DNS can be used too, but it's not as good Okey those are for enterprise (somehow I sense u don't have much cash to spend), here are some "home" remedies: -Make sure you have OS that allows many file descriptors and sockets (I am not sure how it is on windows side...I am using *nix for servers). -Get more ram if you can -Use apache2 with mod_cache to cache none changing pages to RAM for quick access -Use memory mapping derective if OS supports it -Use sendfile directive if possible -Choose right MPM for your OS, if your OS supports threading well then use worker or prefork -Compile apache yourself and deselect modules you won't use. Compile apache2 with --enable-nonportable-atomics=yes to give u a little boost in speed. -Make sure u have HostnameLookups set to OFF -Make sure you don't use symlinks as it's bad for performance. -Try setting KeepAliveTimeout to something around 15 -Get some php caching soft I can go on and on, but I'll stop here. Many things I said are *nix related, but some should apply everywhere. BTW this is happens when everyone is allowed to run own httpd -_-;;
__________________
|
|
|
|
|
|
Link #3 |
|
AT Field
Join Date: Apr 2003
Location: #animesuki
Age: 16
|
great, thx for the directives!
i've applied to simple one like hostnamelookups, symlinks, keepalive i'll look around for php caching and the mod_cache module. i'm afraid i won't be able to use mpm, since i have nothing to compile apache :/ well anyway, the two caching utilities will help a lot ![]() my system is a p3-500, 320MB ram, 2*20GB apache2, php & mysql
__________________
|
|
|
|
|
|
Link #4 |
|
Oups...
Join Date: Jan 2003
|
Hmmm, 600 hits per hour? That is no more than one hit every six seconds, provided they are evenly distributed... As your server can serve static content way, way faster than that, I'll assume that you have some performance issues with your server side scripts (PHP?).
Also, even with a massive timeout of 5 minutes, you'll have no more than 50 open connections at this rate. There seems to be something wierd going on with your TCP/IP stack and the resources it consumes per connection. But you stated that changing OS is not an option, so... Anyways. Try figuring out what page requests generate most load on your server. Optimize and go again. Repeat until no single request takes longer to process than 0.5 seconds. This might mean you need to rethink your page and database design, but it's all for a good cause, eh? A little more work than optimizing hardware and tweaking your resource, but a good learning experience in tight programming
|
|
|
|
|
|
Link #5 |
|
AT Field
Join Date: Apr 2003
Location: #animesuki
Age: 16
|
it's an average
sometimes i get 10+ requests per second but my bt program to seed is a whore and requires quite a load of ressources ![]() edit; it seems that mysql somehow went wrong. since i've rebooted, i don't get any "aborted connection" anymore
__________________
|
|
|
|
|
|
Link #6 | |
|
r00t for life
Join Date: Jun 2003
Location: /dev/null
|
Quote:
If persistent connection when connecting to mySQL, in php it's done using mysql_pconnect(). That should reduce load a little on mysql. P.S. 10+ requests per second is NOTHING, one of my servers gets about 100 requests per second and it's doing just fine =)
__________________
|
|
|
|
|
|
|
Link #11 | |
|
Senior Member
Join Date: Nov 2003
|
Quote:
Ahem. Anyway, bad suggestion as it might be kernel 2.6 seems pretty stable right now. It think the developers haven't forgotten the problems with the 2.4 release and concentrate more on stability this time. This is a fairly low end server. I would move it over to linux/BSD. Should increase performace a bit (but I'm a windows hater so don't listen to me). |
|
|
|
|
|
|
Link #14 | |
|
r00t for life
Join Date: Jun 2003
Location: /dev/null
|
Quote:
Why u can't install *nix again?
__________________
|
|
|
|
|
|
|
Link #15 |
|
AT Field
Join Date: Apr 2003
Location: #animesuki
Age: 16
|
i'd like very much, but the fact that i can't control the remote X screen through vnc like in windows annoys me.
and i get really poor hdd performance (i get errors when i activate the dma mode with hdparm) :/
__________________
|
|
|
|
|
|
Link #16 | |
|
/dev/random
Join Date: Jan 2004
Age: 27
|
Quote:
as for your dma errors, hdparm -d 1 is considered to be a dangerous manuever and won't work right in many cases causing all kinds of stuff to happen... sounds like something in bios... you might check what dma your motherboard and hd's are capable of running(hdparm -i /dev/hdx) and setting it manually in bios utility if your bios supports manually setting it or making sure its set to auto (most hd's automatically select the top mode they can do). OR I have seen a few drives (eg one of my wd's) that require you to d/l a utility disk to turn on its dma features (wtf >_>)
__________________
|
|
|
|
|
![]() |
| Thread Tools | |
|
|