-
While trying to debug a long slow memory leak I found that the OOM detection wasn't quite working. So I created this script to dump a report every hour until the process is killed: echo "Running django-admin runserver under Fil to debug memory leaks"
fil-profile -o "/storage/2022-04-web-fil-profile/$(hostname)" --no-browser run \
/venv/bin/django-admin runserver 0.0.0.0:10080 \
--noreload \
--nostatic &
FIL_PID=$!
(
while true ; do
# once an hour
sleep 3600
# dump the fil profile to the output directory
kill -s SIGUSR2 $FIL_PID
done
) &
LOOP_PID=$!
wait $FIL_PID
kill $LOOP_PID Unfortunately this doesn't work as intended because Fil seems to exit the process after the first SIGUSR2, so the web server no longer handles any requests. Is there a way to ask fil to dump a report without exiting? I can't seem to find one. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
This seems like a bug, SIGUSR2 should keep it running. I will try to reproduce. |
Beta Was this translation helpful? Give feedback.
-
Separately: I'm curious about the failed OOM detection; possibly it could be improved, depending. What operating system is this? How much RAM and swap do you have? Do you use compressed RAM? |
Beta Was this translation helpful? Give feedback.
-
OK, the SIGUSR2 problem should be fixed in 2022.05.0, which should be available on PyPI in the next few minutes. |
Beta Was this translation helpful? Give feedback.
OK, the SIGUSR2 problem should be fixed in 2022.05.0, which should be available on PyPI in the next few minutes.