tornado使用长连接并运行在nginx反向代理后面
摘要:
使用nginx作为tornado的反向代理是非常不错的,因为python的GIL不能充分利用多核资源。可以在一台机器上运行多个python进程,监听多个端口,前面用nginx做代理。下面给出一个nginx的配置例子,例子中tornado使用长连接,运行聊天服务器。 1 upstream chat_cluster{ 2 server 127.0.0.1:10000; 3 server 127.0.0.1:10001; 4 ip_hash; 5 keepalive 1024; 6 } 7 8 server 9 {10 listen 80;11 se... 阅读全文
posted @ 2013-03-08 20:24 华子的代码空间 阅读(2215) 评论(1) 推荐(0)
浙公网安备 33010602011771号