JaxerManager Command Line Interface (CLI)

The Jaxer process itself is effectively single-threaded, so a pool of Jaxer processes is used to handle multiple simultaneous requests. JaxerManager is the application that manages the lifecycle of these Jaxer processes, starting them up when it starts and spinning up new ones as the load increases, tearing them down when the load decreases or JaxerManager exits (or when a Jaxer is "misbehaving"), connecting them to the web server to handle requests, and configuring them. When you start up Jaxer, you're really starting up JaxerManager: check your list of processes for a single JaxerManager.exe (or jaxermanager on Mac OS X and Linux) and multiple Jaxer.exe (or jaxer) processes.

JaxerManager listens on one port, its "web port", for requests from the web server, and routes them to Jaxers in its pool. It also listens on a different port, its "command port", for commands. These commands can also usually be specified on the command line when JaxerManager is started, or in a config file loaded when JaxerManager starts (or restarts/reloads).

Precedence

When JaxerManager starts, it processes the commands/settings in the following order (last setting wins):

  1. Defaults hardcoded in the binary
  2. Default config file
  3. Config file specified on the command line
  4. Command line arguments

Jaxer Commands and Settings

Commands and settings can be communicated to JaxerManager in three ways, each with its own format:

  • arguments on the command line, as --<command>=<value>
  • configuration file, one command per line as <command> <value>
  • command port, only after the manager is running using the tellJaxerManager utility as tellJaxerManager -p <port_number> set <command> <value>

The following table lists all the commands, settings and parameters that JaxerManager understands, and if it can be specified in each of the three manners.

To see the settings your manager supports, except for those only applicable to the CLI, execute
JaxerManager --help at an OS command prompt.

On Windows, JaxerManager can also be run as a service (see details with JaxerManager --help)

Note: The default value is the hardcoded in the manager binary.

Command/SettingValueDefaultArgumentsConfig FileCLI
configfilefile_pathNoneyesnono
Specify a config file on the cmdline that will be loaded during startup.
webportport4327yesyesno
 
commandportport4328yesyesno
 
minprocessesinteger1yesyesyes
Minimum number of Jaxer processes. If set to higher than maxprocesses, then maxprocesses is set to the same value.
maxprocessesinteger10yesyesyes
JaxerManager will not start more Jaxer processes if there are already <number> or more running; if lower than the value of minprocesses, then minprocesses is set to the same value.
roundrobinjaxerson | offonyesyesyes
Determines if requests will be roundrobined to all idle Jaxers.
startjaxertimeoutinteger>=30yesyesyes
JaxerManager will exit if it fails to maintain the minprocesses Jaxers for a consecutive of <number> seconds. This is mainly to prevent JaxerManager on trying to start Jaxers on a platform it repeatdly fails. A zero value turns this off.
jaxeridletimeoutinteger>=10yesyesyes
Determines when an idle Jaxer process will be killed.
pingtimeoutinteger0yesyesyes
Set the timeout of Jaxer Manager that will die if a ping is not received within <number> seconds.
maxmemoryinteger150yesyesyes
A hard limit of <number> megabytes of aggregate RAM used is imposed on all Jaxer processes; zero means no limit. The setting affects only newly created Jaxer processes, except on Mac where it affects all processes.
maxrequestsinteger0yesyesyes
A Jaxer is terminated after it performs <number> requests. A value of zero is equivalent to infinity.
requesttimeoutinteger20yesyesyes
A Jaxer that takes more than <number> seconds to process a request is terminated. A value of zero is equivalent to infinity.
loglevelFATAL |
ERROR |
WARN |
INFO |
DEBUG |
TRACE
INFOyesyesyes
Specifies the log level for jaxerManager (not Jaxer).
log:outputabsolute_pathframework/ JaxerCoreJSConsole.logyesyesno
Specifies the logfile or a pipe to a process. To specify a process, the first character must be '|', and you are responsible for starting that process.
log:filesizeinteger512000yesyesno
Logfile size in bytes
log:numbackupsinteger10yesyesno
Number of logfile backups to keep.
pref:<pref_name>pref_valuenoneyesyesyes
Preference setting that will be passed to Jaxer.
cfg:<name>cfg_valuenoneyesyesno
config settings that will be passed to Jaxer when it starts up.

Commands that can only be issued after JaxerManager has started

Sent in the form of tellJaxerManager -p portNumber <cmd> or tellJaxerManager -p portNumber <cmd> <val>.

  • exit: Immediate, non-graceful termination of all Jaxers and then of JaxerManager.
  • stop: Graceful termination of all Jaxers once they've finished processing, then when they're all dead stop JaxerManager too.
  • pause: Suspend processing of requests
  • resume: Resume processing of requests
  • ping: Test for JaxerManager responsiveness, returns "pong" followed by one of: paused|running|stopping|reloading
  • reload: Graceful termination of all Jaxers, followed by loading a named config file (optional, otherwise configuration is unchanged) and restarting of all Jaxer processes.
  • restart: Immediate, non-graceful termination of all Jaxers, followed by loading a named config file (optional, otherwise configuration is unchanged) and restarting of all Jaxer processes
  • get version: Returns the version string
  • get [param]: Returns the value for the specified parameter. If [param] is not a recognized parameter, then "*** bad option" is returned, followed by "\r\n".
  • get all: Returns all parameters and their values in the form of param=value separated by a comma and followed at the end by, "\r\n".
  • setconfig [property] [value]: Sets the specified property on Jaxer.Config to the passed value. Note that [property] may be of the form prop1.subprop1.subsubprop1, example: setconfig DB_CONNECTION_PARAMS.PATH "resource:///../data/appdata.sqlite"

Actions against JaxerManager in a command shell

You can tell apart the input lines from the output lines because the former always start with tellJaxerManager.
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager -p 4328 get version
*** 1.0.0.3989_RC_C
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager get all
version=1.0.0.3989_RC_C
commandport=4328
jaxeridletimeout=10
loglevel=INFO
maxmemory=150
maxprocesses=10
maxrequests=1000
minprocesses=1
pingtimeout=0
requesttimeout=0
roundrobinjaxers=on
startjaxertimeout=30
timeout=0
webport=4327
log:filesize=500000
log:numbackups=10
log:output=D:\ajam\Aptana Jaxer\\logs\jaxer.log
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager set maxprocesses 5
*** ok
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager ping
*** pong running
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager maxprocesses
*** Unknown command
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager get maxprocesses
5
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager get foobar
*** bad option
 
D:\ajam\Aptana Jaxer\jaxer>tellJaxerManager stop
*** ok