HTTP 504: Gateway Timeout
The HTTP 504 Gateway Timeout error is returned when a request takes longer than 90 seconds to process, regardless of whether the process is waiting on Elasticsearch or sitting in a connection queue. This can sometimes be due to network issues, and sometimes it can occur when Elasticsearch is IO-bound and unable to process requests quickly. Complex requests are more likely to receive an HTTP 504 error in these cases.
For more information on timeouts, please see our recommendations on Connection Management.