From: SourceForge.net <no...@so...> - 2009-03-11 22:03:32
|
Patches item #2564552, was opened at 2009-02-04 18:37 Message generated for change (Comment added) made by ahmake You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=2564552&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: Yes Submitted By: Elan Ruusamäe (ahmake) Assigned to: Nobody/Anonymous (nobody) Summary: add netlink query support for agent/mibgroup/mibII/tcpTable. Initial Comment: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/net-snmp-netlink.patch this patch adds support fetching tcpConnState over netlink under linux. it improves dramastically the performance: time ss -nat | wc -l -> 10648; 0m0.126s (with tcp_diag kernel module) time ss -nat | wc -l -> 10929; 0m2.380s (without tcp_diag kernel module) time netstat -nat | wc -l -> 10775; 0m8.275s (plain /proc/net/tcp reading) extra dependency is libnl - a library for making netlink programming easy: http://people.suug.ch/~tgr/libnl/ i've coded it for 0.5.0 version, other versions are likley easy to support (one constant was missing from 0.1.0 for example) ---------------------------------------------------------------------- >Comment By: Elan Ruusamäe (ahmake) Date: 2009-03-12 00:03 Message: i've updated the patch to support api for 1.1 of libnl also extra check is made to return only ipv4 sockets is there anything more to do to get the patch accepted? ---------------------------------------------------------------------- Comment By: Elan Ruusamäe (ahmake) Date: 2009-02-05 20:57 Message: * about notify, i don't think it is great idea, because on a busy site there are so many changes in tcp socket states that snmpd would eat all cpu trying to handle each change. on the other hand polling the tcp connection states for graphing happens in 5 minute intervals. * LMIBLIBS taken into account (patch under link updated) * it appears that the current patch will fail to use netlink if tcp_diag module is not loaded and fall back to /proc/net/tcp reading (which is horrible by performance on busy site). i here wonder what is the proper behaviour, should the fallback happen or rather error returned. as if for some reason tcp_diag is not loaded, you don't really want snmpd eating your cpu? the error it self was: Feb 4 17:42:32 eros snmpd[10786]: snmpd: Couldn't connect to netlink: bind() failed (errno = Operation not permitted) need to dig this deeper as ss(1) from iproute2 seems to work if tcp_diag is not loaded ---------------------------------------------------------------------- Comment By: Magnus Fromreide (magfr) Date: 2009-02-04 23:07 Message: I have since found libnl. It appears to be licensed under LGPL-2.1 so that should be ok. Furthermore, it seems as if it do support a notification interface, that is a good thing. ---------------------------------------------------------------------- Comment By: Magnus Fromreide (magfr) Date: 2009-02-04 22:55 Message: I like this, clean and simple, just a few nits: * http://people.suug.ch/~tgr/libnl/ doesn't respond. That makes it quite unsuitable as a dependency and I have not been able to review it. * The configury should probably just add libnl to LMIBLIBS, like this: NETSNMP_SEARCH_LIBS(nl_fun, nl, AC_DEFINE(),,,LMIBLIBS) * I have the impression that it is possible for netlink to notify interested parties when there is a change, if that is the case then it would very nice to have that kind of handling so that we don't have to poll the value. ---------------------------------------------------------------------- Comment By: Elan Ruusamäe (ahmake) Date: 2009-02-04 18:39 Message: File Added: net-snmp-netlink.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=2564552&group_id=12694 |