Skip to content

Instantly share code, notes, and snippets.

@blockpane
Last active August 24, 2021 17:55
Show Gist options
  • Save blockpane/aba6b39235703300eb34b2ea7f9d6006 to your computer and use it in GitHub Desktop.
Save blockpane/aba6b39235703300eb34b2ea7f9d6006 to your computer and use it in GitHub Desktop.
Bump up nofile limits for osmosisd

Check current limits:

cat /proc/$(pidof osmosisd)/limits

Update systemd

Edit /etc/systemd/system/osmosisd.service (or whatever you named it.) And in the [Service] section, set the following:

LimitNOFILE=infinity

very important, need to have systemd rescan the unit files or the change won't get picked up:

systemctl daemon-reload

Optional, update limits.conf

Just to be double-sure it's possible to remove all ulimits for the user. Edit /etc/security/limits.conf and add the line (I named the user osmo, but you probably have something else, so adjust accordingly.)

osmo -

Restart

Changes won't get picked up until after a restart...

systemctl restart osmosisd
# tail logs...
journalctl -fu osmosisd
@blockpane
Copy link
Author

docker-run ...

docker run --ulimit nofile=1048576:1048576 ...

Or in docker-compose ...

ulimits:
  nofile:
    soft: 1048576
    hard: 1048576

@blockpane
Copy link
Author

Also set the following in .osmosisd/config/config.toml (json logs are slightly more compact than plain)

# Output level for logging, including package level options
log_level = "error"

# Output format: 'plain' (colored text) or 'json'
log_format = "json"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment