Why would a “java.net.ConnectException: Connection timed out” exception occur when URL is up?

后端 未结 10 1760
傲寒
傲寒 2020-11-29 18:42

I\'m getting a ConnectException: Connection timed out with some frequency from my code. The URL I am trying to hit is up. The same code works for some users,

10条回答
  •  春和景丽
    2020-11-29 19:03

    Connection timeouts (assuming a local network and several client machines) typically result from

    a) some kind of firewall on the way that simply eats the packets without telling the sender things like "No Route to host"

    b) packet loss due to wrong network configuration or line overload

    c) too many requests overloading the server

    d) a small number of simultaneously available threads/processes on the server which leads to all of them being taken. This happens especially with requests that take a long time to run and may combine with c).

    Hope this helps.

提交回复
热议问题