LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 05-09-2010, 08:08 PM   #1
johnsan
LQ Newbie
 
Registered: Mar 2010
Location: Sydney, Australia
Distribution: Debian & CentOS
Posts: 15

Rep: Reputation: 0
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.
 
Old 05-09-2010, 10:15 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
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.
Old 05-09-2010, 11:12 PM   #3
johnsan
LQ Newbie
 
Registered: Mar 2010
Location: Sydney, Australia
Distribution: Debian & CentOS
Posts: 15

Original Poster
Rep: Reputation: 0
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?
 
Old 05-09-2010, 11:30 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,220

Rep: Reputation: 164Reputation: 164
It sounds like something is memory leaking.
Please put the top output in code tags!
 
Old 05-11-2010, 06:50 AM   #5
johnsan
LQ Newbie
 
Registered: Mar 2010
Location: Sydney, Australia
Distribution: Debian & CentOS
Posts: 15

Original Poster
Rep: Reputation: 0
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 ?
 
  


Reply

Tags
apache2, debian, lenny, memory


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 and jumping memory usage bigmen Debian 1 10-15-2009 03:13 PM
Apache2 + mod_auth_pgsql = 500 Internal Server Error on Debian Lenny Mleahy Linux - Server 1 07-05-2009 04:16 AM
[SOLVED] Reducing harddisk usage (Debian Lenny) mike11 Linux - Hardware 4 06-17-2009 03:01 PM
Memory usage constantly increasing reverse Debian 1 11-11-2007 03:15 AM
mysql increasing memory usage over time jman623 Linux - Server 0 08-21-2007 07:44 PM


All times are GMT -5. The time now is 12:44 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration