Appendix G. jobagent.properties reference

The jobagent.properties file is the main configuration file for job agents. It is located in the <basedir>/www/WEB-INF/classes directory.

BASE settings

This section describes the configuration parameters that are used by the job agent to get access to the BASE server.

agent.user

Required. The BASE user account used by the job agent to log on to the BASE server. The user account must have sufficient privileges to access jobs and job agents. The Job agent role is a predefined role with all permissions a job agent needs. There is also a predefined user account with the user name jobagent. This account is disabled by default and has to be enabled and given a password before it can be used.

agent.password

Required. The password for the job agent user account.

agent.id

Required. A unique ID that identifies this job agent among other job agents. If multiple job agents are installed each job agent should have it's own unique ID.

agent.name

Optional. The name of the job agent. If not specified the ID is used. The name is only used when registering the job agent with the BASE server.

agent.description

Optional. A description of the job agent. This is only used when registering the job agent.

Job agent server settings

This section describes the configuration parameters that affect the job agent server itself.

agent.port

Optional. The port the job agent listens to for control requests. Control requests are used for starting, stopping, pausing and getting status information from the job agent. It is also used by the jobagent.sh script to control the local job agent. The default value is 47822.

agent.remotecontrol

Optional. A comma-separated list of IP addresses or names of computers that are allowed to send control requests to the job agent. If no value is specified, only the local host is allowed to connect. It is recommended that the web server is added to the list if the job agent is not running on the same server as the web server.

agent.allowremote.stop

Optional. If the stop command should be accepted from remote hosts specified in the agent.remotecontrol setting. If false, which is the default value, only the local host is allowed to stop the job agent.

[Note] Note

Once the job agent has been stopped it cannot be started by remote control. You must use the jobagent.sh script for this.

agent.allowremote.pause

Optional. If the pause command should be accepted from remote hosts specified in the agent.remotecontrol setting. If false, only the local host is allowed to pause the job agent. The default value is true.

agent.allowremote.start

Optional, valid only when job agent is paused. If the start command should be accepted from remote hosts specified in the agent.remotecontrol setting. If false, only the local host is allowed to start the job agent when it is paused. The default value is true.

Job execution settings

This section describes the configuration parameters that affect the execution of jobs.

agent.executor.class

The name of the Java class that handles the actual execution of jobs. The default implementation for a job agent ships three implementations:

  • net.sf.basedb.clients.jobagent.executors.ProcessJobExecutor : Executes the job in an external process. This is the recommended executor and is the default choice if no value has been specified. With this executor, a misbehaving plugin does not affect the job agent or other jobs. The drawback is that since a new virtual machine has to be started, more memory is required and the start up time can be long.

  • net.sf.basedb.clients.jobagent.executors.ThreadJobExecutor : Executes the job in a separate thread. This is only recommended for plugins that are trusted and safe. A misbehaving plugin can affect the job agent and other jobs, but the start up time is short and less memory is used.

  • net.sf.basedb.clients.jobagent.executors.DummyJobExecutor: Does not execute the job. It only marks the job as being executed, and after waiting some time, as finished successfully. Use it for debugging the job agent.

It is possible to create your own implementation of a job executor. Create a class that implements the net.sf.basedb.clients.jobagent.JobExecutor interface.

agent.executor.process.java

Optional. The path to the Java executable used by the ProcessJobExecutor . If not specified the JAVA_HOME environment variable will be checked. As a last resort java is used without path information to let the operating system find the default installation.

agent.executor.process.options

Optional. Additional command line options to the Java executable. Do not add memory options (-Mx or -Ms), it will be added automatically by the executor. This setting is used by the ProcessJobExecutor only.

agent.executor.dummy.wait

Optional. Number of seconds the DummyJobExecutor should wait before returning from the "job execution". The executor first sets the progress to 50% then waits the specified number of seconds before setting the job to completed. If no value is specified it returns immediately.

agent.checkinterval

Optional. Number of seconds between querying the database for jobs that are waiting for execution. The default value is 30 seconds.

Slots and priorities

The job agent does not execute an arbitrary number of jobs simultaneously. This would sooner or later break the server. Instead, it uses a simple system with four different slots. Each slot is reserved for jobs that are estimated to be finished in a certain amount of time. The exception is that a quick job may use a slot with longer expected time since that will not block the slot very long.

A thread priority is associated with each slot. The priority is a value between 1 and 10 as defined by the java.lang.Thread class.

Property Default value Estimated execution time
agent.shortest.slots 1 < 1 minute
agent.shortest.priority 4
agent.short.slots 1 < 10 minutes
agent.short.priority 4
agent.medium.slots 2 < 1 hour
agent.medium.priority 3
agent.long.slots 2 > 1 hour
agent.long.priority 3