Web Hosting Talk







View Full Version : Active Connections ??? As high as 907 !!


ZYE
11-02-2001, 12:18 PM
i just checked my server and i saw that current connection are as high as 907 - i am not able to ssh to my box - RAM and SWAP File usage is up ....

cgi scripts are not working....

hell what is going on ??
:(

appreciate your help


Max TCP Connections
907.0 B/s (2.8%)
Average TCP Connections
23.0 B/s (0.1%)
Current TCP Connections
828.0 B/s (2.5%)

ZYE
11-02-2001, 12:42 PM
what could this be?? any expirience with that kind of troubles??

No FTP, sendmail, no cgis are executing :confused:

dektong
11-02-2001, 01:18 PM
Are you sure it's B/s? 900B/s is nothing ....

I don't see what the problem is ... The graph you show is MRTG graph, it has nothing to do with how many connection you have ... One single http connection can go up to thousands time than just 900B/s

cheers,
:beer:

ZYE
11-02-2001, 01:26 PM
i have 900 Active TCP Connections (MRTG) i- no ssh no mail no ftp just static html pages .....


what could this be - hack attack?

the B/s is not correct - these are Active TCP Connections

"NOT" bits or bytes/sec

dektong
11-02-2001, 01:36 PM
MRTG records transfer based on B/s (Bytes per seconds) or b/s (bits per second) ... what's so big deal about you having 900B/s transfer? Besides the number tell you the transfer rate, not the number of connections ... I don't know, it does not seem to be any problem for me ... Is this your first time looking at your MRTG graph?

cheers,
:beer:

ZYE
11-02-2001, 01:44 PM
i setup MRTG all with pl or sh scripts - i measure not just traffic but also swap ram cpu hdd space processes and ACTIVE TCP and UDP connections with mrtg

and no - i dont look the first time at these graphs :cool:

dektong
11-02-2001, 01:46 PM
Oh I am sorry about that ... I thought you are a confused newbie :)

Hm ... 900 active connections does indeed look high ... How much transfer off your switch/eth0 are we talking about currently?

cheers,
:beer:

ZYE
11-02-2001, 01:56 PM
:D

thats the strange thing - not high - looks absolutly normal - no peak or so - the RAM usage got up to 231,6 and the SWAP also went up to 121,3 - the graphs stopped updating about 20 minutes after the high TCP conn. count.

what could this possibly be??:confused:

regular i use about 100MB ram and maybe 3 or 4 MB swap

attached are the RAM graph.

i should get a restart in about 45 minutes

ZYE
11-02-2001, 02:01 PM
To your question about MRTG:

i use shell and perl scripts to collect the specific numbers.
Not snmpd.

If you like - happy to share :D

dektong
11-02-2001, 02:07 PM
Yes ... please share with me ... I have some problems with showing the CPU Load on MRTG :)

Thanks ...

cheers,
:beer:

ZYE
11-02-2001, 02:20 PM
heres the daily tcp traffic - not even high - only push about 6 GB per month



For graphing sysload heres the deal:

sysload.sh
________________________________________
#!/bin/sh

# first the load 5 and 15 min avg
# multiply * 100 to avoid floats
# it helps if mrtg "period" is a multiple of 5 mins
uptime | sed -e 's/^.*average.*: \(.*\)$/\1/' -e 's/ //g' |
awk -F, '{ printf("%.0f\n",$2*100); printf("%.0f\n",$3*100) }'
# the uptime
uptime | sed 's:^.* up \(.*\), [0-9][0-9]* users.*$:\1:'
# my name
uname -n


here the cfg for mrtg.cfg or your custom cfg ...

WorkDir: /home/sites/YOUR/DIR/TO/GRAPHS
Target[sysload]: `/usr/local/mrtg-2/sysload.sh`
MaxBytes[sysload]: 3000
# Directory[sysload]: sysload
Options[sysload]: gauge, nopercent
YLegend[sysload]: Load (10E-2)
ShortLegend[sysload]: (10E-2)
Legend1[sysload]: Load Average over last 5 minutes
Legend2[sysload]: Load Average over last 15 minutes
Legend3[sysload]: Average over last 5 minutes
Legend4[sysload]: Average over last 15 minutes
LegendO[sysload]:  15 minute stagger
Title[sysload]: System load
PageTop[sysload]: <H1>SYSTEMLOAD</H1>

dektong
11-02-2001, 02:27 PM
thanks ... I will try yours later (and perharps you can see mine and tell me where I went wrong?) ... Anyway, how do you get away with the fact that MRTG takes difference in the two numbers recorded in the 5 minutes interval and divide this difference by a number (say, 300 for 5 minute intervals) to show the average (usually transfer) during this 5 minute period?

Thanks a lot for the code ... I will test it later ... when my server at VDI is up again :(

cheers,
:beer:

Anatole
11-02-2001, 03:50 PM
Seems like you run SQL server on the same box with a Web server and also do not limit number or length of each connection in Apache. Use RLimitCPU parameter in your httpd.conf and limit the max leghth of process to 20 seconds.

cyansmoker
11-02-2001, 09:29 PM
Hey, that's a pretty neat script.
I've tried it on a server and it looks nice, although uptime is not performing how I expected it to, so I replaced it with:
uptime | cut --delimite=' ' -f6,7