• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX Hangs Apache

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ranchers,

I am developing a Web Support chat application,for which i was inspired by Gmail messenger which is intregated in browser(AJAX Powered),the archietecure i am using is

For Visitor:IN A JSP FILE(AJAX)---------calls---------SERVLET
For Operator:APPLET----------calls----------SERVLET

The current issue which is giving me a problem is how should
i update the messages,and what i think is the retrieval process should run in a separate thread,but as i could not find any code on the net,

i switched to this process





The Problem with this code is this,because the server on which i am running is my own machine,after running this code on IE7,
APACHE TOMCAT exe(TOMCAT5.exe) CPU usage is shown to be 98%
and after 10-15 seconds the machine finally hangs.

Although the configuration is:
1)AMD 64 X2 3800+(dual core)
2)Asus A8N32-SLI-Deluxe
3)1 GB RAM

What Should I Do To Run The Code Normally,So That it does not hangs the Server,or can anyone suggest a way so that i can retrieve messages and send them without problem,as it happens in Gmail Browser Messenger.


[ November 26, 2006: Message edited by: anand phulwani ]

[ November 26, 2006: Message edited by: anand phulwani ]

[ November 26, 2006: Message edited by: anand phulwani ]
[ November 26, 2006: Message edited by: anand phulwani ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the looks of what you have written the third parameter in your open is false? aka you are going synchronous request.

Synchronous requests freeze the browser until the call is returned. So the browser freezes at 10 seconds since that is when the call is made (setTimeout). Change your model to asynchronous mode and you probably will not see it freeze.

Download Firefox with Firebug and look at how you can watch the request with it: http://radio.javaranch.com/pascarello/2006/09/13/1158158516682.html

Also your server is going to see a large increase in load (remember that google has BIG SERVERS that can handle the traffic.) You will be pinging your server a minimum of 6 times a minute. Increase the number of people using it and you will have a lot of traffic.

Other things you might want to look into in the COMET model or just building an applet for the users.

Eric
 
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic