cURL error 6: getaddrinfo() thread failed to start

0

I'm running 6 load balanced EC2 servers (Ubuntu) for a PHP 8.1 (Laravel 9) software application. The application uses a ElasticCache-based (redis) queue system to process jobs, and most of these jobs make one or more http calls to various external API endpoints. The application regularly processes hundreds of jobs per minute. I recently upgraded the Laravel framework from 8 to 9. Since then, and especially when queue load is high, my http calls are failing with the error "cURL error 6: getaddrinfo() thread failed to start". Sometimes, this even causes server(s) to go unresponsive for a time.

My main guess is that server or network resources are being exhausted. However, these errors did not start occurring until after upgrading the Laravel Framework, which begs the question of what the application software has to do with resource limits where they seemingly weren't reached previously. No other material functionality was modified in the application during the Laravel upgrade.

Are there any EC2 DNS request limits or fair use policies that could be getting triggered here? Are there Ubuntu limits relating to starting DNS lookup threads? How would I determine if these limits are being reached, and what would be the best way to prevent or mitigate that? Any thoughts, info, and advice is much appreciated!

1 Answer
0

Thank you for the details.

Amazon-provided DNS servers indeed have a limitation of 1024 packets per second for each elastic network interface. You can find here the guidance on how to troubleshoot and mitigate such issues, though it doesn't appear to be the root cause in this instance.

On a different note, several external resources [1][2] indicate that the getaddrinfo() thread failed to start error can arise due to a depleted number of available open files. As such, a potential solution could involve raising the ulimit to increase the maximum number of open files allowed by your system.


[1] https://github.com/curl/curl/issues/6495#issuecomment-779398725

[2] https://stackoverflow.com/questions/70669106/nginx-curl-error-getaddrinfo-thread-failed-to-start

AWS
weidi
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions