内置的HTTP服务器是否具有生产质量? [英] Are the built-in HTTP servers production quality?

查看:59
本文介绍了内置的HTTP服务器是否具有生产质量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说它说基于标准库的网络服务器

SimpleHTTPServer或CGIHTTPServer并不适合用于

生产系统。这仍然是这样吗?如果是这样,为什么?


这主要是性能问题吗?如果是这样的话,是否有很多可以轻松完成以改善网络服务器性能的东西---

缓存代理前端(例如Apache'' s mod_proxy),更快的硬件,
服务器集群等?另外,使它们异步(通过ForkingMixIn和ThreadingMixIn)似乎相当简单......


是不是他们不安全;可以轻易妥协/破解?如果是这样的话,

不会把它们隐藏在可信的前端(比如Apache)的帮助那里

呢?


他们是不是太过马车不能依靠?他们泄漏了内存,没有正确处理某些类型的请求,或者他们可能不符合b $ b标准吗?


他们很容易合作,我真的很想知道我们相信他们的缺点是什么。


谢谢。


Paul

解决方案

Paul Morrow写道:

我听说它说基于标准库的网络服务器的SimpleHTTPServer或CGIHTTPServer并不适合用于生产系统。这仍然是这样吗?如果是这样,为什么?




对于初学者,SimpleHTTPServer报告错误的内容长度。

请参阅我的补丁 http://tinyurl.com/56frb


- Irmen


Irmen de Jong写道:


对于初学者,SimpleHTTPServer报告错误的内容长度。
看到我的 http://tinyurl.com/56frb




是的,那里出了点问题。我不知道是否有意义

继续以''text''模式打开文本文件,以便对

换行的处理进行规范化,但随后调整content-length是从文件中读取的(换行符换行)字符串的长度。


Paul Morrow写道:

Irmen de Jong写道:


对于初学者,SimpleHTTPServer报告错误的内容长度。
请参阅我的补丁: http://tinyurl.com/56frb


是的,那里出了点问题。我想知道是否有意义继续以文本模式打开文本文件,以便对新行的处理进行规范化,然后将内容长度调整为
从文件中读取的(换行符换行)字符串的长度。




好​​吧,我认为也可以这样做。

但是为什么不完全放弃换行转换和

处理文本文件就像任何其他文件一样(这是我的补丁所做的)。


-Irmen


I''ve heard it said that web servers built upon the standard library''s
SimpleHTTPServer or CGIHTTPServer aren''t really suitable for use in a
production system. Is this still the case? And if so, why?

Is it primarily a performance issue? If so, aren''t there a number of
things that can easily be done to improve webserver performance ---
caching proxy front-ends (e.g Apache''s mod_proxy), faster hardware,
server clusters, etc.? Also it seems fairly straightforward to make
them asynchronous (via the ForkingMixIn and ThreadingMixIn)...

Is it that they''re not safe; can be easily compromised/cracked? If so,
wouldn''t hiding them behind trusted front-ends (like Apache) help there
too?

Are they simply too buggy to be relied upon? They leak memory, don''t
correctly handle certain types of requests, or perhaps they''re not
standards compliant enough?

They''re so easy to work with, I''d really love to understand what we
believe their shortcomings to be.

Thanks.

Paul

解决方案

Paul Morrow wrote:

I''ve heard it said that web servers built upon the standard library''s
SimpleHTTPServer or CGIHTTPServer aren''t really suitable for use in a
production system. Is this still the case? And if so, why?



For starters, the SimpleHTTPServer reports the wrong Content-Length.
See my patch at http://tinyurl.com/56frb

--Irmen


Irmen de Jong wrote:


For starters, the SimpleHTTPServer reports the wrong Content-Length.
See my patch at http://tinyurl.com/56frb



Yes, something is wrong there. I wonder though if it makes sense to
continue to open text files in ''text'' mode, so that the treatment of
newlines is normalized, but then adjust the content-length to be the
length of the (newline converted) string as read from the file.


Paul Morrow wrote:

Irmen de Jong wrote:


For starters, the SimpleHTTPServer reports the wrong Content-Length.
See my patch at http://tinyurl.com/56frb



Yes, something is wrong there. I wonder though if it makes sense to
continue to open text files in ''text'' mode, so that the treatment of
newlines is normalized, but then adjust the content-length to be the
length of the (newline converted) string as read from the file.



Well, I think that could be done too.
But why not ditch the newline conversion altogether and
treat text files just as any other file (which is what my patch does).

-Irmen


这篇关于内置的HTTP服务器是否具有生产质量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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