|
Sybernet / Supplied Software
Release 3.00 Dec 20, 2002 |
|
Sybercron is a UNIX daemon that periodically looks in Sybase or Oracle for things to do. It does this by executing the procedure sp_html_cron. The results of this procedure will determine if a stored procedure is ready to execute. As long as any non-OK result is returned, Sybercron will continue to call this procedure until there are no more procedures to execute.
Sybercron was written before Sybernet was multi-tasking. This meant that Sybercron would distribute tasks among the available servers. Sybercron now takes advantage of Sybernet's multi-tasking ability and will initiate as many tasks as there are connections available.
Whereas the load used to be distributed, Sybercron now initiates tasks from the same port that Sybercron is suppose to listen at.
The previous limit for the number of asynchronous tasks initiated by Sybercron was 5 (the number of servers minus one). The current limit is now the maximum number of connections minus the number of active connections minus one. During peek periods, the average number of user connections (per server) is between 20 and 30. During unpeak periods, Sybercron now has the ability to execute about 60 tasks simultaneously.
Sybercron resides in your cgi-bin directory and recognizes the following command line arguments:
| Command | Description |
|---|---|
-U username |
Username is your Sybase username. If not specified, the current value for LOGINNAME (an environment variable) is used. |
-P password |
Password is your Sybase password. If not specified, it will be prompted from stdin. |
-S hostname |
Hostname is the name of your Sybase data server. Your DSQUERY environment variable will be used if not specified. |
-I identity |
Identity corresponds to PLATFORM in the CRON table. This option makes it possible to run Sybercron from several different UNIX hosts. The default value for Identity is SPOCK |
-T seconds |
seconds determines the number of seconds between each iteration. That is, Sybercron calls sp_html_cron successfully until there is nothing left to do, then it waits for the number of seconds specifed by seconds. The default is 300 seconds (or 5 minutes) between iterations. If seconds is 0, Sybercron will exit after processing the first batch. This make it possible to call this program from another application; for example, you may prefer to use the UNIX cron facility to call Sybercron. |
-C socket |
This option allows you to specify the starting socket number of the Sybernet server. Normally, Sybercron gets this information from the configuration file. To allow Sybercron to run without interrupting or impacting real users, you may wish to dedicate one or more servers for this facility. |
-D |
The -D option turns on debugging. This writes all output destined for the log file to stdout as well. |
-X |
This option starts Sybercron with defaults for all of the above. |
After successfully logging on to Sybase, Sybercron calls sp_html_cron. If a procedure is ready to execute, its run statement is returned and submitted for execution as a separate, asynchronous process. Sybercron will continue to call sp_html_cron until there are no more procedures ready to run. After all procedures ready for execution have been submitted, Sybercron sleeps until the next iteration.
The safest way to terminate Sybercron is by sending a -QUIT signal; for example,
kill -QUIT pid
Sending the quit signal allows the program to wait for all child processes to finish before terminating.