Skip to content

Instantly share code, notes, and snippets.

@edcote
Last active July 10, 2018 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edcote/e89fbeafa2868e404c7d83a8371eaf08 to your computer and use it in GitHub Desktop.
Save edcote/e89fbeafa2868e404c7d83a8371eaf08 to your computer and use it in GitHub Desktop.
ulimit gotcha
  • Different technique needed for GUI and non-GUI login:

https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu

  • Contents of /etc/security/limits.conf. For non-GUI login:
# FIXME: is * and root required?
@plus            soft    nofile          131072
@plus            hard    nofile          131072
  • Contents of /etc/systemd/system.conf. Uncomment following line. Other limits can also be set here. For GUI login.
DefaultLimitNOFILE=131072
# creates a report
lsof | perl -lane '$x{"$F[0]:$F[1]"}++;END { print "$x{$_}\t$_" for sort {$x{$a}<=>$x{$b}} keys %x}'

# open files by command name, can have multiple comments
lsof -c ssh -c init

# by user
lsof -u edc

# by process
lsof -p 27012

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