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