app.sql_fds_open_limit calculation issue ?

Gday Everyone,

We are trying to identify why app.sql_fds_open_limit getting Very High. We first read about this How is the value of app.sql_fds_open_limit calculated? but this is not the case here.

Going further within TOP - Process

Meanwhile on the backend:

root@host:/# cat /proc/3736363/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             256951               256951               processes 
Max open files            1024                 1048576              files     
Max locked memory         8425074688           8425074688           bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       256951               256951               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        

Within PGSQL

postgres@[local]/host=# show max_files_per_process ;

 max_files_per_process  
-----------------------

 1000

(1 row)
root@host:/var/lib/pgsql# lsof  | awk '{print $1}' | sort | uniq -c | sort -n | tail -10
    144 sudo
    154 NETWORK-V
    159 vmtoolsd
    176 sd-jrnl.p
    210 ebpf.plug
    215 systemd
    323 go.d.plug
    575 sshd
   2691 postgres
  37820 netdata
root@host:/var/lib/pgsql# lsof | wc -l
44551
root@host:/var/lib/pgsql# systemctl stop netdata
root@host:/var/lib/pgsql# lsof | wc -l
5566
root@host:/var/lib/pgsql# su - postgres
postgres@host:~$ pg_ctl -D data stop
waiting for server to shut down....... done
server stopped
postgres@host:~$  
logout
root@host:/var/lib/pgsql# lsof | wc -l
3010
root@host:/var/lib/pgsql# lsof | wc -l
3010
root@host:/var/lib/pgsql# su - postgres
postgres@host:~$ pg_ctl -D data start
waiting for server to start.... [3736352] 66e15ef0.390320 2024-09-11 12:12:16.844 EEST  @ line:1 LOG:  pgaudit extension initialized
 [3736352] 66e15ef0.390320 2024-09-11 12:12:17.050 EEST  @ line:2 LOG:  redirecting log output to logging collector process
 [3736352] 66e15ef0.390320 2024-09-11 12:12:17.050 EEST  @ line:3 HINT:  Future log output will appear in directory "log".
 done
server started
postgres@host:~$  
logout
root@host:/var/lib/pgsql# lsof | wc -l
4466
root@host:/var/lib/pgsql# systemctl start netdata
root@host:/var/lib/pgsql# lsof | wc -l
43763
root@host:/var/lib/pgsql# 

Do I need to adjust ulimits or anything else within Netdata?

Thank you

but this is not the case here.

Hey, what do you mean by that? You are showing that 3736363 limit is 1024 and 984 are used (96%). What makes you thinking that calculation is wrong?

I don’t know how the calculation is working exactly, that’s why I am posting it. Is this related to /etc/security/limits.conf ? Or anything else?

It is described here.

  • Limit is the first value of the Max open files line in cat /proc/PID/limits.
  • Percent: divide the NumberOfOpenFDs by the Limit and multiply by 100 (984.0 / 1024 * 100 = 96).
1 Like