Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chat application putting too much load on the web server

Status
Not open for further replies.

sweta

Programmer
Apr 1, 2003
35
IN
Hi there,

I've made a chat application in ASP which uses Application scope Dictionary objects.
The application works fine with 4-5 users (CPU usage= 11%). But if it subjected to stress testing with 20 simultaneous users typing too fast the CPU Usage was exponentially increased (100%).

Now its become a topic of debate whether the chat application should be implemented or not.
I am badly in need of expert advice on this. Please tell me what will be the effect on my web site which is a moderately visited site.

Thanx,
Sweta
 
Well i made same thing using PHP, but can be same using ASP.
What kind of web chat are you using?
What is the Application object role in there?

________
George, M
 

Hi there,

Its a chat application which has public chat rooms but users can send private messagses also. They can create their own chat rooms. Everything is done using 3 application objects (Dictionary)Uers,Rooms and Messages.

Everytime a user enters..one element is added to the Users object.Same is the case with Room and Messages object.

But I think using Application object is not wise and maybe I should change to database. Tell me if you have a better solution.

Thanx,
Sweta
 
I used to mine a 5 secs refresh and MySql but i think that Using a database here wont speed things up.

You can try to find more sources for the chat, maybe they are faster

________
George, M
 
Remember that the application objects try to reside in the RAM of the server. If all of the chat messages are there, it will begin to bog down with heavy use possibly. Instead of adding an element to the user's object, why not have one ponter to their last message and replace it with their newest message each time? Why store all of their messages? Also, why an application object rather than a session object? The application object uses the memory allocation even after the user's session is over - wasteful.

Of course, using a DB table should solve all of those issues...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 

Hi all,

I am not storing all the messages in the application object. Rather I store only 20 last messages.The 21st will replce an existing msg.

Similarly I kick out inactive users after every 10 min.And if the chat room is empty then the application objects are destroyed. I thought I took enough care not to let the Dictionary grow very huge.

But somehow the CPU is showing 100% usage. Unfortunate...

You guys used a database. How helpful will it be with the above conditions implemented. I don't have any choice other than ASP. Please tell me switching to database will help or not.

Chao!
SWeta
 
Hrmm i could bet that you have AMD processor...
It hapens all time on AMD to keep 100% processor usage even if system works fine.

________
George, M
 
I don't see where a DB chat room would be bogged down by 20 people...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top