curl without timeout causing servers to respond slower

in #blog7 days 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🚀!

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 62900.39
ETH 3357.78
USDT 1.00
SBD 2.47