Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a VPS and have been having some trouble the last few days with it crashing. I can restart it, and everything is fine for about a day, then the same thing happens again.
The last time it did so, I noticed the swap memory was full. So, since this last restart, I've been monitoring 'top' a lot.
Here's the latest readout:
CPU states: cpu user nice system irq softirq iowait idle
total 0.1% 0.0% 0.3% 0.0% 0.0% 0.0% 99.4%
Mem: 189036k av, 173344k used, 15692k free, 0k shrd, 4712k buff
79240k active, 85764k inactive
Swap: 262136k av, 132960k used, 129176k free 51164k cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
1011 root 18 19 6796 5664 4940 S N 0.0 2.9 0:00 0 cpanellogd
824 root 8 0 4800 3452 3432 S 0.0 1.8 1:04 0 httpd
996 mailnull 9 0 4648 2924 2924 S 0.0 1.5 0:00 0 eximstats
947 mysql 9 0 3636 2880 2296 S 0.0 1.5 0:13 0 mysqld
740 root 8 0 3228 2248 1884 S 0.0 1.1 0:00 0 chkservd
696 named 9 0 2304 2204 1812 S 0.0 1.1 0:00 0 named
Nothing's taking up a ton of memory or cpu usage. However, the size of 'used' swap memory has been climbing since the last restart. I have a feeling that when it fills up, the server will crash, and we'll do the whole thing over again.
So, my questions are:
1) Is the swap memory supposed to clear after use? I mean, there's plenty of free space after each time it is used (another issue), shouldn't it start going down again?
2) What are some things that can cause the swap memory to come into play very quickly (even with top running, I haven't been able to spot it jump) when everything else is normal?
It sounds like you have a "memory leak". this a condition where memory is allocated, but never released. Older allocated memory that hasn't been recently referenced is placed into swap to free up RAM. In your case, it looks like that process is continuing until swap is full. I suggest you try to isolate the application/service causing the problem (avoid using things you've been using when you note the problem) and open a bug report with your distribution vendor.
I just noticed that the swap usage did go down tonight, from 4176k to 4152k. It's not much, but at least it shows that it can go down.
As for the leak issue, I really have no idea what could cause it. For the most part, the server runs at optimal memory and cpu usage. Then, all of a sudden (about once a day since Friday, at different times) it fills up and crashes. It's a web server, so I'm not doing anything special at the time. In fact, I haven't even been logged into the machine when it's occured.
So, I guess I will just continue to keep my eye on it and hope I can spot the culprit in the act.
Originally posted by macemoneta It sounds like you have a "memory leak". this a condition where memory is allocated, but never released. Older allocated memory that hasn't been recently referenced is placed into swap to free up RAM. In your case, it looks like that process is continuing until swap is full. I suggest you try to isolate the application/service causing the problem (avoid using things you've been using when you note the problem) and open a bug report with your distribution vendor.
The problem isn't seeing the memory statistics (I've been watching 'free' and 'top' for 2 days), but figuring out why the swap memory is being used when memory usage is not very high at all. So far, no one has been able to figure out why.
A VPS is a Virtual Private Server. It's a cheaper option than a dedicated server for a hosting solution. The hosting company is in charge of more general server maintenance and software, where as I take care of the smaller details. When something goes wrong, both parties try to solve it.
Originally posted by Crashed_Again Check out the 'free' command as well to get some good memory statistics.
Dumb question, what is a VPS? Do you maintain the server and its software?