为什么要使用 WSGI? [英] Why should I use WSGI?

查看:47
本文介绍了为什么要使用 WSGI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 mod_python 有一段时间了,我读了越来越多关于 WSGI 有多好的文章,却没有真正理解为什么.

Been using mod_python for a while, I read more and more articles about how good WSGI is, without really understanding why.

那我为什么要切换到它?有什么好处?难吗,学习曲线值得吗?

So why should I switch to it? What are the benefits? Is it hard, and is the learning curve worth it?

推荐答案

mod_wsgi vs. mod_python:

mod_wsgi vs. mod_python:

  • mod_wsgi 快一点(内部有更多的 C,更少的 Python)
  • mod_wsgi 进程可以与 Apache 隔离,从而提高安全性/稳定性并降低内存使用量[1]
  • mod_python 使您可以访问 Apache 的一些内部结构

一般的WSGI:

  • 许多可重复使用的中间件(身份验证/授权、会话内容、缓存、过滤)
  • 通过本机 WSGI 支持或 flup 在非 Apache 网络服务器上轻松部署

[1] - 与 preforking Apache 相比,它在每个进程中维护一个单独的 Python 解释器

[1] - compared to a preforking Apache, which maintains a separate Python interpreter in each process

这篇关于为什么要使用 WSGI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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