[tkined] Questions about my code design. . . opinions please?

Robert Seeger (Robert_Seeger@BayNetworks.COM)
Tue, 26 Jan 1999 10:43:58 -0500

Hiya folks. Well, I just received a new programming project, and I'd like
some opinions/clarifications on things regarding Tcl and Tnm. Some of the
things I'm asking about are actual questions of fact, and some are
questions about opinions. Feel free to reply to any part with any opinions
you may have. In fact, I'd very much like to hear what everyone has to say
about this.

Ok, the basic concept is this:
Write a script that will read in a file of C100s, and one that contains
OIDs, timing information, and thresholds. Proceed to query each C100 for
each OID every timing interval. Each OID may have a different timing
interval. When a value is found for a given OID, compare it to thethreshold
value. If it exceeds the threshold, send a trap to the monitor software
(seperate program. . not my problem ;-), and then continue to monitor.

Keep in mind, I'm stating a more simplified summary here. It will actually
be allowed to use a variety of comparisions against the threshold, and
compare against the previous value obtained, if such is wanted.

My boss, and his boss, believe that the program should be split into
multiple processes, one for each device, which will be started by the main
program. I'mof the opinion that one, large, event-based script can handle
the whole thing. . .

I'd like some input on the following:

- What is the maximum number of SNMP requests that can be out at once?
- What is the maximum number of SNMP requests that should be out at once?
- Does it take a lot of additional memory to spawn off another Tcl process,
(Would 100 or so of them take up a huge chunk of memory?) given that the
shell has TclX, Itcl, Tnm, and Sybtcl. . all dynamically loaded?
- Given that each returned value executes around 50 lines of code, is it
reasonable to assume that 100 devices being polled for 25 values would not
cause the code to always be waiting for some code to finish (ie, it's not
in the event loop, but waiting for some code to finish). How about 50
values? How about 100?

My thoughts on positives and negatives of each type:
Seperate process for each device:
+ The process will spend less time in code, and more time in the event loop.
+ The actual script to poll one device is simpler than that to poll
multiple devices
- Debugging information will be harder to keep track of, since they all
write to the same debug file.
- If I write custom logfile/debugging code to split up the information by
process, it adds to the complexity of the code (the previous code is
already written and tested)
- Memory/process/system resources hog

One process for all devices:
+ Debugging/Logging is much easier
+ Much less in the way of memory/process/system resources usage
- The code may not spend enough time in the event loop, and too much time
executing code.

I'd appreciate any comments on what I have described here. Any answers to
questions is appreciated (and requested), as are additions to my
positives/negatives of each approach, and any other thoughts.

I truly appreciate the time you take to reply,
Robert Seeger
========================================
Robert Seeger
Network Engineer
Bay Networks

Telephone: (518)237-2087
Pager: (800)SKY-8888 Pin#1264792
Fax: (518)237-4190
Email: rseeger@baynetworks.com
Address: 224 5th Ave, Apt#2
Lansingburgh, NY 12182
========================================

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.