Skip to content

Instantly share code, notes, and snippets.

@vishaltelangre
Created January 15, 2015 07:35
Show Gist options
  • Select an option

  • Save vishaltelangre/3c810b20cb82cc267781 to your computer and use it in GitHub Desktop.

Select an option

Save vishaltelangre/3c810b20cb82cc267781 to your computer and use it in GitHub Desktop.
concurrency notes
Count All Open File Handles
lsof | wc -l
List File Descriptors in Kernel Memory
sysctl fs.file-nr
  • Sample outputs:
fs.file-nr = 1020	0	70000
  • Where,
    • 1020 The number of allocated file handles.
    • 0 The number of unused-but-allocated file handles.
    • 70000 The system-wide maximum number of file handles.
Logrotate Example:
  • Create /etc/logrotate.d/foo-app-logs file with following snippet:

    /var/log/foo-app/*.log {
            daily
            size 500M
            missingok
            rotate 10
            compress
            delaycompress
            notifempty
            create 664 deploy devops
    }
    
  • Activate it as:

    sudo logrotate -f /etc/logrotate.d/foo-app-logs
    
  • Cross Verify here:

    less /var/lib/logrotate/status | grep foo-app-logs
    
Links:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment