ZABBIX Forums  
  #1  
Old 03-05-2011, 15:16
Mox Mox is offline
Member
 
Join Date: Sep 2009
Location: Saint-Petersburg, Russia
Posts: 90
Send a message via ICQ to Mox
Default REAL free memory under FreeBSD!

I just want to say:
Please, add some new modes for vm.memory.size key and delete useless modes!

It need for FreeBSD and maybe other BSD systems. If you want I'll check it!
Memory organization in FreeBSD is different than Linux.
Existing modes like 'used', 'shared', 'pfree' and 'pused' don't need under FreeBSD(allBSD?). It useless.

Also we already have 'total', 'free' and 'cached' modes. It usefull under FreeBSD.
As I see in src (src/libs/zbxsysinfo/freebsd/memory.c) 'total' memory calculate as "vm.stats.vm.v_page_count" * "vm.stats.vm.v_page_size".
'free' memory = "vm.stats.vm.v_free_count" * "vm.stats.vm.v_page_size".
'cached' memory = "vm.stats.vm.v_cache_count" * "vm.stats.vm.v_page_size"
This is good and right!

But we also need 'active', 'inactive' and 'wired' modes for vm.memory.size key under FreeBSD(BSD)!
We may calculate 'active' mem as "vm.stats.vm.v_active_count" * "vm.stats.vm.v_page_size"
'inactive' = "vm.stats.vm.v_inactive_count" * "vm.stats.vm.v_page_size"
'wired' = "vm.stats.vm.v_wire_count" * "vm.stats.vm.v_page_size" (sysctl var contains 'wire', not 'wired')

If you add up all this memory you get 'total' memory.
I.e. 'total' = 'active' + 'wired' + 'cache' + 'inactive' + 'free'

In FreeBSD 'free' memory doesn't mean REAL free memory available for programs.
Actually used memory in FreeBSD is 'active' + 'wired'. And real free mem is 'cache' + 'inactive' + 'free'.
Under load 'active' and 'wired' types of memory are growing and other types are decreasing.
When 'cache', 'inactive' and 'free' will be tiny system will be active use swap.

I can provied graphics if you want.
And if you don't have enough time I can try to provide patches for src/libs/zbxsysinfo/freebsd/memory.c, but I have small experience in C programming.

Last edited by Mox; 05-05-2011 at 14:25.
Reply With Quote
  #2  
Old 04-05-2011, 10:59
Mox Mox is offline
Member
 
Join Date: Sep 2009
Location: Saint-Petersburg, Russia
Posts: 90
Send a message via ICQ to Mox
Default

https://support.zabbix.com/browse/ZBXNEXT-774
Reply With Quote
  #3  
Old 10-05-2011, 21:34
Mox Mox is offline
Member
 
Join Date: Sep 2009
Location: Saint-Petersburg, Russia
Posts: 90
Send a message via ICQ to Mox
Default

Please, test it
https://support.zabbix.com/secure/at..._freebsd_mem.c
Just copy this file to /usr/ports/net-mgmt/zabbix-server/files/ directory and reinstall zabbix_agent
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:51.