cfhttp - Unknown host: Read timed out

80 views
Skip to first unread message

David Repas

unread,
Jul 14, 2016, 3:46:25 PM7/14/16
to Lucee
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.




andreas

unread,
Jul 15, 2016, 7:30:38 AM7/15/16
to lu...@googlegroups.com
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. 

greetings

--
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+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/d579d6ba-0f6b-4cdd-846f-34ff3f02d7b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Repas

unread,
Jul 21, 2016, 1:13:29 PM7/21/16
to Lucee
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!


Bilal

unread,
Jul 22, 2016, 12:31:23 PM7/22/16
to Lucee
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,
Bilal
Reply all
Reply to author
Forward
0 new messages