On my VPS running I'm recently hitting soft and hardlimits of tcpsndbuf very often, causing the server to become nearly unreachable as load goes up to 45 and higer. I have already tried limiting the number of Apache connections allowed, yet 5 minutes after restaring the server with the new values everything went berserk again. Right now I have:
KeepAlive off
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 20
MaxClients 20
MaxRequestsPerChild 1000
</IfModule>
The server currently pushes about 1,5 TB of 20kb-15MB files mostly with apache, partyl with vsftpd and hosts about 5 wordpress blogs that recieve about 300-800 visitors a day.
/proc/user_beancounters says:
uid resource held maxheld barrier limit failcnt
62327: kmemsize 27311616 27428538 193273527 214748364 0
lockedpages 0 0 2059 2059 0
privvmpages 316229 316352 1048576 1101004 0
shmpages 745 745 131072 131072 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numproc 95 95 650 650 0
physpages 154998 155013 0 9223372036854775807 0
vmguarpages 0 0 524288 9223372036854775807 0
oomguarpages 154999 155014 9223372036854775807 9223372036854775807 0
numtcpsock 30 30 700 700 0
numflock 7 8 1000 1100 0
numpty 1 1 102 102 0
numsiginfo 0 0 1024 1024 0
tcpsndbuf 1573056 1619200 6720000 9408000 23663960828
tcprcvbuf 491520 491520 6720000 9408000 42
othersockbuf 224864 226176 5760000 8064000 0
dgramrcvbuf 0 8480 5376000 5376000 0
numothersock 139 139 600 600 0
dcachesize 1319995 1338775 28991028 32212254 0
numfile 3125 3145 17600 17600 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 71 71 9223372036854775807 9223372036854775807 0
What is the most effectiv method to reduce the tcpsndbuf requirements?
As a sidenote, whenever I hit tcpsndbuf limits most of my attempts to download files via wget and alike tools end in messages like "No buffer space available".