WebFaction
Community site: login faq
0
2

I wanted to check the memory usage of my account. I am aware of this command which lists down all the processes running under my account. Though which command will give me the memory usage as well.

ps -u hsparikh -o rss,etime,pid,command

Where hsparikh is the username under which my account is.

Thanks.

asked 21 Apr '13, 12:12

jpatel3's gravatar image

jpatel3
312
accept rate: 0%


You can use the following command to download a memory usage python script:

wget -O ~/bin/memory_usage.py 'http://wiki.webfaction.com/attachment/wiki/MiscellaneousFiles/memory_usage.py?format=raw'; chmod 755 ~/bin/memory_usage.py

Then, simply run it: memory_usage.py (or ~/bin/memory_usage.py) It will show you the total memory usage for all of your processes. Hope that helps!

permanent link

answered 21 Apr '13, 23:01

ryans's gravatar image

ryans ♦♦
5.0k42856
accept rate: 43%

thanks for pointing to it.

(24 Apr '13, 15:46) jpatel3 jpatel3's gravatar image

The RSS value is the memory usage in bytes, the command you have listed will show all the memory per process. If you want a total in MB than you could use this command,

ps -u hsparikh -o rss,command | grep -v peruser | awk '{sum+=$1} END {print sum/1024}'
permanent link

answered 21 Apr '13, 19:40

johns's gravatar image

johns ♦♦
5.0k29
accept rate: 23%

Thanks. It provides the cumulative total fo all the current process. How can I get the individual process usage?

(21 Apr '13, 22:37) jpatel3 jpatel3's gravatar image

I've posted another answer with script which does just this

(21 Apr '13, 23:02) ryans ♦♦ ryans's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×891
×82
×18

question asked: 21 Apr '13, 12:12

question was seen: 3,215 times

last updated: 24 Apr '13, 15:46

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM