我有这两种配置。我要知道有什么区别,哪种更好更快?你知道吗
第一形态:
#!/home/user/bin/python
import sys, os
sys.path.insert(0,"/home/user/projects/")
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings'
from flup.server.fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
WSGIServer(WSGIHandler()).run()
第二形态:
#!/home/user/bin/python
import sys, os
sys.path.insert(0,"/home/user/projects/")
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
谢谢:D
更新:
I did a quick test with python cProfile lib。在doc中,WSGI对应于第一个conf,FCGI对应于第二个conf
Django本机使用WSGI,因此通过FastCGI运行它为HTTP消息添加了另一层。话虽如此,如果您可以选择快速的FastCGI容器还是慢速的WSGI容器,那么使用额外的层可能会更好。你知道吗
相关问题 更多 >
编程相关推荐