Hi,

I am using the Python Elasticsearch API 
<http://www.elasticsearch.org/guide/en/elasticsearch/client/python-api/current/>
 
to interact with ES in my Python Flask application (server is Python 
Tornado). Currently, as soon as the app gets a new user request, it does 
esclient = Elasticsearch("127.0.0.1") and then uses this esclient to search 
for the required data. But I recently read that ES has persistent 
connections. So,

   1. Should I save the esclient somewhere and reuse it instead of doing 
   esclient = Elasticsearch("127.0.0.1") for every request?
   2. Would there be some resource leak if I forget about esclient after 
   the request and open a new one every time? Is there a way to close this 
   open connection?
   
I am also doing the same for another db, Redis in my app. Sorry, might seem 
like a basic question but I am a bit confused. 

Thanks-in-advance!

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/19d47985-087f-41c1-b524-1f6ac26fd63c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to