This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic