We have next code.
Sometimes we should wait 10-20-40 seconds on the last line.
What can be the problem?
Java 1.4
URL url = ...;
HttpURLConn
One thing I would guess is that your DNS server isn't responding well.
Can you experiment with changing symbolic domain names to numeric IP addresses before you start? Or can you do each request twice (just for experimentation) and see if the first request is significantly slower than the second?
Google has put up a DNS server at (among others) 8.8.8.8 . They claim it's faster than most other DNS servers. Give that a try!