Skip to content

Latest commit

 

History

History
174 lines (113 loc) · 9.33 KB

config.md

File metadata and controls

174 lines (113 loc) · 9.33 KB

Configuration

You can configure Fireworq by providing environment variables on starting a daemon or by specifying command line arguments. Command line arguments precede the values of environment variables.

The following variables/arguments are available.

Specifies a file where API access log is written to. It defaults to standard output.

Each line in the file is a JSON string corresponds to a single log item.

Default: fireworq.access

Specifies the value of tag field in a access log item.

Default: 127.0.0.1:8080

Specifies the address and the port number of a daemon in a form address:port.

Default: 1000

Specifies an interval, in milliseconds, at which a Fireworq daemon checks if configurations (such as queue definitions or routings) are changed by other daemons.

Default: 0

Specifies the maximum amount of time of an idle (keep-alive) connection will remain idle before closing itself. If zero, an idle connections will not be closed.

Specifies whether a connection to a worker should be reused. This overrides the default keep-alive setting.

Default: 10

Specifies maximum idle connections to keep per-host. This value works only when connections of the dispatcher are reused.

Specifies the value of User-Agent header field used for an HTTP request to a worker. The default value is Fireworq/version.

Default: mysql

Specifies a driver for job queues and repositories. The available values are mysql and in-memory.

Note that in-memory driver is not for production use. It is intended to be used for just playing with Fireworq without a storage middleware or to show the upper bound of performance in a benchmark.

Specifies a file where error logs are written to. It defaults to standard error output.

If this value is specified, each line in the file is a JSON string corresponds to a single log item. Otherwise, each line of the output is a prettified log item.

Specifies a log level of the access log. The level is either a name or a numeric value. The following table describes the meaning of the value.

Value Name
0 debug
1 info
2 warn
3 error
4 fatal

If none of these values is specified, the level is determined by DEBUG environment variable. If DEBUG has a non-empty value, then the level is debug. Otherwise, the level is info.

Default: false

Specifies whether connections should be reused.

Default: tcp(localhost:3306)/fireworq

Specifies a data source name for the job queue and the repository database in a form user:password@tcp(mysql_host:mysql_port)/database?options. This is in effect only when the driver is mysql and is mandatory for that case.

Specifies a file where PID is written to.

Specifies the name of a default queue. A job whose category is not defined via the routing API will be delivered to this queue. If no default queue name is specified, pushing a job with an unknown category will fail.

If you already have a queue with the specified name in the job queue database, that one is used. Or otherwise a new queue is created automatically.

Default: 20

Specifies the default maximum number of jobs that are processed simultaneously in a queue, used when max_workers in the queue API is omitted.

Default: 200

Specifies the default interval, in milliseconds, at which Fireworq checks the arrival of new jobs, used when polling_interval in the queue API is omitted.

Specifies a file where the job queue logs are written to. It defaults to standard output. No other logs than the job queue logs are written to this file.

Each line in the file is a JSON string corresponds to a single log item.

Specifies a log level of the job queue logs. The level is either a name or a numeric value. The following table describes the meaning of the value.

Value Name
0 debug
1 info
2 warn
3 error
4 fatal

If none of these values is specified, the level is determined by DEBUG environment variable. If DEBUG has a non-empty value, then the level is debug. Otherwise, the level is info.

Default: fireworq.queue

Specifies the value of tag field in a job queue log item JSON.

Specifies a data source name for the job queue database in a form user:password@tcp(mysql_host:mysql_port)/database?options. This is in effect only when the driver is mysql and overrides the default DSN. This should be used when you want to specify a DSN differs from the repository DSN.

Specifies a data source name for the repository database in a form user:password@tcp(mysql_host:mysql_port)/database?options. This is in effect only when the driver is mysql and overrides the default DSN. This should be used when you want to specify a DSN differs from the queue DSN.

Default: 30

Specifies a timeout, in seconds, which the daemon waits on gracefully shutting down or restarting.