Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| 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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-09-2010, 08:08 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2010
Location: Sydney, Australia
Distribution: Debian & CentOS
Posts: 15
Rep:
|
Memory usage increasing Debian Lenny Apache2 server
Hi all,
I have a Web server running Apache2 and PHP5 on a Debian Lenny. When I "TOP" the processes, I can see that the Mem: used is consistently increasing. And now, the Swap is being used. This is what TOP tells me:
Code:
top - 11:02:40 up 19 days, 22:23, 2 users, load average: 0.00, 0.00, 0.00
Tasks: 95 total, 1 running, 94 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3365180k total, 3207548k used, 157632k free, 220908k buffers
Swap: 3903752k total, 700k used, 3903052k free, 2813252k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 2100 688 588 S 0 0.0 0:04.64 init
2 root 15 -5 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/0
4 root 15 -5 0 0 0 S 0 0.0 1:24.19 ksoftirqd/0
5 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/0
6 root RT -5 0 0 0 S 0 0.0 0:00.02 migration/1
7 root 15 -5 0 0 0 S 0 0.0 0:16.14 ksoftirqd/1
8 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/1
9 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/2
10 root 15 -5 0 0 0 S 0 0.0 2:08.89 ksoftirqd/2
11 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/2
12 root RT -5 0 0 0 S 0 0.0 0:00.00 migration/3
13 root 15 -5 0 0 0 S 0 0.0 4:33.54 ksoftirqd/3
14 root RT -5 0 0 0 S 0 0.0 0:00.00 watchdog/3
15 root 15 -5 0 0 0 S 0 0.0 0:08.22 events/0
16 root 15 -5 0 0 0 S 0 0.0 0:08.44 events/1
17 root 15 -5 0 0 0 S 0 0.0 0:08.54 events/2
18 root 15 -5 0 0 0 S 0 0.0 0:30.72 events/3
19 root 15 -5 0 0 0 S 0 0.0 0:00.00 khelper
54 root 15 -5 0 0 0 S 0 0.0 0:00.10 kblockd/0
55 root 15 -5 0 0 0 S 0 0.0 0:00.06 kblockd/1
56 root 15 -5 0 0 0 S 0 0.0 0:00.22 kblockd/2
57 root 15 -5 0 0 0 S 0 0.0 0:00.20 kblockd/3
59 root 15 -5 0 0 0 S 0 0.0 0:00.00 kacpid
60 root 15 -5 0 0 0 S 0 0.0 0:00.00 kacpi_notify
153 root 15 -5 0 0 0 S 0 0.0 0:00.00 kseriod
202 root 20 0 0 0 0 S 0 0.0 0:00.08 pdflush
203 root 20 0 0 0 0 S 0 0.0 0:15.42 pdflush
204 root 15 -5 0 0 0 S 0 0.0 0:00.28 kswapd0
205 root 15 -5 0 0 0 S 0 0.0 0:00.00 aio/0
206 root 15 -5 0 0 0 S 0 0.0 0:00.00 aio/1
207 root 15 -5 0 0 0 S 0 0.0 0:00.00 aio/2
208 root 15 -5 0 0 0 S 0 0.0 0:00.00 aio/3
791 root 15 -5 0 0 0 S 0 0.0 0:00.00 ksuspend_usbd
792 root 15 -5 0 0 0 S 0 0.0 0:00.00 khubd
The server is only used to host a web application developed in PHP. It hosts PHP5 and MySQL for the DB. Webmin is installed to monitor the server from a browser. Webmin tells me the following:
Operating system Debian Linux 5.0
Webmin version 1.510
Time on system Mon May 10 11:01:19 2010
Kernel and CPU Linux 2.6.26-2-686 on i686
Processor information Intel(R) Xeon(R) CPU X3363 @ 2.83GHz, 4 cores
System uptime 19 days, 22 hours, 21 minutes
Running processes 99
CPU load averages 0.00 (1 min) 0.00 (5 mins) 0.00 (15 mins)
CPU usage 0% user, 0% kernel, 0% IO, 100% idle
Real memory 3.21 GB total, 180.86 MB used
Virtual memory 3.72 GB total, 700 kB used
Local disk space 1.79 TB total, 99.94 GB used
I have very little knowledge with server administration and I am worried my server will crash. I don't know what to do to check the processes that may consume memory and not release it after use.
Any guidance, things to do on the server to verify that everything is going alright would be appreciated.
Thanks
Last edited by johnsan; 05-11-2010 at 06:49 AM.
|
|
|
|
05-09-2010, 10:15 PM
|
#2
|
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
There is no problem. Linux is designed to use memory, and you only have 700k of swap. Don't worry about it.
This is my machine when streaming video over http -
Code:
[smoker@kids ~]$ top
top - 04:16:52 up 32 days, 18:45, 2 users, load average: 0.02, 0.16, 0.27
Tasks: 143 total, 2 running, 141 sleeping, 0 stopped, 0 zombie
Cpu(s): 5.3% us, 3.0% sy, 0.0% ni, 91.7% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 2075612k total, 2024676k used, 50936k free, 152196k buffers
Swap: 915696k total, 151728k used, 763968k free, 1314396k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3622 root 15 0 135m 97m 13m S 2.3 4.8 253:52.60 X
23993 smoker 15 0 28228 7928 6420 S 2.0 0.4 671:12.65 gkrellm
22293 smoker 15 0 37424 12m 8728 S 2.0 0.6 0:00.85 gnome-terminal
23940 smoker 16 0 23372 15m 6628 S 1.0 0.8 30:28.45 metacity
24186 smoker 15 0 47164 21m 16m S 0.7 1.1 53:05.18 vmplayer
3755 smoker 16 0 6548 2864 792 S 0.3 0.1 24:00.54 gam_server
23855 smoker 15 0 20436 5604 5256 S 0.3 0.3 0:38.26 gnome-session
24070 smoker 15 0 22772 9.8m 8584 S 0.3 0.5 0:47.50 timer-applet
24193 smoker 5 -10 1360m 932m 918m S 0.3 46.0 959:47.11 vmware-vmx
22319 smoker 15 0 2020 1048 804 R 0.3 0.1 0:00.25 top
1 root 16 0 1740 516 488 S 0.0 0.0 0:02.17 init
2 root 34 19 0 0 0 S 0.0 0.0 0:03.06 ksoftirqd/0
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
4 root 10 -5 0 0 0 S 0.0 0.0 0:06.17 events/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.15 khelper
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:03.81 kblockd/0
Last edited by smoker; 05-09-2010 at 10:17 PM.
|
|
|
1 members found this post helpful.
|
05-09-2010, 11:12 PM
|
#3
|
|
LQ Newbie
Registered: Mar 2010
Location: Sydney, Australia
Distribution: Debian & CentOS
Posts: 15
Original Poster
Rep:
|
hi Smoker,
Thank you for your answer. So there is nothing to worry about? I understand that the server is using the memory available. But because I only have 1 web application running (and currently no user connected to it), I am surprised that the memory usage increases over time like that.
Should I restart the server once a week to make sure it won't crash? Or should I install a program to release the memory manually with a cron task?
|
|
|
|
05-09-2010, 11:30 PM
|
#4
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Rep: 
|
It sounds like something is memory leaking.
Please put the top output in code tags!
|
|
|
|
05-11-2010, 06:50 AM
|
#5
|
|
LQ Newbie
Registered: Mar 2010
Location: Sydney, Australia
Distribution: Debian & CentOS
Posts: 15
Original Poster
Rep:
|
That was also my guess, something leaking... but I don't know how to find what is leaking, if anything. Can you give me some hints on how to do that ?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:15 PM.
|
|
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
|
|