Elasticsearch connection timeouts

I have a python app on fly that uses elasticsearch and I’m often getting weird connection timeouts from fly to my elasticsearch cluster (not running on fly). Occasionally, the app will hang while querying elasticsearch and eventually time out. I was able to catch an occurrence of this while running the app locally and it was able to connect to my es cluster just fine, but the fly app still got the connection timeout. I don’t know if fly or the elasticsearch python library is trying to do something clever by reusing connection or something like that or if fly has poor connection to my cluster which has multiple nodes across the US (seems unlikely) but it is driving me nuts since I can’t figure out what is wrong. Has anyone had any similar issues or suggestions on how to fix this?

Hey there,

I see you’re having some issues with you app on fly, because of those connection timeouts. Do you mind providing the error that you’re receiving in regards to the connection timeout? The reason for me asking is because I found this here- python - Connection Timeout with Elasticsearch - Stack Overflow. If it’s similar maybe even this in itself is helpful?^

There is not much help from the logs. This is pretty much all I get:

2023-08-03T20:43:44.105 app[3287364a64e385] lax [info] elastic_transport.ConnectionTimeout: Connection timed out
2023-08-03T20:44:34.002 proxy[3287364a64e385] lax [error] could not make HTTP request to instance: connection error: timed out

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.