Created
April 28, 2015 00:39
-
-
Save prologic/9d82342ebb48f5d335a3 to your computer and use it in GitHub Desktop.
A crude way to watch file descriptor leakage(s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
fds = [int(x.strip()) for x in open("fds.log", "r")] | |
plt.plot(fds) | |
plt.savefig("fds.png") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOGFILE=/root/fds.log | |
if [ ! -f $LOGFILE ]; then | |
touch $LOGFILE | |
fi | |
TMPID=$(pgrep -f task_maste) | |
while true; do | |
echo $(lsof -p $TMPID | wc -l) >> $LOGFILE | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: http://shortcircuit.net.au/~prologic/tmp/fds.png