curl without timeout causing servers to respond slower

in blog •  6 months ago 

In the last 2 days - I've been getting many alerts for some APIs in short amount of time every 30 mins or so.

image.png

I have to restarted the webserver via sudo service apache2 restart however the issues keep coming back.

It turns out the server has some health service checks which calls curl and it turns out one API server was slow to respond, and thus, the accumulated HTTP requests have impacted the server and slowed down the performance.

The solution is simple: add a timeout via e.g. -m 3 to set a 3 second timeout.

image.png

Steem to the Moon🚀!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!