You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What should haproxy do differently? Which functionality do you think we should add?
Right now, HAProxy's built-in Prometheus exporter has a metric called haproxy_process_max_fds which reports the (calculated) ulimit -n FD soft limit for the worker process.
I think it would be nice to complement this with something that most Prometheus exporters do which is also report the current number of open/in-use file descriptors; something like haproxy_process_current_fds or haproxy_process_open_fds. From what I can gather, this is a relatively standard practice for built-in exporters - that is, to report its own FD usage.
I've done this manually by creating a gauge on my collector process and populating it with the Go equivalent of echo "show fd" | socat - /var/run/haproxy.sock | wc -l, and it works well. I suppose it would be similar to ls -l /proc/$haproxy_worker_pid/fd/ | wc -l.
As a comparison point, prometheus/client_golang more-or-less does the latter, on its own PID. I couldn't use the proc fs method because the collector process isn't running as root, so it's not allowed to read HAProxy's proc fs. It reports both process_max_fds and process_open_fds.
What are you trying to do?
Basically just trying to track HAProxy's FD usage, in particular as a ratio of its max FDs (ulimit-n) that are available.
Output of haproxy -vv and uname -a
HA-Proxy version 2.2.6-1ppa1~focal 2020/12/01 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2 2025.
Known bugs: http://www.haproxy.org/bugs/bugs-2.2.6.html
Running on: Linux 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64
Build options :
TARGET = linux-glibc
CPU = generic
CC = gcc
CFLAGS = -O2 -g -O2 -fdebug-prefix-map=/build/haproxy-I3GHZu/haproxy-2.2.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wdeclaration-after-statement -fwrapv -Wno-address-of-packed-member -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Wno-missing-field-initializers -Wno-stringop-overflow -Wno-cast-function-type -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference
OPTIONS = USE_PCRE2=1 USE_PCRE2_JIT=1 USE_OPENSSL=1 USE_LUA=1 USE_ZLIB=1 USE_SYSTEMD=1
DEBUG =
Feature list : +EPOLL -KQUEUE +NETFILTER -PCRE -PCRE_JIT +PCRE2 +PCRE2_JIT +POLL -PRIVATE_CACHE +THREAD -PTHREAD_PSHARED +BACKTRACE -STATIC_PCRE -STATIC_PCRE2 +TPROXY +LINUX_TPROXY +LINUX_SPLICE +LIBCRYPT +CRYPT_H +GETADDRINFO +OPENSSL +LUA +FUTEX +ACCEPT4 -CLOSEFROM +ZLIB -SLZ +CPU_AFFINITY +TFO +NS +DL +RT -DEVICEATLAS -51DEGREES -WURFL +SYSTEMD -OBSOLETE_LINKER +PRCTL +THREAD_DUMP -EVPORTS
Default settings :
bufsize = 16384, maxrewrite = 1024, maxpollevents = 200
Built with multi-threading support (MAX_THREADS=64, default=2).
Built with OpenSSL version : OpenSSL 1.1.1f 31 Mar 2020
Running on OpenSSL version : OpenSSL 1.1.1f 31 Mar 2020
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2 TLSv1.3
Built with Lua version : Lua 5.3.3
Built with network namespace support.
Built with zlib version : 1.2.11
Running on zlib version : 1.2.11
Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND
Built with PCRE2 version : 10.34 2019-11-21
PCRE2 library supports JIT : yes
Encrypted password support via crypt(3): yes
Built with gcc compiler version 9.3.0
Built with the Prometheus exporter as a service
Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.
Available multiplexer protocols :
(protocols marked as <default> cannot be specified using 'proto' keyword)
fcgi : mode=HTTP side=BE mux=FCGI
<default> : mode=HTTP side=FE|BE mux=H1
h2 : mode=HTTP side=FE|BE mux=H2
<default> : mode=TCP side=FE|BE mux=PASS
Available services :
prometheus-exporter
Available filters :
[SPOE] spoe
[COMP] compression
[TRACE] trace
[CACHE] cache
[FCGI] fcgi-app
Linux a7ddd657-0a50-4217-aa71-3aaf0781799d 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
What should haproxy do differently? Which functionality do you think we should add?
Right now, HAProxy's built-in Prometheus exporter has a metric called
haproxy_process_max_fds
which reports the (calculated)ulimit -n
FD soft limit for the worker process.I think it would be nice to complement this with something that most Prometheus exporters do which is also report the current number of open/in-use file descriptors; something like
haproxy_process_current_fds
orhaproxy_process_open_fds
. From what I can gather, this is a relatively standard practice for built-in exporters - that is, to report its own FD usage.I've done this manually by creating a gauge on my collector process and populating it with the Go equivalent of
echo "show fd" | socat - /var/run/haproxy.sock | wc -l
, and it works well. I suppose it would be similar tols -l /proc/$haproxy_worker_pid/fd/ | wc -l
.As a comparison point,
prometheus/client_golang
more-or-less does the latter, on its own PID. I couldn't use the proc fs method because the collector process isn't running as root, so it's not allowed to read HAProxy's proc fs. It reports bothprocess_max_fds
andprocess_open_fds
.What are you trying to do?
Basically just trying to track HAProxy's FD usage, in particular as a ratio of its max FDs (
ulimit-n
) that are available.Output of
haproxy -vv
anduname -a
The text was updated successfully, but these errors were encountered: