我们正在做龙卷风的性能测试。这是密码
import tornado.websocket
import tornado.ioloop
import tornado.web
class TestTornado(tornado.websocket.WebSocketHandler):
def open(self):
self.set_nodelay(True)
pass
def on_message(self, message):
self.write_message(message)
self.close()
def on_close(self):
pass
def main():
applicationList = []
applicationList.append((r"/ws", TestTornado))
application = tornado.web.Application(applicationList)
application.listen(8888)
myIOLoopInstance = tornado.ioloop.IOLoop.instance()
myIOLoopInstance.start()
if __name__ == "__main__":
main()
我们正在用thor --amount 10000 --messages 100 ws://localhost:8888/ws
进行测试
然而,在OSX中,它总是在7000个连接后或多或少地失败,但在Ubuntu上根本没有错误。注意,我说的是连接,而不是文件,所以这个问题与osx可以处理的最大打开文件数无关(它已经设置为1000000)。你知道吗
所以。。为什么会这样?在OSX上有什么配置我们可以更改以使其正常工作吗?你知道吗
这是OSX本身的问题。这些参数应该会有帮助,但我们不再在OSX上测试,所以不确定。你知道吗
资料来源:https://rolande.wordpress.com/2010/12/30/performance-tuning-the-network-stack-on-mac-osx-10-6/
相关问题 更多 >
编程相关推荐