1

The following request from a python client to elasticsearch fails

    2014-12-19 13:39:05,429 WARNING GET http://10.129.0.53:9200/delivery-logs-index.prod-20141218/_search?timeout=20m [status:N/A request:10.010s]
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/elasticsearch/connection/http_urllib3.py", line 46, in perform_request
    response = self.pool.urlopen(method, url, body, retries=False, headers=headers, **kw)
  File "/usr/lib/python2.6/site-packages/urllib3/connectionpool.py", line 559, in urlopen
    _pool=self, _stacktrace=stacktrace)
  File "/usr/lib/python2.6/site-packages/urllib3/util/retry.py", line 223, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python2.6/site-packages/urllib3/connectionpool.py", line 516, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python2.6/site-packages/urllib3/connectionpool.py", line 336, in _make_request
    self, url, "Read timed out. (read timeout=%s)" % read_timeout)
ReadTimeoutError: HTTPConnectionPool(host=u'10.129.0.53', port=9200): Read timed out. (read timeout=10)


Elasticsearch([es_host],
                             sniff_on_start=True,
                             max_retries=100,
                             retry_on_timeout=True,
                             sniff_on_connection_fail=True,
                             sniff_timeout=1000)

Is there a way to increase the request timeout? Currently it seems to be configured by default to read timeout=10

2 Answers 2

2

You can try adding a request_timeout to a value in your request like:

res = client.search(index=blabla, search_type="count", timeout="20m", request_timeout="10000", body={
Sign up to request clarification or add additional context in comments.

Comments

2

You can also pass timeout=60 when instantiating the client object (60 meaning 60 seconds and of course being only an example).

This parameter overrides the 10s default specified in the Connection constructor.

https://github.com/elastic/elasticsearch-py/blob/master/elasticsearch/connection/base.py#L27

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.