Linode Forum Index Linode Forum
Linode Community Forums
 


python memory usage

Click here to go to the original topic

 
       Linode Forum Index -> Performance and Tuning
Author Message
Ericson578



Joined: 08 Jul 2011
Posts: 43
Location: United States

Posted: Wed Jan 04, 2012 1:50 pm    Post subject: python memory usage  

I ran top recently and filtered by memory usage

Code: top - 10:48:04 up 150 days,  4:31,  1 user,  load average: 0.00, 0.01, 0.05
Tasks:  79 total,   1 running,  78 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:    435132k total,   334640k used,   100492k free,    39608k buffers
Swap:   262140k total,     6120k used,   256020k free,   195700k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1172 mysql     20   0 84468  11m 6164 S    0  2.8   0:00.08 mysqld
 2355 root      20   0 58556 7600 1400 S    0  1.7   4:24.56 python
 1153 root      20   0  111m 4472 1164 S    0  1.0   0:00.17 php5-fpm
 1154 www-data  20   0  111m 3996  688 S    0  0.9   0:00.00 php5-fpm
 1155 www-data  20   0  111m 3996  688 S    0  0.9   0:00.00 php5-fpm


Why is python using so much memory? Is that normal? I don't recall seeing python near the top of the list when I've monitored memory usage before.

Should I investigate any long running python scrips that might be running?

Thanks!
Eric
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Wed Jan 04, 2012 3:49 pm    Post subject:  

It depends on what it is doing, I suppose. That's about where I'd expect it to be for a modest Django project.
Back to top  
hybinet



Joined: 02 May 2008
Posts: 1058

Posted: Wed Jan 04, 2012 3:58 pm    Post subject:  

Your Python script is only using 7.6MB. It's the RES column that matters.

Also, your total memory usage is just around 100MB (334640k - 39608k - 195700k), so you have a lot of room left.
Back to top  
Ericson578



Joined: 08 Jul 2011
Posts: 43
Location: United States

Posted: Wed Jan 04, 2012 4:28 pm    Post subject: running length  

Should I be concerned with the running time?

hybinet wrote: Your Python script is only using 7.6MB. It's the RES column that matters.

Also, your total memory usage is just around 100MB (334640k - 39608k - 195700k), so you have a lot of room left.
Back to top  
obs



Joined: 07 Mar 2010
Posts: 1403
Location: Earth

Posted: Wed Jan 04, 2012 4:59 pm    Post subject:  

It depends what the process actually is, lots of things use python, what does Code:  ps u -p 2355 output?
Back to top  
Ericson578



Joined: 08 Jul 2011
Posts: 43
Location: United States

Posted: Fri Jan 06, 2012 12:53 pm    Post subject: ps output  

aha, it's the denyhosts script. ok, looks like nothing to worry about then, definitely want that one running.

Code: #ps u -p 2355
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      2355  0.0  1.7  58556  7608 ?        S     2011   4:27 python /usr/sbin/denyhosts --daemon --purge --config=/etc/den



Thanks for your help!
:D
Back to top  
 
       Linode Forum Index -> Performance and Tuning
Page 1 of 1