Configuration values explained

pp3345 edited this page Apr 1, 2013 · 5 revisions

On this page you will find explanations and recommendations for all configuration-values in the "main"-path.

tmpPath

Default value: ../tmp/

Pancake will store temporary data in this path, for example gzipped versions of requested files or internal UNIX sockets. It is recommended to either leave the default value or set it to /tmp/.

logging

system

Default value: ../log/system.log

The path to the log for system messages.

request

Default value: ../log/requests.log

The path to the log for requests. A small line containing the clients IP address, the requests first line, the vHost used for this request, the Host header, the Referer header, the User-Agent header and the answer code is stored for each request.

error

Default value: ../log/error.log

The path to the error log. Every error that occurs in Pancake (not the PHP-SAPI!) is stored in this file.


dateFormat

Default value: 'd.m.y H:i:s'

The format used to show date- and time-values in Pancake. See date() for information on the possible formatting characters.

debugMode

Default value: false

Enable debugging. This value can also be set for a single run by starting Pancake with --debug. When debugging is enabled, Pancake will do some more output and will recognize two special GET-parameters:

  • ?pancakedebug If this parameter is given on a request, Pancake will dump all headers and the internal Pancake\HTTPRequest object instead of displaying the normal page contents.
  • ?pancakephpdebug With this parameter (only supported with PHP-requests) it is possible to get a dump of the internal Pancake\HTTPRequest object after the PHP request was completely processed, a list of constants, classes, functions, traits and interfaces defined while executing the request, a list of included files and the normal page contents. This can be very useful to get a list of files that could be loaded into the CodeCache as it displays all files that were included by the requested script.

user

Default value: www-data

Specifies the *NIX user under which the Pancake worker threads (not the master!) will be executed.

group

Default value: www-data

Specifies the *NIX group under which the Pancake worker threads (not the master!) will be executed.

listenPorts

Default value: - 80

A list of TCP-ports on which Pancake will listen. For HTTP, 80 is the default port. Some configurations also use 8080 as an alternative port. Basically you can specify any port that is not already used by another program.

IPv4

Default value: - 0

A list of IPv4 addresses on which Pancake will listen. If 0 is specified, it will listen on all available interfaces. For example, if you want that Pancake only listens on the local interface, set this to 127.0.0.1.

IPv6

Default value: - ::0

A list of IPv6 addresses on which Pancake will listen. If ::0 is specified, it will listen on all available interfaces (including IPv4 interfaces).Pancake won't try to listen on other IPv6 or IPv4 interfaces, even when more interfaces are specified. For example, if you want that Pancake only listens on the local loopback interface, set this to ::1.

requestWorkers

Default value: 2

The amount of RequestWorkers that Pancake will run. The RequestWorkers in Pancake are capable of handling many 1000 concurrent requests without using up lots of RAM.

exposePancake

Default value: true

If this value is set to true, Pancake will send a "Server" header in every answer, containing 'Pancake' and the version as a value. It will also output the same information at the end of directory listings and error messages. If you like Pancake and want it to have success, leave it set to true. ;)

sizePrefix

Default value: bin

Possible values are bin or si. Depending on this setting, Pancake decides whether information about data sizes should be measured in binary units (1 Kibibyte (KiB) = 1024 Byte) or SI units (1 Kilobyte (kB) = 1000 Byte).

allowHEAD

Default value: true

If set to false, Pancake won't allow the "HEAD" request method anymore and return a 405 Method Not Allowed error.

allowTRACE

Default value: false

If set to false, Pancake won't allow the "TRACE" request method anymore and return a 405 Method Not Allowed error.

allowOPTIONS

Default value: false

If set to false, Pancake won't allow the "OPTIONS" request method anymore and return a 405 Method Not Allowed error.

requestWorkerLimit

Default value: 250000

When a RequestWorker has finished this number of requests, it will be automatically restarted as soon as possible (e. g. when no other requests are pending anymore). If set to 0, the RequestWorkers will never restart.

maxConcurrent

Default value: 0

The maximum amount of client sockets a single RequestWorker may keep open. If this limit was reached, the worker won't allow new connections anymore until at least one request was completely processed. It is recommended to leave this value set to 0, as this will completely disable the limit and therefore it is impossible to kill the worker by just opening a lot of concurrent connections. Please note that Pancake has an internal limit of 262144 sockets per read/write array.

workerBootTime

Default value: 5

The maximum time each worker in Pancake gets to completely start, in seconds. Increase this if you have CodeCache files that take extremely long to load. Pancake will abort startup if this limit is exceeded.

writeBufferMin

Default value: 10240

The minimum size in bytes that keeps stored in RAM for write buffers. If the size of a write buffer becomes smaller than this limit and writeBufferHardMaxConcurrent is not reached, Pancake will reallocate up to writeLimit bytes for the buffer.

writeBufferSoftMaxConcurrent

Default value: 50

If this amount of concurrently existing write buffers (per RequestWorker) has been reached, the worker will not allocate more than writeBufferMin bytes for each write buffer anymore in order to limit RAM usage.

writeBufferHardMaxConcurrent

Default value: 2000

If this amount of concurrently existing write buffers (per RequestWorker) was reached, the worker will not allocate any write buffers anymore at all, so that all data that should be sent to the client is read from the hard disk in the moment of sending. This decreases download speed and performance but is necessary to keep RAM usage as low as possible.

waitPHPWorkerBoot

Default value: true

If set to false, Pancake won't wait for PHPWorkers on startup anymore. This value should usually always be true, except in shared hosting environments as it can't be made sure that the owner of a vHost does not try to harm Pancake by killing the worker on CodeCache load.

waitSlotTime

Default value: 5000

If no worker is available to serve a request on a PHP file, Pancake will give the request a "wait slot". Pancake will then search for an available PHPWorker every waitSlotTime microseconds (1000 µs = 1 ms). It is recommended to keep wait slots disabled by setting waitSlotWaitLimit to 0 since this feature is unnecessary in most environments.

waitSlotWaitLimit

Default value: 0

This setting specifies the maximum amount of tries Pancake runs for every request to find an available PHPWorker. If this limit was reached, Pancake will give the client a 500 Internal Server Error saying that there was no worker available. It is recommended to disable wait slots by leaving this setting at 0.

socketBacklog

Default value: 200

The backlog for sockets. If all workers are busy, this amount of connection tries keeps "on hold" until a worker has time to accept the connection. If there are more clients trying to connect, they'll get an error.

writeLimit

Default value: 1048576

This is the maximum size for all disk buffers stored in RAM. Since Pancake 1.4 this setting has been moved to the main configuration section. Before Pancake 1.4 it was set for every vHost.

naglesAlgorithm

Default value: false

This enables or disables Nagle's algorithm. Only change if you know what you're doing.

preBuffer

Default value: 65536

When set, Pancake will buffer static files into RAM before sending HTTP headers. This can improve performance but will also cause higher RAM usage. The value determines the amount of bytes buffered.