Skip to content

Instantly share code, notes, and snippets.

@edcote

edcote/ulimit.md

Last active Jul 10, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.