any issues with long running python apps?

Les Schaffer schaffer at optonline.net
Fri Jul 9 15:13:30 EDT 2010


i have been asked to guarantee that a proposed Python application will 
run continuously under MS Windows for two months time. And i am looking 
to know what i don't know.

The app would read instrument data from a serial port, store the data in 
file, and display in matplotlib.  typical sampling times are about once 
per hour. our design would be to read the serial port once a second 
(long story, but it worked for ten days straight so far) and just store 
and display the values once an hour. so basically we'd have a long 
running for-loop. maybe running in a separate thread.

i have thought through the issues on our end:  we have to properly 
handle the serial port and make sure our GUI doesn't hang easily. we'd 
have to be sure we don't have any memory leaks in numpy or matplotlib 
and we're not storing data in memory stupidly. i've never looked into 
Windows serial port driver reliability over the long term. But we think 
if the serial port hangs, we can detect that and react accordingly.

but none of this has anything to do with Python itself. i am sure python 
servers have been running reliably for long periods of time, but i've 
never had to deal with a two-month guarantee before.  is there something 
else i am missing here that i should be concerned about on the 
pure-Python side of things? something under the hood of the python 
interpreter that could be problematic when run for a long time?

or need we only concern ourselves with the nuts behind the wheel:that 
is, we the developers?

thanks

Les



More information about the Python-list mailing list