[arch-general] most efficient way to get linux kernel statistics

Florian Pelz pelzflorian at pelzflorian.de
Sun Mar 6 16:13:37 UTC 2016


On 03/06/2016 04:47 PM, Jonathan Horacio Villatoro Córdoba wrote:
> On Sun, Mar 06, 2016 at 03:23:33PM +0100, Andre Schmidt wrote:
>> hello archers,
>>
>> thought i ask here first, before i try some kernel mailing list.
>>
>> i'm writing (for fun) a tiny daemon that sends linux usage (cpu, mem, net, etc.) statistics as efficiently as possible to another machine, repeatedly, to get "live" data.
>>
>> at the moment i'm simply sending /proc files, but they sometimes have too much data. so was wondering if there is a more efficient way to get (only parts of) the data thats available in /proc?
>>
>> for example, /proc/meminfo has all this info:
>>
>> […]
>>
>> if /proc is the only way to get this info, i wonder if creating a kernel module for this would be more efficient, or even possible?
> 
> Hello Andre,
> 
> According to what you need, you may want to use the 'free' command
> instead, as its output is much simpler than the output of the
> /proc/meminfo file
> 
> […]
> 

Hello,

The free command gets its information from /proc/meminfo.
Performance-wise, it doesn't really matter if a few additional lines
need to be parsed.


More information about the arch-general mailing list