In the MIB I am working on I currently have 2 tables both of which I
have a cache for so multiple hits would have less impact on the system
overall. As suggested in an earlier posting I generated the code with
mib2c and that was very helpful in terms of coming up with a template of
what the code should look like. I had both caches setup with a 60
second timer figuring I only need to update these statistics once per
minute to avoid too much system load. However I am finding that it
looks like it serializes the timers and doesn't behave as I would
expect.
My test case is the following:
1. Start Agent
2. Run SNMP Walk on a parent of both tables so both get walked and
thus load the cache
3. Watch debug lines I inserted into the free handler to see how
long it takes for the cache to get freed
What I am finding is that after 60 seconds I see the first cache get
freed up and then 60 seconds later I see the second cache get freed up.
So in actuality table 1 timeout is 60 and table 2 timeout is effectively
120 seconds.
I'm wondering if there is any quick fix to get both handlers to fire at
the same time assuming that both caches are loaded at the same time?
At a high level the code for initializing each table looks like the
following:
netsnmp_create_handler_registration(.....) -- registers the table oid
and the handler that is associated with it
netsnmp_table_helper_add_indexes(...) - adds the index
netsnmp_register_table_data_set (....)
netsnmp_cache_create(......) - Pass 60 second timeout, load and free
handlers and the table OID
netsnmp_inject_handler_before (....) -- injects the cache free/load
handlers before the get handler
Some of the detail in the middle left out as it doesn't seem too
material to the question. However I have roughly equivalent
initialize_table methods with the above pattern for both tables.
Seems like one work around could be to just shrink the timeout to
something like 30 seconds then I'd still have a worst case of a minute
and it would probably behave properly if they were infrequently accessed
one table at a time. But if there is some quick fix to get the timer to
handle it quickly please let me know.
If it makes a difference this is running on version 5.2.2 not sure if
this issue may have been improved in a newer version?
Thank you,
Jared Smith
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
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