Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Too many CLOSE_WAIT s due to AJAX call

 
Prakas Subed
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have simulated push behavior using AJAX calls from IE. Parts of web page get updated every second getting fresh content from the server using the request object displayed below. However, after a while (some time 5 minutes, sometimes 15 minutes or so later) the update stops happening. The IE icon spins relentlessly, but no content update.

One observation made is that with "netstat -an" on the client system, we can see may be hundred or more connections to server with TCP state "CLOSE_WAIT"

Any suggestions how to get the screen updated without interruption?

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look into COMET.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65110
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you not think that banging on the server every second is a bit excessive? How many pages are doing this sumultaneously?
 
Prakas Subed
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To the user it's not excessive. They want to see near real time (minimum of 1 second) update of data on their browser. That's roughly 30KB data that need to be generated and shipped to the browser every second.

However, it's only one page whose final size is less than 32KB when shipped to the browser. Currently this 32Kb HTML replaces an innerHTML on a template html with logos etc already loaded. Users limited to a maximum of 5.

So much for AJAX's simulated push hype?!

With COMET's approach, seems that we will have to redo much of the way things are already done.


Originally posted by Bear Bibeault:
Do you not think that banging on the server every second is a bit excessive? How many pages are doing this sumultaneously?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your server is going to come to a crashing halt when it has multiple users. You probably should look at FLEX which is better for real time data.

Eric
 
Prakas Subed
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server is handling fine. In less than 200ms its generating the content and sending out (per avg response time measurement of related servlet/jsp WAS). Browser (IE 6) seems to get confused with multiple AJAX calls made to the server.

The same code works fine on Firefox to update the content within the second without interruption; except there's a noticeable flicker on Firefox when the html rendered with the update.


Originally posted by Eric Pascarello:
Your server is going to come to a crashing halt when it has multiple users. You probably should look at FLEX which is better for real time data.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic