在 Turbogears2 中优化每秒 POST

Optimizing POSTs-per-second in Turbogears2

在基于 Turbogears v2.1.5 构建的网页游戏中,登录用户定期 POST 一条 16 字节的消息。当 POST 速率为每秒 60 POST 秒时,服务器 CPU 达到 100%。 (为了测试,我们已经删除了所有工作,例如用每个 post 更新数据库——服务器只是立即 returns 一个空响应。)

使用 wrk 获取一个 16 字节的静态文件,我们看到 Turbogears 达到每秒约 500 个请求的速率,并希望与我们游戏的 POST 匹配或接近该速率秒。我们真的很想达到每秒 1,000 或更多 POSTs。

设置:Turbogears v2.1.5,AWS c3.large,Windows Server 2008 R2,Intel Xeon,E5-2680 v2 @ 2.8Ghz 2.8Ghz。

问题:是否有 tg2 设置或其他更改可以让我们在这种情况下每秒处理 500 或更多 POSTs?

如果您能够升级到 TG2.3,则最新版本中的工作会大大提高框架性能 (http://blog.axant.it/archives/452),开箱即用。

也通过 2.3 中引入的新的最小模式 (http://turbogears.readthedocs.io/en/latest/turbogears/minimal/index.html ) you can easily disable any component you don't need like i18n, sessions etc.. for more speed improvements ( see the various X.enabled options at http://turbogears.readthedocs.io/en/latest/reference/config-options.html)。禁用 i18n 和静态文件支持通常会带来很好的性能提升。