Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
10-09-2005, 10:13 PM
|
#1
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Rep:
|
Server network connection degrades over time
I just returned from a 2 week vacation, did my usual apt-get upgrades on my server (deb sid w/ kernel 2.6.8), and I noticed that when I tried to get to my website it was really slow, and eventually it would not connect at all. Back at home I checked the server and it seemed that after a reboot everything was fine again, but if left on about 5 hours or so, ping levels to the router would get to about 1000ms, and if left on overnight it would eventually be disconnected completely. Right now I've found that I can do an ifdown/ifup and get it back to normal again, but it will just start the same cycle. I am running an apache 1.3 server, SSH, and Samba on it. Anyone have any ideas why my server's net connection slows down to a crawl and then just stops completely? THANKS!
-Ryan
Last edited by mindseye1; 10-09-2005 at 10:14 PM.
|
|
|
10-10-2005, 07:24 AM
|
#2
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
How is your server connected to the outside world? By that I mean is it via a LAN or directly? Is it via ethernet or USB? Is it cable, ADSL or something else? What brand is/are the ethernet card/modem/whatever else?
I have to say, at first glance this sounds a little like a memory leak.
Last edited by adz; 10-10-2005 at 08:28 AM.
|
|
|
10-10-2005, 08:04 AM
|
#3
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
That was my first guess too, and using 'top' I can see that apache has quite a few more processes than usual (7-8) and they are each using about 8% of my memory. I'm usually left with about 10mb (of 128mb) free, but this has never been a problem in the past. I could try killing apache and seeing if I still get disconnected after time. The server connects to the WAN through a D-Link router along with 3 other desktops. The ethernet card in the server is a davicom 10/100 using tulip drivers. Thanks for the help!
|
|
|
10-10-2005, 08:41 AM
|
#4
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
Quote:
That was my first guess too, and using 'top' I can see that apache has quite a few more processes than usual (7-8) and they are each using about 8% of my memory.
|
Does this figure (memory usage) increase steadily over time? Mind you, I was more thinking about memory leaks in the drivers rather than apache. The tulip driver works pretty well, though, and has been around for some time.
Could it also be that your webserver is being flooded with traffic that is saturating its upload (or download)? Are the other three computers behind that same router affected in any way?
|
|
|
10-10-2005, 01:07 PM
|
#5
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
The apache memory usage increases from about 4% to about 8% over time and each of 8 or so apache processes does this in sequence. I've never watched this closely though, so this could very well be normal for apache.
Also, I don't have a very popular site so I really doubt is getting too much traffic, but I can test this by simply turning off the Virtual Server ports on my router. The other computers (2 windows desktops and 1 linux desktop) seem to be operating normally, but I haven't checked the speed of their network connections. They certainly have not yet completely dropped the connection, but I will do some ping testing to see if they are still running at full speed while the other one gets the slow pings. Thank you so much for the help with this!
|
|
|
10-10-2005, 08:08 PM
|
#6
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
Quote:
The apache memory usage increases from about 4% to about 8% over time and each of 8 or so apache processes does this in sequence.
|
A memory leak would rise steadly and without bound. It may still be one but it doesn't sound likely.
Could you also check for any changes in the output of netstat -p over time?
Last edited by adz; 10-10-2005 at 08:24 PM.
|
|
|
10-10-2005, 09:40 PM
|
#7
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
I will run that periodically and see how it looks. Right now this is what I get:
Quote:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.0.112:2977 192.168.0.110:445 ESTABLISHED-
tcp 0 0 192.168.0.112:2976 192.168.0.110:445 ESTABLISHED-
tcp 0 0 192.168.0.112:2979 192.168.0.110:445 ESTABLISHED-
tcp 0 0 192.168.0.112:2978 192.168.0.110:445 ESTABLISHED-
tcp 0 0 192.168.0.112:2980 192.168.0.110:445 ESTABLISHED-
tcp6 0 0 ::ffff:192.168.0.112:22 ::ffff:192.168.0.1:2041 ESTABLISHED23318/sshd: joey [p
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 12 [ ] DGRAM 2323 863/syslogd /dev/log
unix 2 [ ] DGRAM 59532 24503/su
unix 2 [ ] DGRAM 56886 23325/0
unix 3 [ ] STREAM CONNECTED 56883 23318/sshd: joey [p
unix 3 [ ] STREAM CONNECTED 56882 23325/0
unix 2 [ ] DGRAM 28724 12798/dhclient
unix 2 [ ] DGRAM 2749 1108/su
unix 2 [ ] DGRAM 2739 1072/login
unix 2 [ ] DGRAM 2717 1095/perl
unix 2 [ ] DGRAM 2676 1095/perl
unix 2 [ ] DGRAM 2605 1049/(squid)
unix 2 [ ] DGRAM 2598 1047/squid
unix 2 [ ] DGRAM 2336 866/klogd
|
Is there any software that can monitor and log all network activity so that I can analyze it to see when and why the network connection starts to degrade?
|
|
|
10-19-2005, 08:39 AM
|
#8
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
I've narrowed my problem down to the connection between the Debian server and my router. No other machines on my net have slow connections or high pings. I've also written a script (which I can post if anyone desires) that will check every 5 minutes to make sure a ping to my router will go through, and if it doesn't it will do an 'ifdown etho', 'ifup eth0' to get the connection back. So now I've got a bandaid, but I'd like to find the root cause of this problem. Is there a monitoring utility I can use to just montior the ethernet connection between my server and my router? Thanks for the help!
|
|
|
10-19-2005, 08:49 AM
|
#9
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
Re: Server network connection degrades over time
Quote:
Originally posted by mindseye1
I just returned from a 2 week vacation, did my usual apt-get upgrades on my server (deb sid w/ kernel 2.6.8), and I noticed that when I tried to get to my website it was really slow, ...
|
I've been following this & I just re-read the above, it occurs to me: Did you have the problem before the apt-get upgrades?
If not, then the Q becomes "What changed?"
And raising an issue on my mind for a while, how do you do an "apt-get downgrade"? (I know the command doesn't exist, but is there an easy way to reverse an upgrade gone bad?)
|
|
|
10-19-2005, 11:30 AM
|
#10
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
No, my server had been working just fine before my trip AFAIK, but after the upgrade something went wrong. I have to also add though that it was also moved from one household to another (I moved into my new home when I returned from my trip). This also means I went from a D-Link DI-624+ to a DI-524 (almost identical except no 'Xtreme G'). Since there were quite a few variables since the problem started, I wanted to try and locate the problem with monitoring tools and pinpoint what is currently causing the errors. Perhaps apt has a log of what upgrades were done at that time that I could look through. Then maybe I could go through the individual programs that were upgraded and switch each one back (if that's possible).
It's just really frustrating since it was working so well before. I never even had it hooked up to any I/O, just put it in a closet with power and a LAN connection, and used SSH to do stuff on it when I needed to. Just for the record, the things I run on it are: Apache 1.3, mySQL, squid, samba, exim4, sshd, and cron. Nothing too far from a base Debian system.
|
|
|
10-20-2005, 08:31 PM
|
#11
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
Quote:
Is there a monitoring utility ...
|
Would [t]ethereal help? I have used it primarily to show how "chatty" "Winders" boxen are on a LAN. It seems to be able to make massive log files rapidly. But it does have filtering capability that I am not familiar with.
Also, another custom script to gather & log "top' results &/or ping times.
Do you have the option to go back to the DI-624+, even temporarily, just in case it's a hardware related problem?
Have you ever had trouble with/after apt-get upgrades before?
Have you done any additional apt-get upgrades?
Do have the time/HD space luxury of building a temporary replacement server? Say using Sarge, Etch, or something like what you had just before the trouble started?
Which is more important to you now, fixing the problem or understanding it? In terms of the Alexander reference, the sword or the marlin spike?
|
|
|
10-21-2005, 08:11 AM
|
#12
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
I actually just recently started using tethereal to do some monitoring, but I'm not getting real great info. I usually use the '-z conv,tcp' option so that I can get a summary of all the activity at the end of the scan, but the summary doesn't really tell me anything out of the ordinary (at least that I can see).
I could try looking up some type of top or ping logging scripts, but I think first I'd like to make sure I am getting all the info I can out of tethereal because it seems like that should easily be what I need.
Unfortunately, the DI-624 is now my Mom's router, and though I think I could get it eventually, I'm not sure how soon it would be. But eventually I'd definately like to go that route. I debated on picking up a WRT54gs to switch it out with (since I wanted one anyway to put linux on) and see if that helps. I still may try that.
I've never had any upgrade problems before, my little server has been pretty stable since I installed it. It's an old Celeron 300a BookPC with 128mb RAM (soon to be 512). I mainly just use it to ssh in from work and use the squid proxy through an ssh tunnel for all my work web surfing, and the web server is mainly for my family and friends to look at pictures, no more than a dozen people a day (I think).
Now that I have a working script that will retsore my connection automatically, my main importance is understanding the problem, even though it gets really annoyingly slow right before it dies! I think my next steps will be to 1) do more research on tethereal and see what other kinds of data I can obtain from it, 2) switch back to the DI-624 and see if I get the same errors, and 3) build another identical server on a spare machine and see what happens (hopefully it won't come to that). Thank again for all your time spent with this!
|
|
|
10-21-2005, 06:24 PM
|
#13
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
One other thing, can you check your /var/log/syslog and your /var/log/messages for any unusual entries. Specifically vj decompression errors.
|
|
|
10-22-2005, 07:31 AM
|
#14
|
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
|
Improving the band-aid
Quote:
I've also written a script (which I can post if anyone desires) that will check every 5 minutes to make sure a ping to my router will go through,
|
Are you logging the results in any way? Esp. when it has to restart eth0. That way you might be able to find a pattern & do a proactive restart every n-1 minutes.
BTW, thanks for answering each of the Q's suggestions in my last post.
|
|
|
10-24-2005, 11:25 AM
|
#15
|
LQ Newbie
Registered: Feb 2005
Posts: 15
Original Poster
Rep:
|
There is nothing good in either syslog or messages except for the log of when my script has to restart eth0. It seems like I get this message once every day or so. It seems to me that sometimes the server recovers from the laginess somehow. So it'll start getting slower and slower, but then sometimes instead of dying it will go back to normal speed. But then it just slows down again in the same way. It's too bad I can't log the speed of the connection over time, that might provide some good data. Is there any way to do that? Maybe during the pinging in my script I can record the averages and log it each time. Since it runs every 5 minutes that may give me a good indication. So any clue how I could do this?
|
|
|
All times are GMT -5. The time now is 05:01 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|