In general, when you are first developing and testing your module, you should dynamically load the module in the master agent. This method reduces the complexity while you work out any problems in the module. When you are ready to deploy a module, you should compile the module in a subagent instead of dynamically loading into the master agent. By using subagents, you can more easily isolate problems in the module.
However, sometimes a subagent is not the optimal deployment method. Use the following criteria to determine when to load a module into a master agent instead of a subagent:
If more than five requests per second are targeted to the module's MIB, you should consider loading the module into the master agent.
If your module queries the SYSTEM group often, and queries the IP branch very rarely, load the module into the master agent.
If your module queries the IP branch of the MIB very often, load the module in the subagent. The IP group of the module MIB is six times more computationally costly compared to the SYSTEM group.
The following table summarizes the primary advantages and disadvantages of dynamically loaded modules and subagents.
Table 6–1 Advantages and Disadvantages of Deployment Methods
Deployment Method |
Advantages |
Disadvantages |
---|---|---|
Dynamically loaded |
Less complexity compared to subagent approach |
Incurs a slightly greater load on agent at startup. Makes the master agent more vulnerable, especially if the module has quality and performance problems. For example, a module with quality problems might have a memory violation, which can crash the master agent. A module with performance problems might consume too many system resources, such as CPU time and memory. These problems might overload the master agent, causing the master agent not to function properly in processing other requests. |
AgentX subagent |
Isolates the module processing from the agent |
Incurs an extra cost to the master agent by causing the agent to build packets to transport requests between the master agent and the subagent. The master agent performs an extra step of both encoding and decoding for every incoming request that is targeted to the subagent. If the subagent gets too many requests, the time spent on additional encoding and decoding might be excessive. |