What is the disadvantage of using Django's fastcgi server

落爺英雄遲暮 提交于 2019-11-28 16:49:09

问题


I'm using nginx + fastcgi( manage.py runfcgi ...) on production for some of my Django projects. A lot of people suggests to use nginx + gunicorn. What is advantage of using gunicorn instead of using Django's fastcgi server?


回答1:


I'm just tell why you need to use WSGI-like servers :) but if you feel comfortable with using fcgi - just use it

Short answer: WSGI (as protocol) is cool because its native

Or if "You need to go deeper"(c)

Next question "FastCGI vs WSGI-like servers?"

Some answers here:

  • Differences and uses between WSGI, CGI, FastCGI, and mod_python in regards to Python?
  • What's the difference between scgi and wsgi?
  • Is there a speed difference between WSGI and FCGI?
  • How Python web frameworks, WSGI and CGI fit together

About gunicorn, uWSGI and cherokee, nginx. Dont mix them!

nginx is web-server which can handle http requests and can send it to WSGI backend. ( But first of all it extremly fast for static content handling. ) And WSGI backend handle you django application.

About cherokee, I think it handle the same tasks as nginx but I'm not work with it.

And gunicorn, uWSGI are WSGI backend which run threads with django app and do many other tasks

And hmmm, gunicorn say that

Being a server that only runs on Unix-like platforms, unicorn is strongly tied to the Unix philosophy of doing one thing and (hopefully) doing it well. Despite using HTTP, unicorn is strictly a backend application server for running Rack-based Ruby applications.

I practice for my django apps nginx (latest stable from nginx.org repos)+uWSGI (from Debian stables) - works perfectly :)


edited 18.05.2012

Link to 2010 topic with comparing fcgi gunicorn uWSGI

fcgi (threaded) 640 r/s

fcgi (prefork 4 processors) 240 r/s (*)

gunicorn (2 workers) 1100 r/s

gunicorn (5 workers) 1300 r/s

gunicorn (10 workers) 1200 r/s (?!?)

uwsgi (2 workers) 1800 r/s

uwsgi (5 workers) 2100 r/s

uwsgi (10 workers) 2300 r/s

(* this made my computer exceptionally sluggish as CPU when through the roof)




回答2:


As b1- says, WSGI is native (take a look at this post).

Also, this post has a similar question.

From my personal point of view, some time ago i've been using Nginx + uwsg in vhost mode to run various project on my server.



来源:https://stackoverflow.com/questions/11216658/what-is-the-disadvantage-of-using-djangos-fastcgi-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!