Appendix F. 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.

Custom request handlers

agent.request-handler.*

Optional. One or more entries for custom remote control handlers. The * should be replaced with the name of the protocol and the value should be the name of a class implementing the CustomRequestHandler interface. Requests can then be sent to the agent's remote control port on the form: foo://custom-data.....

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. A slot manager is used to assign jobs to a pre-configured number of slots.

agent.slotmanager.class

The name of the Java class that handles slot assignment to jobs. The standard job agent ships with three different implementations:

  • net.sf.basedb.clients.jobagent.slotmanager.InternalSlotManager : This is the default slot manager. 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. See the table below for default settings.

  • net.sf.basedb.clients.jobagent.slotmanager.MasterSlotManager : This is an extension to the internal slot manager that also accepts requests for slot assignments from other job agents. The other job agent(s) should be using the RemoteSlotManager. This makes it possible for a number of job agents to share a common pool of slots to avoid bottlenecks, for example, at the database level.

  • net.sf.basedb.clients.jobagent.slotmanager.RemoteSlotManager : The remote slot manager connects with another job agent (running with a MasterSlotManager) and asks it for a slot. When this slot manager is used you need to specify the ip-address/name and port of the job agent running the master slot manager.

It is possible to create your own implementation of a slot manager. Create a class that implements the net.sf.basedb.clients.jobagent.slotmanager.SlotManager interface.

agent.slotmanager.remote.server

The ip-adress or name of a job agent running as the master slot manager. This setting is needed by the RemoteSlotManager.

agent.slotmanager.remote.port

The remote control port number of the job agent running as the master slot manager. Make sure that the master job agent is accepting connection from this job agent. This setting is needed by the RemoteSlotManager.

This table lists slot settings for the internal and master slot managers. The remote slot manager will get slots from another job agent. 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. The priorities are not handled by the slot managers, but by the job agent core and apply to all job agents, no matter which slot manager that is selected.

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