Skip to content

Instantly share code, notes, and snippets.

@haproxytechblog
Created July 6, 2020 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haproxytechblog/89bdb33597f7b1115ad50f8446cb7803 to your computer and use it in GitHub Desktop.
Save haproxytechblog/89bdb33597f7b1115ad50f8446cb7803 to your computer and use it in GitHub Desktop.
Get to Know the HAProxy Process Manager
$ sudo systemctl status haproxy
Main PID: 7528 (haproxy)
Tasks: 3 (limit: 1152)
CGroup: /system.slice/haproxy.service
├─7528 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock
└─7529 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock
program dataplaneapi
command /usr/local/bin/dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /usr/sbin/haproxy --config-file /etc/haproxy/haproxy.cfg --reload-cmd "systemctl reload haproxy" --reload-delay 5 --userlist haproxy-dataplaneapi
no option start-on-reload
program mirror
command spoa-mirror --runtime 0 --mirror-url http://test.local
-S /run/haproxy-master.sock
$ echo 'help' | sudo socat /run/haproxy-master.sock -
help : this message
prompt : toggle interactive mode with prompt
quit : disconnect
show cli sockets : dump list of cli sockets
show cli level : display the level of the current CLI session
operator : lower the level of the current CLI session to operator
user : lower the level of the current CLI session to user
@<relative pid> : send a command to the <relative pid> process
@!<pid> : send a command to the <pid> process
@master : send a command to the master process
show proc : show processes status
reload : reload haproxy
$ echo 'show proc' | sudo socat /run/haproxy-master.sock -
#<PID> <type> <relative PID> <reloads> <uptime> <version>
9730 master 0 0 0d00h00m19s 2.1.4-1ppa1~bionic
# workers
9732 worker 1 0 0d00h00m19s 2.1.4-1ppa1~bionic
# programs
9731 dataplaneapi - 0 0d00h00m19s -
$ echo '@1 show info' | sudo socat /run/haproxy-master.sock -
Name: HAProxy
Version: 2.1.4-1ppa1~bionic
Release_date: 2020/04/12
Nbthread: 2
Nbproc: 1
Process_num: 1
Pid: 9732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment