logo

The "Run Time API commands" descriptions

RunTime API allows us to change the settings real-time. Without downtime and restarting-reloading the HAProxy service.

For instance: we want to disable any frontend or backend server. Changes will not to be saved and the all changes will roll back at the next restarting haproxy. You can checkbox the "Save change" but there is one problem: it won’t to be saved in the config file, what can cause problems with debagging and it will confusing us.

To avoid these problems HAProxy-WI offers you the opportunity use its interface which works with the HAProxy RunTime API. It will edit runtime configuration and saves changes in the config file without downtime.

Of course here works master-slave behavior which means: if you have made changes on the master server the changes will take effect on the slave server too

RunTimeAPI commands

These commands actual for HAProxy v2

Parameter: Description:
prompt toggle interactive mode with prompt
quit disconnect
show tls-keys [id|*] show tls keys references or dump tls ticket keys when id specified
set ssl tls-key [id|keyfile] set the next TLS key for the or listener to
show sess [id] report the list of current sessions or dump this session
shutdown session kill a specific session
shutdown sessions server kill sessions on a server
clear counters clear max statistics counters (add 'all' for all counters)
show info report information about the running process
show stat report counters for each proxy and server
show schema json report schema used for stats
disable agent disable agent checks (use 'set server' instead)
disable health disable health checks (use 'set server' instead)
disable server disable a server for maintenance (use 'set server' instead)
enable agent enable agent checks (use 'set server' instead)
enable health enable health checks (use 'set server' instead)
enable server enable a disabled server (use 'set server' instead)
set maxconn server change a server's maxconn setting
set server change a server's state weight or address
get weight report a server's current weight
set weight change a server's weight (deprecated)
show resolvers [id] dumps counters from all resolvers section and
associated name servers clear table remove an entry from a table
set table [id] update or create a table entry's data
show table [id] report table usage stats or dump this table's contents
show peers [peers section] dump some information about all the peers or this peers section
disable frontend temporarily disable specific frontend
enable frontend re-enable specific frontend
set maxconn frontend change a frontend's maxconn setting
show servers state [id] dump volatile server information (for backend )
show backend list backends in the current running config
shutdown frontend stop a specific frontend
set dynamic-cookie-key backend change a backend secret key for dynamic cookies
enable dynamic-cookie backend enable dynamic cookies on a specific backend
disable dynamic-cookie backend disable dynamic cookies on a specific backend
show errors report last request and response errors for each proxy
set maxconn global change the per-process maxconn setting
set rate-limit change a rate limiting value
set severity-output [none|number|string] set presence of severity level in feedback information
set timeout change a timeout setting
show env [var] dump environment variables known to the process
show cli sockets dump list of cli sockets
show cli level display the level of the current CLI session
show fd [num] dump list of file descriptors in use
show activity show per-thread activity stats (for support/developers)
operator lower the level of the current CLI session to operator
user lower the level of the current CLI session to user
show startup-logs report logs emitted during HAProxy startup
show cache show cache status
add acl add acl entry
clear acl clear the content of this acl
del acl delete acl entry
get acl report the patterns matching a sample for an ACL
show acl [id] report available acls or dump an acl's contents
add map add map entry
clear map clear the content of this map
del map delete map entry
get map report the keys and values matching a sample for a map
set map modify map entry
show map [id] report available maps or dump a map's contents
show pools report information about the memory pools usage
show profiling show CPU profiling options
set profiling enable/disable CPU profiling
show threads show some threads debugging information
runtimeapi


Change Maxconn

Maxconn global


Dynamically change the global maxconn setting within the range defined by the initial global maxconn setting. If it is increased and connections were pending, they will immediately be accepted. If it is lowered to a value below the current number of connections, new connections acceptation will be delayed until the threshold is reached. A value of zero restores the initial setting.

Maxconn frontend


Dynamically change the specified frontend's maxconn setting. Any positive value is allowed including zero, but setting values larger than the global maxconn does not make much sense. If the limit is increased and connections were pending, they will immediately be accepted. If it is lowered to a value below the current number of connections, new connections acceptation will be delayed until the threshold is reached.




Change IP and Port


HAProxy-WI gives ability to change IP and Port for backends on-fly without reloading or restarting HAProxy service.

How it works: first step: we have to choose the server where we want to change settings. second step: choose needs backend, third step: choose certain server inside the backend (HAProxy-WI shows running settings, you have ablitity to change them), fourth step: press "Enter".

Changes will take effect not only on running configuration, but will be saved in config file too. It means that after restarting HAProxy service they will not be lost.



Manage stick-table


HTTP requests are stateless by design. However, this raises some questions regarding how to track user activities, including malicious ones, across requests so that you can collect metrics, block users, and make other decisions based on state. The only way to track user activities between one request and the next is to add a mechanism for storing events and categorizing them by client IP or other key.

Out of the box, HAProxy gives you a fast, in-memory storage called stick tables. HAProxy-WI gives you ability to manage it from GUI.