I have a sub-agent which provides access to a table that is fairly expensive to build 
and I'm hoping someone who's done this before has an idiom that'll help me lighten the 
load on my system and respond more quickly to requests.

I've used mib2c 5.1.1 to generate code for dot1dTpPortFdbTable (.1.3.6.1.2.1.17.4.3) 
then filled in the generated functions.  As I understand it -- and I'm happy to be 
corrected -- when a request comes in for table data, the (sub-)agent gathers 
information about the size of the table and its keys (with 
dot1dTpFdbTable_get_first_data_point() and dot1dTpFdbTable_get_next_data_point()) then 
uses that information to figure out what keys to give get_dot1dTpFdbAddress(), etc. to 
get all the data necessary to satisfy all the requests in the message.  Right so far?

My first-pass implementation gets external data and caches it in an array of 
structures inside the get_*_data_point() routines but it takes a while.  As a result, 
if a client asks for individual values from the table (one request per message), then 
I build the table over and over again, incurring all of the overhead on every request.

One solution would be to put some sort of timer on my cache so that I don't refill it 
for _every_ message.  That has problems with stale data, etc.

It's fairly easy and cheap for me to get _one_ record for one MAC address 
(dot1dTpFdbAddress), if there were just some way to bypass the get_*_data_point() 
routines and let the data access routine build individual records in the cache (or 
return data directly) but I don't see how the table iterator architecture lets me do 
that.

I could also do some fancy coding to spread the load of building the cache over 
multiple calls but that also give me stale data (not to mention complex code that's 
harder to maintain).

I'd rather not have to recode without the table helpers but I seem to have a mismatch 
between my requirements and the table interator stuff.  I hope someone more familiar 
with this area can provide some net-snmp insight.

TIA.

                               Chris



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
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

Reply via email to