In my server process, it looks like this:
Main backend processes:
-
Processes Huge list of files and , record them inside MySQL.
-
On every 500 files done, it writes “Progress Report” to a separate file
/var/run/progress.loglike this “200/5000 files done” -
It is multi-processed with 4 children, each made sure to run on a separate file.
Web server process:
- Read the output of
/var/run/progress.logevery 10 seconds via Ajax and report to progress bar.
When processing a very large list of files (e.g. over 3 GB archive), the processes lock up after about 2 hours of processing.
I can’t find what is going on. Does that mean that /var/run/progress.log caused an I/O deadlock?
In python on Linux this should not block, however try using the
osmoduleand make sure you close the file
fh.close()as Python is a bit lazy clean up files.http://docs.python.org/library/os.html