LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to get average memory usage, like sar (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-get-average-memory-usage-like-sar-4175447259/)

slowerogue 01-25-2013 10:03 PM

how to get average memory usage, like sar
 
hi , i can get average of cpu idle ,using sar
anywhere can i get average memory usage

i need to run vmstat 600 144, then get the usage and divde them inside a script file?
or is there anything like sar i can directly get the average mem usage of the day

shivaa 01-25-2013 10:44 PM

Which distro?

slowerogue 01-25-2013 10:49 PM

rhel 6

shivaa 01-25-2013 11:23 PM

Sar shoud be there. Else you can go with sysstat.
Check:
Download
Sysstat

slowerogue 01-25-2013 11:39 PM

hi
i have sar, i can run it
but sar result is about processor

i want the result is the memory usage

syg00 01-25-2013 11:49 PM

In which case you should read the documentation - [hint] all the way to the end.

shivaa 01-26-2013 12:07 AM

@slowerogue:
Are you sure? Did you really go through sar manual??

As per manual:-
Quote:

ldavg-5
System load average for the past 5 minutes.

ldavg-15
System load average for the past 15 minutes.

-r Report memory utilization statistics. The following values are displayed:

kbmemfree
Amount of free memory available in kilobytes.

kbmemused
Amount of used memory in kilobytes. This does not take into account memory used by the kernel itself.

%memused
Percentage of used memory.

kbbuffers
Amount of memory used as buffers by the kernel in kilobytes.

kbcached
Amount of memory used to cache data by the kernel in kilobytes.

kbcommit
Amount of memory in kilobytes needed for current workload. This is an estimate of how much RAM/swap is needed to guarantee that there never is out of memory.

%commit
Percentage of memory needed for current workload in relation to the total amount of memory (RAM+swap). This number may be greater than 100% because the kernel usually overcommits memory.

-R
Report memory statistics. The following values are displayed:

frmpg/s
Number of memory pages freed by the system per second. A negative value represents a number of pages allocated by the system. Note that a page has a size of 4 kB or 8 kB according to the machine architecture.

bufpg/s
Number of additional memory pages used as buffers by the system per second. A negative value means fewer pages used as buffers by the system.

campg/s
Number of additional memory pages cached by the system per second. A negative value means fewer pages in the cache.

And memory usage in what sense - can you explain your requirement little more? Memory usage (which memory, physical, swap, virtual?) by any process at some point of time or avg. for whole day or load average for whole day or what...? Explain.

slowerogue 01-26-2013 12:45 AM

thanks alot , i found it

shivaa 01-26-2013 01:24 AM

Sar is all what you need.

BTW, if nothing more to ask in this, then mark the thread as Solved (on top menu, under Thread Tools option, Mark this thread as Solved).


All times are GMT -5. The time now is 09:24 PM.