ruby - Net::HTTP extremely slow responses for HTTPS requests -
for reason, on development machine i'm getting very, slow responses https requests performed via net::http. i've tried restclient , httparty , both have same issue. seems have sprung nowhere. i've made these requests hundreds of times without issue, today unbearably slow.
pry(main)> puts time.now; httparty.get('https://api.easypost.com/v2/addresses'); puts time.now; 2015-04-29 08:07:08 -0500 2015-04-29 08:09:39 -0500
as can see, response took 2.5 minutes. , it's not easypost api url. i've tried numerous ssl requests servers know can connect (https://google.com, https://weather.com, etc.) , result in same behavior. also, noticed same thing happens requests redirected http https. now, check out non-ssl request:
pry(main)> puts time.now; httparty.get('http://lookitsatravis.com'); puts time.now; 2015-04-29 08:12:22 -0500 2015-04-29 08:12:22 -0500
instantaneous. gives? guess configuration problem somewhere between ruby , openssl. i've reinstalled both (using ruby 2.2.1 , openssl 1.0.2a) , i'm using os x yosemite 10.10.2 it's worth. reinstalled gems, problem persists. tried changing dns settings in case, no dice. there anywhere else can or configuration can change fix issue?
the issue not ruby or openssl or of above libraries. problem ipv6 addresses not resolving on macbook. dns lookup returned ipv6 address first, libraries tried connect until timed out , connected ipv4 addresses worked fine.
disabling ipv6 os x yosemite 10.10.2 worked me. it's not ideal, until can determine solution, works.
networksetup -setv6off "wi-fi"
thanks @steffenullrich pointing me in direction.
Comments
Post a Comment