|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Complaints about laggingOn my Pentium quadcore machine an A/V Chat is running on Red5. The server has 4 gigabyte RAM. On peaks there are up to 400-500 people online in the main room.
Lots of them complain about lagging. Which means they type something and it takes a long time until it has been sent into the room and appears on the screen.
Now i dont want to spent money to fix the wrong problem here, so I am wondering what would be the most probable issue causing this?
Lack of bandwidth (100mbps, shared though, bot most of it available) or CPU (I have seen the java process spiking up to 140% while overall load average is within its appropriate ranges) or RAM?
Memory swapping is almost non existant (below 1 MB) so I would expect more swapping if the RAM was the cause. However I dont know if that expectation is correct. So if I have to invest into a larger server, I would like to know exactly which components I should improve. _______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
|
|
Re: Complaints about laggingIf your chat client code manually iterates and
sends out the data, it will have to wait for (NUmClients * AveragePingTime)
minus the sender clients position in the red5 list-of-clients.
If you create another pure data broadcast-stream
and take the chat data to form a proper 'invoke', then red5 threadpool will take
care of the data distribution. THen though, lag will be determined by the
subscribers buffertime.
Conversly, you could create a thread whose only job
was to deliver chat to a single client and spin off a bunch of threads to do the
distribution.
THere is really far to liitle information to help
fully diagnose your latency.
_______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
|
|
Re: Complaints about laggingIf don't have lag when there are only a few people in the room, then
it's an implementation problem. Like Andy said somewhere in the code there is probably a loop. Use the dedicated invokeOnAllConnections method for broadcasting messages or a shared object. -- VOD & visioconference - http://www.digiprof.tv _______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
|
|
Re: Complaints about laggingAre you using
- MultiThreadedApplicationAdapter
- jconsole to see if java isn't doing GC's every 3
seconds
- monitoring of cpu and network load in graphs so
you actually can see if there was a serious load yesterday morning at a certain
point
Is your client capable of handling 500 users in a
single chat ? How's the cpu usage on your client. I can remember that one day
when Quake 1 was released a certain IRC channel had like 5000 users in it and
the IRC-client was spiking to 100% cpu since there were like 50 incoming
messages per second resulting in lag and eventually a
disconnection.
W.
_______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
|
|
Re: Complaints about laggingThanks for all your responses so far.
As this is a commercial chat software I cant say much about it. As far as I know it uses the MultiThreadedApplicationAdapter.
I havent used JConsole before but I will try and see if I can get it to work. Maybe it helps in resolving the issue. GC is an important keyword. I will see if adding some Java arguments will improve the situation. I had this before:
"-XX:+UseParallelGC -XX:+UseParallelOldGC -XX:ThreadStackSize=256k -Xmn500M -Xrs -Xms1g -Xss128K -XX:NewSize=256m -XX:SurvivorRatio=16 -XX:MinHeapFreeRatio=20 -XX:+AggressiveHeap -XX:+ExplicitGCInvokesConcurrent -Dsun.rmi.dgc.client.gcInterval=990000 -Dsun.rmi.dgc.server.gcInterval=990000 -Djava.net.preferIPv4Stack=true -Xverify:none"
But with that it seems that the server was only able to handle even less connections. So I got back to "-XX:+UseParallelGC -XX:+UseParallelOldGC" only. Adding a large interval for GC might be a good idea.
I know the load is high on the server and I dont mind upgrading it or switch to a new server but I want to spend the money for the right thing to improve. If it turns out to be a RAM problem I want to spend the money on RAM and not on CPU. But if this is the problem I would rather spend it on CPU than on RAM. Thats why I try to figure out which resouces are the ones consumed by Red5. Von: Walter Tak <walter@...> An: red5@... Gesendet: Donnerstag, den 5. November 2009, 4:57:06 Uhr Betreff: Re: [Red5] Complaints about lagging Are you using
- MultiThreadedApplicationAdapter
- jconsole to see if java isn't doing GC's every 3 seconds
- monitoring of cpu and network load in graphs so you actually can see if there was a serious load yesterday morning at a certain point
Is your client capable of handling 500 users in a single chat ? How's the cpu usage on your client. I can remember that one day when Quake 1 was released a certain IRC channel had like 5000 users in it and the IRC-client was spiking to 100% cpu since there were like 50 incoming messages per second resulting in lag and eventually a disconnection.
W.
_______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
|
|
Re: Complaints about laggingResources in use are more or less very
application-specific.
Start creating graphs of your servers with
monitoring tools like MRTG or Cactii. I use MRTG (RRDTool to be exact) to record
every 5 minutes various characteristics of my servers:
1. incoming and outgoing bandwidth
2. load for each core
3. load avg for 1,5 and 15 mins
4. available free memory, in use
6. size of swapdisk in use
7. diskspace in use
8. disk I/O / interrupts
9. cpu usage in % for user and system
And inside a custom webapplication you could write
a number of concurrent connections to a file at intervals and then graph that
number with RRDTool so you have near perfect insight in what your server is
doing at what time.
If you need more information then you could take a
look at the JMXManager ; see http://www.red5.org/wiki/Tools/JMXManager for
an Excellent Article by Daniel Rossi who's also very active on this list. He's
the expert on those matters imho.
W.
_______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
|
|
Re: Complaints about laggingMaybe I should add that the complaints are only about the time between a text has been entered until it appears. No complaints about problems with voice or video. So if it would be bandwidth related problem I believe video and audio shold be affected as well in some way.
Now after setting a value for GC again, for me it seems again, that there are more and earlier complaints. With GC set around 200 users until complaints, without GCspecified, I often see 400 users and almost no complaints.
Still this is a bit weird to me.
From your point of view, how should I set the JAVA_OPTS to be optimal for both Text and Voice/Video?
Von: Alex Weiher <nabble_alex@...> An: red5@... Gesendet: Donnerstag, den 5. November 2009, 10:06:49 Uhr Betreff: Re: [Red5] Complaints about lagging Thanks for all your responses so far.
As this is a commercial chat software I cant say much about it. As far as I know it uses the MultiThreadedApplicationAdapter.
I havent used JConsole before but I will try and see if I can get it to work. Maybe it helps in resolving the issue. GC is an important keyword. I will see if adding some Java arguments will improve the situation. I had this before:
"-XX:+UseParallelGC -XX:+UseParallelOldGC -XX:ThreadStackSize=256k -Xmn500M -Xrs -Xms1g -Xss128K -XX:NewSize=256m -XX:SurvivorRatio=16 -XX:MinHeapFreeRatio=20 -XX:+AggressiveHeap -XX:+ExplicitGCInvokesConcurrent -Dsun.rmi.dgc.client.gcInterval=990000 -Dsun.rmi.dgc.server.gcInterval=990000 -Djava.net.preferIPv4Stack=true -Xverify:none"
But with that it seems that the server was only able to handle even less connections. So I got back to "-XX:+UseParallelGC -XX:+UseParallelOldGC" only. Adding a large interval for GC might be a good idea.
I know the load is high on the server and I dont mind upgrading it or switch to a new server but I want to spend the money for the right thing to improve. If it turns out to be a RAM problem I want to spend the money on RAM and not on CPU. But if this is the problem I would rather spend it on CPU than on RAM. Thats why I try to figure out which resouces are the ones consumed by Red5. Von: Walter Tak <walter@...> An: red5@... Gesendet: Donnerstag, den 5. November 2009, 4:57:06 Uhr Betreff: Re: [Red5] Complaints about lagging Are you using
- MultiThreadedApplicationAdapter
- jconsole to see if java isn't doing GC's every 3 seconds
- monitoring of cpu and network load in graphs so you actually can see if there was a serious load yesterday morning at a certain point
Is your client capable of handling 500 users in a single chat ? How's the cpu usage on your client. I can remember that one day when Quake 1 was released a certain IRC channel had like 5000 users in it and the IRC-client was spiking to 100% cpu since there were like 50 incoming messages per second resulting in lag and eventually a disconnection.
W.
_______________________________________________ Red5 mailing list Red5@... http://osflash.org/mailman/listinfo/red5_osflash.org |
| Free embeddable forum powered by Nabble | Forum Help |