question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increase open file limit in the VM / inside containers

See original GitHub issue

Report on user-slack: https://rancher-users.slack.com/archives/C0200L1N1MM/p1633033996169800

pod ulimits are too low for my use case. Specifically open files. Any recommended way to increase it?

Default setting for ulimit -n is 1024, same as in most distros. Should we increase it?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
janduboiscommented, Jan 10, 2022

Since nobody indicated which platform they are using, I’m just assuming macOS (or Linux) now. If you are on Windows, this will not work:

Create an ~/Library/Application Support/rancher-desktop/lima/_config/override.yaml file with a provisioning script:

provision:
- mode: system
  script: |
    #!/bin/sh
    cat <<'EOF' > /etc/security/limits.d/rancher-desktop.conf
    * soft     nofile         82920
    * hard     nofile         82920
    EOF

Stop and restart Rancher Desktop, and you should have updated limits in your containers. I’ve verified this with RabbitMQ; after the restart the container started up automatically.

I’ve also checked the dockerd configuration, which seems to have a larger nofile limit by default.

8reactions
janduboiscommented, Jan 18, 2022

Thx @jandubois this workarround works for Elasticsearch, too @stephenpope

I thought for Elastic you also had to increase the vm.max_map_count setting. So for anybody else finding this issue, add

sysctl -w vm.max_map_count=262144

to the provisioning script if you need to update the count for Elastic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker: How to increase number of open files limit - m. tarık yurt
The default limit for open files is 1024 in Docker containers. In Unix systems, you can increase the limit by following command: $...
Read more >
how to set ulimit / file descriptor on docker container the image ...
Run the following command when spinning up your container to set the open file limit.
Read more >
Not able to set ulimit ( max open files) inside vms - LXD
In the host I have set to 65535 and it remain same after restarting the host . but inside vm staill the value...
Read more >
Proxmox ulimit hell : how to really increase open files
And I want to ensure that my heavy loaded production-grade VMs (like MariaDB) ... is ulimit soft "open files" matters inside a container...
Read more >
Changing required node settings - IBM
Docker container settings · Check the maximum number of open files setting by running the following command: ulimit -n · Check the maximum...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found