*
The moose likes Servlets and the fly likes HTTP POST works in servlet then stops after a while Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP POST works in servlet then stops after a while" Watch "HTTP POST works in servlet then stops after a while" New topic
Author

HTTP POST works in servlet then stops after a while

Peter Odemwingie
Greenhorn

Joined: Nov 01, 2012
Posts: 3
Hi there,

We have a Java Servlet which makes 100's of 1000's of http posts per day with no problem.

However recently the servlet times out when trying to make these connections, but if the same url is hit directly from the browser on the server there is no problem.

The only way to resolve is to restart the server, which is obviously not ideal.

Any ideas appreciated.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Hmmm,

I wonder if you are exhausting some internal IP setting.

Try doing a netstat command over set intervals and plot the open or fin wait status(es).

WP
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2339
    
  28

So, you have a serrvlet on Server A that is doing HTTP posts to server B? Where did you run your browser, on Server A or Server B?

There could be 3 issues
a) Server B is throttling connections from Server A. Obviously if you have already tried opening the brower on Server A then this is not the case
b) Server A could have some memory leaks that makes everything run slowly on Server A
c) There are some network contention issues between the 2 servers. You just might be overloading the network. Maybe it was working fine before, and then you made some changes to the network topology that increases contention.
Peter Odemwingie
Greenhorn

Joined: Nov 01, 2012
Posts: 3
Jayesh A Lalwani wrote:So, you have a serrvlet on Server A that is doing HTTP posts to server B? Where did you run your browser, on Server A or Server B?

There could be 3 issues
a) Server B is throttling connections from Server A. Obviously if you have already tried opening the brower on Server A then this is not the case
b) Server A could have some memory leaks that makes everything run slowly on Server A
c) There are some network contention issues between the 2 servers. You just might be overloading the network. Maybe it was working fine before, and then you made some changes to the network topology that increases contention.


Hi Jayesh,

Thanks for the reply.

Server B allows and expects posts from our server (Server A).

When the connections start timing out we can't reach Server B from within the Servlet hosted on Server A, but hitting the same url directly from a Web Browser on Server A does not cause a problem which is the strange thing.

And once the whole server is restarted the problem goes away.

If we can still reach Server B via a Web Browser I am wondering if it is more likely to be a Tomcat issue?

Best Regards
Peter Odemwingie
Greenhorn

Joined: Nov 01, 2012
Posts: 3
William P O'Sullivan wrote:Hmmm,

I wonder if you are exhausting some internal IP setting.

Try doing a netstat command over set intervals and plot the open or fin wait status(es).

WP


Hi William,

Thanks will give this a go.

Best Regards
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 512

Peter Odemwingie wrote:And once the whole server is restarted the problem goes away.

Which Server you restart, server A or server B?

Regards, Prasad
SCJP 5 (93%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP POST works in servlet then stops after a while