What did you do?
start service via systemd
What did you expect to see?
nothing
What did you see instead? Under which circumstances?
after sometime system reports too many files openedEnvironment
Accept error: accept tcp [::]:9187: accept4: too many open files; retrying
Oct 27 09:59:38 postgres_exporter[2023066]: panic: runtime error: invalid memory address or nil pointer dereference
Oct 27 09:59:38 postgres_exporter[2023066]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4d6b27]
Oct 27 09:59:38 postgres_exporter[2023066]: goroutine 729574 [running]:
Oct 27 09:59:38 postgres_exporter[2023066]: database/sql.(*DB).Close(0x0, 0x928d80, 0xc4200d0220)
Oct 27 09:59:38 postgres_exporter[2023066]: #011/home/travis/.gimme/versions/go1.10.linux.amd64/src/database/sql/sql.go:720 +0x37
Oct 27 09:59:38 postgres_exporter[2023066]: main.(*Exporter).getDB(0xc4201d8100, 0xc420028011, 0x57, 0xc146f8501e28e979, 0x124d3759cd51a, 0xb940c0)
Oct 27 09:59:38 postgres_exporter[2023066]: #011/home/travis/gopath/src/github.com/wrouesnel/postgres_exporter/cmd/postgres_exporter/postgres_exporter.go:1040 +0x18a
Oct 27 09:59:38 postgres_exporter[2023066]: main.(*Exporter).scrape(0xc4201d8100, 0xc429a7f800)
Oct 27 09:59:38 postgres_exporter[2023066]: #011/home/travis/gopath/src/github.com/wrouesnel/postgres_exporter/cmd/postgres_exporter/postgres_exporter.go:1058 +0xde
Oct 27 09:59:38 postgres_exporter[2023066]: main.(*Exporter).Collect(0xc4201d8100, 0xc429a7f800)
Oct 27 09:59:38 postgres_exporter[2023066]: #011/home/travis/gopath/src/github.com/wrouesnel/postgres_exporter/cmd/postgres_exporter/postgres_exporter.go:785 +0x3c
Oct 27 09:59:38 postgres_exporter[2023066]: github.com/wrouesnel/postgres_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func2(0xc42816d3f0, 0xc429a7f800, 0x92b760, 0xc4201d8100)
Oct 27 09:59:38 postgres_exporter[2023066]: #011/home/travis/gopath/src/github.com/wrouesnel/postgres_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:383 +0x61
Oct 27 09:59:38 postgres_exporter[2023066]: created by github.com/wrouesnel/postgres_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*Registry).Gather
Oct 27 09:59:38 postgres_exporter[2023066]: #011/home/travis/gopath/src/github.com/wrouesnel/postgres_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:381 +0x302
Oct 27 09:59:38 systemd[1]: prometheus-postgres-exporter.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 27 09:59:38 systemd[1]: prometheus-postgres-exporter.service: Failed with result 'exit-code'.
User limits
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 514704
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 65535
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
postgress exporter limits
cat /proc/2262062/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 514704 514704 processes
Max open files 100 100 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 514704 514704 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Please help understand the issue and possible fix.
Thanks
What did you do? start service via systemd What did you expect to see? nothing What did you see instead? Under which circumstances? after sometime system reports
too many files opened
EnvironmentSystem information:
Linux 5.15.0-57-generic x86_64
postgres_exporter version:
postgres_exporter v0.4.7 (built with go1.10)
postgres_exporter flags:
PostgreSQL version:
PostgreSQL 13.
Logs:
ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 514704 max locked memory (kbytes, -l) 65536 max memory size (kbytes, -m) unlimited open files (-n) 65535 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 65535 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
cat /proc/2262062/limits Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 514704 514704 processes Max open files 100 100 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 514704 514704 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us