Python reliability

Ville Voipio vvoipio at kosh.hut.fi
Mon Oct 10 04:51:25 EDT 2005


In article <pan.2005.10.09.23.13.20.212987 at REMOVETHIScyber.com.au>, 
Steven D'Aprano wrote:

> If performance is really not such an issue, would it really matter if you
> periodically restarted Python? Starting Python takes a tiny amount of time:

Uhhh. Sounds like playing with Microsoft :) I know of a mission-
critical system which was restarted every week due to some memory
leaks. If it wasn't, it crashed after two weeks. Guess which
platform...

> $ time python -c pass
> real    0m0.164s
> user    0m0.021s
> sys     0m0.015s

This is on the limit of being acceptable. I'd say that a one-second
time lag is the maximum. The system is a safety system after all,
and there will be a hardware watchdog to take care of odd crashes.
The software itself is stateless in the sense that its previous
state does not affect the next round. Basically, it is just checking
a few numbers over the network. Even the network connection is
stateless (single UDP packet pairs) to avoid TCP problems with
partial closings, etc.

There are a gazillion things which may go wrong. A stray cosmic
ray may change the state of one bit in the wrong place of memory,
and that's it, etc. So, the system has to be able to recover from
pretty much everything. I will in any case build an independent
process which probes the state of the main process. However,
I hope it is never really needed.

> I'm not saying that you will need to restart Python once an hour, or even
> once a month. But if you did, would it matter? What's more important is
> the state of the operating system. (I'm assuming that, with a year uptime
> the requirements, you aren't even thinking of WinCE.)

Not even in my worst nightmares! The platform will be an embedded
Linux computer running 2.4.somethingnew.

- Ville

-- 
Ville Voipio, Dr.Tech., M.Sc. (EE)




More information about the Python-list mailing list