English 中文(简体)
ache + mod_wsgi / Lighttpd + wsgi - 我是否看到业绩上的差别?
原标题:Apache + mod_wsgi / Lighttpd + wsgi - am I going to see differences in performance?

我把我需要在其他两个公开问题上作出明智选择的信息汇集在一起,以开发沙尔和伊米。 (无重复)

I m不使用一个框架,而是利用空档图书馆,从头开始建立一个网络。 就前端网络服务器而言,我有三种选择:gin、ache和灯光。

从我所阅读的所有账户来看,原产物是适合的。

That leaves two choices - lighttpd and Apache. Under heavy load, am I going to see major differences in performance and memory consumption characteristics? I m under the impression Apache tends to be memory hungry even when not using prefork, but I don t know how suitable lighttp is for Python apps.

Are there any caveats or benefits to using lighttpd over apache? I really want to hear all the information you can possibly bore me with!

最佳回答

Apache...

Apache is by far the most widely used web server out there. Which is a good thing. There is so much more information on how to do stuff with it, and when something goes wrong there are a lot of people who know how to fix it. But, it is also the slowest out of the box; requring a lot of tweaking and a beefier server than Lighttpd. In your case, it will be a lot easier to get off the ground using Apache and Python. There are countless AMP packages out there, and many guides on how to setup python and make your application work. Just a quick google search will get you on your way. Under heavy load, Lighttpd will outshine Apache, but Apache is like a train. It just keeps chugging along.

  • Wide User Base
  • Universal support
  • A lot of plugins

<<>Cons

  • Slow out of the box
  • Requires performance tweaking
  • Memory whore (No way you could get it working on a 64MB VPS)

Lighttpd...

Lighttpd is the new kid on the block. It is fast, powerful, and kicks ass performance wise (not to mention use like no memory). Out of the box, Lighttpd wipes the floor with Apache. But, not as many people know Lighttpd, so getting it to work is harder. Yes, it is the second most used webserver, but it does not have as much community support behind it. If you look here, on stackoverflow, there is this dude who keeps asking about how to get his Python app working but nobody has helped him. Under heavy load, if configured correctly, Lighttpd will out preform Apache (I did some tests a while back, and you might see a 200-300% performance increase in requests per second).

  • Fast out of the box
  • Uses very little memory

<<>Cons

  • Not as much support as Apache
  • Sometimes just does not work

Nginx If you were running a static website, then you would use nginx. you are correct in saying nginx s mod_wsgi isn t suitable.

Conclusion Benefits? There are both web servers; designed to be able to replace one another. If both web servers are tuned correctly and you have ample hardware, then there is no real benefit of using one over another. You should try and see which web server meets your need, but asking me; I would say go with Lighttpd. It is, in my opinion, easier to configure and just works.

此外,请看Cherokee网络服务器。 很难建立,业绩好坏半。 你们也应该在服务器Fault上问这个问题。

问题回答

你已经提到过大风很重要。 这是否意味着你特别试图实施长期投票申请? 如果是你,而且这一功能是申请的绝大部分,那么你将需要把你的热能服务器放在一个前端网络服务器上,该服务器使用合成技术,而不是使用加工/翻新模型。 灯光是像像仪服务器,与阿帕奇一样。 因此,将阿帕奇金用作长期投票申请的前端代理。 如果这是标准,那么实际上就会建议你使用gin,而不是轻松。

Now if you are not doing long polling or anything else that needs high concurrency for long running requests, then you aren t necessarily going to gain too much by using gevent, especially if intention is to use a WSGI layer on top. For WSGI applications, ultimately the performance difference between different servers is minimal because your application is unlikely to be a hello world program that the benchmarks all use. The real bottlenecks are not the server but your application code, database, external callouts, lack of caching etc etc. In light of that, you should just use whatever WSGI hosting mechanism you find easier to use initially and when you properly work out what the hosting requirements are for your application, based on having an actual real application to test, then you can switch to something more appropriate if necessary.

In summary, you are just wasting your time trying to prematurely optimize by trying to find what may be the theoretically best server when in practice your application is what you should be concentrating on initially. After that, you also should be looking at application monitoring tools, because without monitoring tools how are you even going to determine if one hosting solution is better than another.





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签