JaxerManager Command Line Interface (CLI) Reference

Introduction

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). A few settings can also be specified through environment variables.

Precedence

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

  • The defaults hard-coded in the binary;
  • The default config file (if it exists);
  • Environment settings (if applicable);
  • Command line arguments;
  • A config file specified on the command line (if any).

Defaults:

webport
4327
commandport
4328
Default (optional) config file
JaxerManager.cfg (Windows) or jaxermanager.cfg (Linux/Mac) in the same folder as the JaxerManager executable.

Commands

set timeout [n]
Set the timeout of JaxerManager so it will die if a ping is not received within [n] seconds. This is used by applications like Studio that start up and manage the lifecycle of their own JaxerManager process: if they exit unexpectedly, the JaxerManager they started can be set to exit too, once it detects the missing ping.
set minprocesses [n]
From this point on, there will be no less than [n] Jaxer processes. If set to higher than maxprocesses, then maxprocesses is set to the same value.
set maxprocesses [n]
JaxerManager will not start more Jaxer processes if there are already [n] or more of them around. If set to lower than the current minprocesses, then minprocesses is set to the same value.
set requesttimeout [n]
A Jaxer that takes more than [n] seconds to process a web request is terminated (default 10).
set maxmemory [n]
A hard limit of[n] megabytes is imposed on all Jaxer processes. A value of zero means no limit (default 150). Can be specified as environment variable JAXER_MAXMEMORY.
set maxrequests [n]
A Jaxer is terminated after it performs [n] requests. A value of zero is equivalent to infinity (default 0).
set trace
Turns on/off the Jaxer Manager network-related trace (default off).
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. The result is followed by "\r\n".
get all
Returns all parameters and their values in the form of param=value separated by, and followed at the end by, "\r\n".
setconfig [property] [value]
Sets the specified property on Jaxer.Config to the specified value. Note that [property] may be of the form "prop1.subprop1.subsubprop1", etc. For example: setconfig DB_CONNECTION_PARAMS.PATH "resource:///../data/appdata.sqlite"

Additionally, a few commands are effective only in the configuration file that is read when JaxerManager starts up:

set webport [n]
Set the port used by web servers (default 4327).
set commandport [n]
Set the port for the command line interface (default 4328).

There is no command to close the "telnet" command session with JaxerManager over the command port; simply close the connection.

You can specify the following arguments when starting JaxerManager:

--commandport=[port]
See "set commandport" above.
--webport=[port]
See "set webport" above.
--minprocesses=[num processes]
See "set minprocesses" above.
--maxprocesses=[num processes]
See "set maxprocesses" above.
--trace=[on | off]
See "set trace" above.
--configfile=[config file]
Set the configuration file to initially load (default JaxerManager.cfg).
--timeout=[num seconds]
See "set timeout" above.
--requesttimeout=[num seconds]
See "set requesttimeout" above.
--maxmemory=[num MB]
See "set maxmemory" above.
--maxrequests=[num requests]
See "set maxrequests" above.
--pid-file=[file]
Write the process id of the JaxerManager process to the specified file.
--cfg:[name]=[value]
set configuration parameter name to value.

Specify the following arguments only when starting JaxerManager:

--jaxerlogfileuri=[fileuri]
Set the logfile for Jaxers, e.g. file:///c:/temp/jaxer.log. Can also be specified as environment variable JAXER_LOGFILE.
--jaxerlogfilesize=[num bytes]
Specify the maximum size of the logfile. If the logfile size exceeds this limit, the logfile will be moved to a backup when JaxerManager starts.
--jaxerlogfilebackups=[num]
Set the number of logfile backups to keep.
--tempdir=[fileuri]
Set the temp folder for Jaxer.

Sample Session

Here is an example session that results when JaxerManager is running and you type telnet localhost 4328 in a shell window (DOS, in this case). You can tell apart the input lines from the output lines because the former always start with a verb.

JaxerManager 0.9.0.1904

get version
*** 0.9.0.1904
get all
version=0.9.0.1904
commandport=4328
jaxerlogfilebackups=10
jaxerlogfilesize=500000
jaxerlogfileuri=file://C:/Documents and Settings/sarid/My Documents/Aptana Jaxer/logs/jaxer.log
maxmemory=150
maxprocesses=10
maxrequests=0
minprocesses=3
requesttimeout=60000
tempdir=file://C:\Documents and Settings\sarid\My Documents\Aptana Jaxer\temp
timeout=0
trace=off
webport=4327
set maxprocesses 8
*** ok
ping
*** pong running
get maxprocesses
8
get foobar
*** bad option
exit


Connection to host lost.

C:\Documents and Settings\sarid>