Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpURLConnection.connect() takes long time (3 minutes)  RSS feed

 
Andy Hamilton
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm stumped on an unusual problem. I'm running java 1.3 and JServ (don't ask, I inherited this set up), using JSSE. One of the things we do with our app involves some xml communication over SSL.

Starting last week, the time for the SSL communication jumped from about 15 seconds to around 3 minutes.

Here is the bit of code that does the actual communication:



Besides a couple of new Trace.log statements to pin down the what's taking so long, I haven't touched this code in the year+ since I've inherited it. There haven't been any changes in the network setup for the last 3 weeks, either (new reverse lookup zone for our internal network).

Any idea why the HttpURLConnection.connect() would take so long? Or any idea how I can find out what is going on for those 3 minutes? In my search so far, I found -Djava.net.debug=ssl,handshake,data and added it to my startup parameters, but in my frustration, I must have overlooked what I need do to make it show up in my logs.

I set up a tcpdump on the server to listen on the IP that I'm trying to connect to and the "xml connection to" log statement prints, then about 3 minutes and 10 seconds goes by, then tcpdump reports that we actually send the packets to the other server, then we get a response and print the "xml connection complete" log message. URL and HttpURLConnection are not subclassed at all.

To make things even more interesting, I broke out this code, and wrote a small test program. The test program has some minor changes (pulling the xml data from an already existing file, mainly), and this version runs lickety-split (about 5 seconds).

Any help or pointers would be greatly appreciated. Let me know if I can provide any more information.

Thanks,
Andy
 
Andy Hamilton
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured it out.

The other side removed a proxy server that we used to connect through. The server was taking 3 minutes and 10 seconds to timeout when it attempted to contact the proxy server.

To be honest, I don't know if we ever connected through the proxy server successfully. I think we may have been denied when we tried to connect. Of course, that would happen a lot faster than timing out.

Andy
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!