public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Mark Schouten <mark@tuxis.nl>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] Too many open files
Date: Thu, 8 Sep 2022 09:08:50 +0200	[thread overview]
Message-ID: <87a756b4-ef3a-47c4-2219-df252b7cce9d@proxmox.com> (raw)
In-Reply-To: <emb468a227-f50d-49a8-92f2-1c3a0e7fa058@3a15c2fd.com>

Hi,

Am 07/09/2022 um 14:02 schrieb Mark Schouten:
> On our shared PBS-server, on busy moments, we get the following error:
> Sep  7 00:00:35 pbs001 proxmox-backup-proxy[9288]: error accepting tcp connection: Too many open files (os error 24)
> 

How many FDs are open for the proxy?

ls -1 /proc/$(pidof proxmox-backup-proxy)/fd | wc -l

> This is a box with quite a lot of datastores, but looking at the open files setting:
> root@pbs001:/var/log# cat /proc/sys/fs/file-max
> 9223372036854775807

This is not the relevant limit though, this is the upper limit of the
kernel for file handles
https://sysctl-explorer.net/fs/filemax%20&%20filenr/

The per-process file (hard) limit would be:
https://sysctl-explorer.net/fs/nr_open/

And as that mentions, that again depends on the rlimit, check the default (soft)
imits with

- as root:
  ulimit -a

- for the backup user
  su - backup -s /bin/bash -c "ulimit -n $[1024*1024]"


Or probably even easier, check the /proc entry of the proxy and api daemons:

cat /proc/$(pidof proxmox-backup-proxy)/limits
cat /proc/$(pidof proxmox-backup-api)/limits

> 
> That should be enough. 😄
> 
> Does PBS itself limit the open files somewhere?

No, but it doesn't increase it's soft limit to the hard limit, something we
want to do in the future.

As workaround try increasing soft (and possible hard) limit for root and backup
user, you can do that by editing `/etc/security/limits.conf`, adding lines like:

backup soft nofile 524288
root soft nofile 524288

(should set soft to current hard limit)

Or alternatively use a systemd service override to make it really process specific:

# systemctl edit proxmox-backup-proxy.service

There add a "[Service]" Section, if not already existing and a "LimitNOFILE=X" below,
e.g.:
 
[Service]
LimitNOFILE=524288

Save and close the editor and restart the service, then do the same for the
proxmox-backup.service

As said, we plan to upper that soft limit too in the future.

cheers,
Thomas




  reply	other threads:[~2022-09-08  7:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07 12:02 Mark Schouten
2022-09-08  7:08 ` Thomas Lamprecht [this message]
2022-09-09  8:31   ` Mark Schouten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a756b4-ef3a-47c4-2219-df252b7cce9d@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=mark@tuxis.nl \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal