Cfhttp - Unknown host: Read timed out

Hi all,

I’m using cfhttp quite a bit to retrieve json data from an external api.
99% percent of the time, everything works fine - but at times, I receive a
“Unknown host: Read timed out” error message. I’m running Tomcat/Lucee
4.5.3 on Amazon Elastic Beanstalk. I’m having a tough time determining
what’s going on. As far as I can tell, the external api does not have any
downtime. I’ve tried both https and http endpoints without improvement.
I’ve read about (but haven’t tested) issues related to cached DNS records
in Java and compression. Any thoughts or ideas? Thanks.

https://lh3.googleusercontent.com/-DGUNHvZ6Nag/V4fqbK-kZ4I/AAAAAAAAbRo/K9h1z45zM0ov9NrbANR_iscWNZgfkPdfQCLcB/s1600/7-14-2016%2B2-38-54%2BPM.jpg

do you have an alternative DNS configured in your network-configuration? I
would (just for testing) set up googles DNS 8.8.8.8 just to see if the
problem persists. We had similar problems when we changed the provider. His
DNS-Server shows timeouts at certain times.

greetings2016-07-14 21:46 GMT+02:00 David Repas <@David_Repas>:

Hi all,

I’m using cfhttp quite a bit to retrieve json data from an external api.
99% percent of the time, everything works fine - but at times, I receive a
“Unknown host: Read timed out” error message. I’m running Tomcat/Lucee
4.5.3 on Amazon Elastic Beanstalk. I’m having a tough time determining
what’s going on. As far as I can tell, the external api does not have any
downtime. I’ve tried both https and http endpoints without improvement.
I’ve read about (but haven’t tested) issues related to cached DNS records
in Java and compression. Any thoughts or ideas? Thanks.

https://lh3.googleusercontent.com/-DGUNHvZ6Nag/V4fqbK-kZ4I/AAAAAAAAbRo/K9h1z45zM0ov9NrbANR_iscWNZgfkPdfQCLcB/s1600/7-14-2016%2B2-38-54%2BPM.jpg


Win a ticket to dev.objective from Lucee via Twitter, see
http://bit.ly/1UbTMWj for details, good luck and see you there…

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/d579d6ba-0f6b-4cdd-846f-34ff3f02d7b0%40googlegroups.com
https://groups.google.com/d/msgid/lucee/d579d6ba-0f6b-4cdd-846f-34ff3f02d7b0%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

Andy, many thanks for the suggestion. I gave it a try, but that didn’t seem
to help my issue.

Surprisingly (or maybe not) by simply changing the CFHTTP timeout from 10
seconds to 30 seconds appears to have helped. I’m not entirely sure why
this would be, since the actual reponse takes around 200ms. I’m monitoring
to see if at times that 200ms response randomly slows down to 10+ seconds.

Thanks!

David:
If the CPU load on your server is not changing much during these times you
could be experiencing a network issue.
The only way to make sure is to collect some metrics, if possible from the
server, if not from the same network zone your server is on.
Maybe something as simple as cURL + chron job or similar. You may have
other tools.

My guess would be if by extending the timeout you fix things, then, most
likely Lucee is waiting on network resolution. Your firewall could be busy,
your connection spotty, etc. You will need to collect objective metrics to
get to the source.

HTH,
BilalOn Thursday, July 21, 2016 at 1:13:29 PM UTC-4, David Repas wrote:

Andy, many thanks for the suggestion. I gave it a try, but that didn’t
seem to help my issue.

Surprisingly (or maybe not) by simply changing the CFHTTP timeout from 10
seconds to 30 seconds appears to have helped. I’m not entirely sure why
this would be, since the actual reponse takes around 200ms. I’m monitoring
to see if at times that 200ms response randomly slows down to 10+ seconds.

Thanks!