To enable the plugin, you must modify magnus.conf manually. This should look something like this:
Init fn="load-modules" funcs="init-resonate" shlib="server_root/bin/https/lib/libloadbal.so" Init fn="init-resonate" ThreadPool="sleep" EventExePath="/tools/ns/bin/perl5" LateInit="yes" CmdLow="/opt/SUNWwbsvr/plugins/loadbal/CmdLow.pl" CmdHigh="/opt/SUNWwbsvr/plugins/loadbal/CmdHigh.pl"
The init-resonate function can take the following parameters:
Table 3–1 init-resonate Parameters
Parameter |
Description |
---|---|
ThreadPool |
Name of the thread pool to monitor. |
Aggressive |
If set to TRUE, this argument causes the plugin to use the pool thread count rather than the queue thread count. |
PollTime |
How frequently to check the thread status. The default is 2000 milliseconds. |
HighThreshold |
Defines the queue size/# of threads where HighCmd is executed to increase load on the server. The default is 4096. |
LowThreshold |
Defines the queue size/# of threads where the LowCmd is executed to decrease load on the server. The default is 1. |
EventExePath |
Pointer to the script program you want to run (for instance, /usr/bin/perl or /bin/sh). Defaults to perl or perl.exe, depending on the platform. |
CmdLow |
Pointer to the script to be run when the LowThreshold is met. |
ArgsLow |
Arguments to send to CmdLow. |
CmdHigh |
Pointer to the script to be run when the HighThreshold is met. |
ArgsHigh |
Arguments to send to CmdHigh. |
You must specify LateInit="yes" when loading this module. The module creates a monitoring thread, and this monitoring thread must start after ns-httpd has started.
If you set LogVerbose on in magnus.conf, the error log contains information on how the plugin is configured and when it is invoked.
A sample of the information in the error log is shown below:
[12/Jun/2003:09:36:35] verbose (20685): Resonate plugin watching thread pool sleep [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin aggressive setting is FALSE [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin poll time set to 2000 [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin HighThreshold set to 5 [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin LowThreshold set to 1 [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin event executable path set to /tools/ns/bin/perl5 [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin low command set to /opt/SUNWwbsvr/plugins/loadbal/CmdLow.pl [12/Jun/2003:09:36:35] verbose (20685): Resonate plugin high command set to /opt/SUNWwbsvr/plugins/loadbal/CmdHigh.pl
This is what the log entries will look like when LogVerbose on is set and the plugin is activated:
[12/Jun/2003:09:40:12] verbose (20699): Resonate plugin reducing load. [12/Jun/2003:09:40:14] verbose (20699): Resonate plugin reducing load. [12/Jun/2003:09:40:16] verbose (20699): Resonate plugin reducing load. [12/Jun/2003:09:40:18] verbose (20699): Resonate plugin reducing load. [12/Jun/2003:09:40:20] verbose (20699): Resonate plugin reducing load. [12/Jun/2003:09:40:30] verbose (20699): Resonate plugin increasing load.