tornado并发性能测试
Posted jiaojianglong
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tornado并发性能测试相关的知识,希望对你有一定的参考价值。
@gen.coroutine
from elasticsearch_async import AsyncElasticsearch es = AsyncElasticsearch( hosts = [ "117.78.26.××:××××", "117.78.26.××:××××" ], type = "es", http_auth = ("×××××","×××××"), timeout = 60 ) @web.asynchronous @gen.engine def post(self, *args, **kwargs): result = ‘code‘: 200, ‘msg‘: ‘返回成功‘,‘data‘: body = "size": 10, "_source": ["id","name"], "query": "bool": "must": [ "match":"name":"query":"婚姻法", "match": "law_type": "query": "法律", ] laws = yield self.es.search("law_search_v2","_doc",body) # laws = "测试" result[‘data‘][‘laws‘] = laws self.finish(result)
es : elasticsearch-async 支持es6.0
mongodb : motor
mysql : tornado_mysql
以上是关于tornado并发性能测试的主要内容,如果未能解决你的问题,请参考以下文章