snmptrapd cpu usage on solaris when disconnected from pty.

"Jayson Robinson" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
All I've got a wierd one.

I'm running snmptrapd 5.3.01 on a solaris 9 box.  When I run from the 
command line and use the -f option I see less then 1% cpu usage.  Whenever I 
call the snmptrapd from the startup script (and it's using the same exact 
options) cpu goes way up:  ps output shows time on proc steadily going up in 
1 second increments with a 1 second sleep loop.

From the startup script:

root  1041     1  2 15:01:05 ?        0:01 /opt/net-snmp/sbin/snmptrapd 
<cmdline>
root  1041     1  4 15:01:05 ?        0:02 /opt/net-snmp/sbin/snmptrapd -C 
-c
root  1041     1  6 15:01:05 ?        0:02 /opt/net-snmp/sbin/snmptrapd -C 
-c
root  1041     1  8 15:01:05 ?        0:04 /opt/net-snmp/sbin/snmptrapd -C 
-c
root  1041     1 10 15:01:05 ?        0:05 /opt/net-snmp/sbin/snmptrapd -C 
-c
root  1041     1 11 15:01:05 ?        0:05 /opt/net-snmp/sbin/snmptrapd -C 
-c
root  1041     1 11 15:01:05 ?        0:06 /opt/net-snmp/sbin/snmptrapd -C 
-c
root  1041     1 13 15:01:05 ?        0:07 /opt/net-snmp/sbin/snmptrapd -C 
-c

From the command line with the exact same options:

    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c
    root  9257  9256  1 15:15:48 pts/6    0:00 /opt/net-snmp/sbin/snmptrapd 
-C -c

the complete command line:
/opt/net-snmp/sbin/snmptrapd -C -c /opt/net-snmp/share/snmp/snmptrapd.conf 
-a -OQ -t -n -p /var/snmp/snmptrapd.pid -f

If I leave off the -f and it disconnects from the calling shell it will also 
increment time on the processor.  Both of the trap daemons are running and 
are giving me the appropriate traps just the one that has to be used is 
eating up a lot of processor time.

If I add a -Dtrace to the command line, the one with the -f option seems to 
move through:
NET-SNMP version 5.3
trace: netsnmp_tdomain_transport(): snmp_transport.c, 350:
trace: netsnmp_tdomain_transport(): snmp_transport.c, 356:
trace: netsnmp_sockaddr_in(): snmpUDPDomain.c, 653:
trace: netsnmp_sockaddr_in(): snmpUDPDomain.c, 698:
trace: netsnmp_sockaddr_in(): snmpUDPDomain.c, 741:
trace: netsnmp_udp_transport(): snmpUDPDomain.c, 502:
trace: _sock_buffer_size_get(): snmpUDPDomain.c, 345:
trace: _sock_buffer_size_get(): snmpUDPDomain.c, 345:
trace: snmp_sess_add_ex(): snmp_api.c, 1556:
trace: _callback_lock(): callback.c, 118:
trace: snmp_call_callbacks(): callback.c, 304:
trace: snmp_call_callbacks(): callback.c, 318:
trace: snmp_call_callbacks(): callback.c, 330:
trace: _callback_unlock(): callback.c, 150:

This section will repeat very slowly:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: run_alarms(): snmp_alarm.c, 250:
trace: agentx_reopen_session(): mibgroup/agentx/subagent.c, 837:
trace: subagent_open_master_session(): mibgroup/agentx/subagent.c, 736:
trace: _callback_lock(): callback.c, 118:
trace: snmp_call_callbacks(): callback.c, 304:
trace: snmp_call_callbacks(): callback.c, 318:
trace: snmp_call_callbacks(): callback.c, 330:
trace: _callback_unlock(): callback.c, 150:
trace: netsnmp_tdomain_transport(): snmp_transport.c, 332:
trace: netsnmp_tdomain_transport(): snmp_transport.c, 350:
trace: netsnmp_tdomain_transport(): snmp_transport.c, 356:
trace: netsnmp_unix_transport(): snmpUnixDomain.c, 284:
trace: netsnmp_unix_transport(): snmpUnixDomain.c, 373:
trace: _sess_open(): snmp_api.c, 1428:
trace: run_alarms(): snmp_alarm.c, 252:
trace: snmp_sess_select_info(): snmp_api.c, 5843:


Whereas the one without the -f does the following very very fast:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: _sess_read(): snmp_api.c, 5417:
trace: snmp_sess_select_info(): snmp_api.c, 5843:

Can someone let me know what I might be doing wrong.

Thanks,
Jayson Robinson

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.