Python的可靠性 [英] Python reliability

查看:387
本文介绍了Python的可靠性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在嵌入式系统中在Linux上运行一些高可靠性软件

。性能

(或缺少它)不是问题,可靠性是。


这个软件很简单,可能是一个

Python中的几百行代码。需要

使用套接字模块与网络进行交互,

然后可能需要做一些硬件 -

相关的得到自己的驱动程序用

C.


线程和其他更容易出错的技术可以将
放在一边,一切可以使用

a轮询循环在一个线程中运行。


软件应该连续运行

几乎永远(至少是没有重启的一年)。

Python解释器(在Linux上)是否稳定且

是否足够无泄漏?


- Ville


-

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

I would need to make some high-reliability software
running on Linux in an embedded system. Performance
(or lack of it) is not an issue, reliability is.

The piece of software is rather simple, probably a
few hundred lines of code in Python. There is a need
to interact with network using the socket module,
and then probably a need to do something hardware-
related which will get its own driver written in
C.

Threading and other more error-prone techniques can
be left aside, everything can run in one thread with
a poll loop.

The software should be running continously for
practically forever (at least a year without a reboot).
Is the Python interpreter (on Linux) stable and
leak-free enough to achieve this?

- Ville

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

推荐答案

Ville Voipio< vv ***** @ kosh.hut.fi>写道:
Ville Voipio <vv*****@kosh.hut.fi> writes:
软件应该连续运行
几乎永远(至少一年没有重启)。
Python解释器(在Linux上)是否稳定且
无泄漏到足以实现这个目标?
The software should be running continously for
practically forever (at least a year without a reboot).
Is the Python interpreter (on Linux) stable and
leak-free enough to achieve this?




我想说给应用程序进行最重的压力测试,你可以在部署它之前使用
,仔细检查是否有泄漏和碰撞。不管实现语言如何,我都会说b $ b。



I would say give the app the heaviest stress testing that you can
before deploying it, checking carefully for leaks and crashes. I''d
say that regardless of the implementation language.


On Sun,2005年10月9日23:00:04 +0300,Ville Voipio写道:
On Sun, 09 Oct 2005 23:00:04 +0300, Ville Voipio wrote:
我需要在嵌入式系统中在Linux上运行一些高可靠性的软件。性能(或缺乏)不是问题,可靠性是。


[snip]

软件应该连续运行
几乎永远(至少一年没有重启)。
Python解释器(在Linux上)是否稳定且无泄漏,足以实现这一目标?
I would need to make some high-reliability software
running on Linux in an embedded system. Performance
(or lack of it) is not an issue, reliability is.
[snip]
The software should be running continously for
practically forever (at least a year without a reboot).
Is the Python interpreter (on Linux) stable and
leak-free enough to achieve this?




如果性能真的不是这样的问题,它真的会如果你定期重启Python?
怎么回事?启动Python需要花费很少的时间:



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:


time python -c pass

real 0m0.164s

用户0m0.021s

系统0m0.015s


如果性能不是问题,您的用户可能甚至不关心十个/>
即使每小时一次也会延迟一次。换句话说,构建你的软件以优惠价格重新开始,你的用户甚至不会注意到或关心它是否会重新开始。


我不是说你需要每小时重启一次Python,甚至每月一次重启
。但如果你这样做,那会有关系吗?更重要的是

操作系统的状态。 (我假设,一年的正常运行时间

要求,你甚至没想到WinCE。)

-

史蒂文。

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

If performance isn''t an issue, your users may not even care about ten
times that delay even once an hour. In other words, built your software to
deal gracefully with restarts, and your users won''t even notice or care if
it restarts.

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.)
--
Steven.


这篇关于Python的可靠性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆