Setting OS Limits with systemd

  1. Edit /etc/systemd/user.conf and /etc/systemd/systemd.conf, add the following line to each file:
    DefaultLimitNOFILE=NEW_LIMIT
    
  2. Edit /etc/security/limits.conf and set the usual limit details:
    USER soft nofile NEW_LIMIT
    USER hard nofile NEW_LIMIT
    
  3. Restart your system for the changes to take effect.