Score:0

Can't change file descriptor max limit in Ubuntu 20.04 (LTS) x64

in flag

Trying to increase system wide file descriptor count on Ubuntu 20.04 (LTS) x64, currently running as a droplet in DigitalOcean. Following the process outlined here; quick summary below:

  1. Use ulimit -n... prints 1024 ✅
  2. Add fs.file-max=900000 and fs.nr_open=9000001 to /etc/sysctl.conf
  3. Execute sysctl -p to make the changes take effect.
  4. Use ulimit -n to double check the changes... prints 1024 ❌ should have printed 900000!.

I would expect at step 4 to get something other than 1024! What I am doing wrong?

in flag
Trying to increase the file descriptor max limit on Ubuntu 20, however, changing sysctl doesn't have an effect. I am curious what's going on and why my change doesn't get reflected. Do you have any specific questions I could answer?
in flag
Asking about Ubuntu server, version 20 (not Core for embedded devices). What's the correct way to clarify this question? Edit: Updated title to include Ubuntu 20.04 (LTS) x64.
in flag
Ah, I see — clarified in title; thanks for letting me know.
Score:0
in flag

The max file descriptor limit and the ulimit are separate numbers. The ulimit by default is set to 1024 and should probably not be changed in most circumstances because some older libraries have internal hardcoded arrays for file descriptors and may crash if you increase above 1024.

The ulimit for open files is a soft limit and can be raised either manually or by the process itself. For example, ulimit -n 9000

By setting fs.file-max=900000 you are probably actually lowering the open file limit, which by default on Ubuntu 20.04 is much higher.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.