We’ve made a little test today with the latest version of AVChat (1059) which has some optimized media server file for Red5.

Old Pentium M @ 1,7Ghz with 1G of RAM we used
Old Pentium M @ 1,7Ghz with 1G of RAM we used

1) We’ve installed Red5 0.8 on an old Toshiba M70 laptop with these specs:

  • Pentium M 1.7Ghz (FSB:400Mhz with 2Mb of 2nd level cache)
  • 1G DDR2 RAM
  • 60GB HDD @ 5400rpm
  • 100Mbps Intel network card
  • Ubuntu 10.04 LTS

which is connected to our LAN via wire.

2) Once Red5 was up and running on the laptop, we used an internal flash app named “AVChat Virtual User” to create load on the Red5 server! This app creates a lot of virtual users, once each user is created it connects to the avchat30 app on the media server. Once connected  it starts  generating the  kind of  load that a normal user would generate: sending text messages, changing status (idle, online), etc… . These virtual users are not able to stream/view video that’s why this quick test today covers AVChat 3 in text chat only mode.

AVChat Virtual User  (not much to it right now)
AVChat Virtual User (not much to it right now)

We will release this app when we polsih it so that anyone can test their own servers!

3) With AVChat Virtual User we’ve gradually connected 550 users (100 -> 450 – >550) and observed the load on Red5.

To monitor Red5 we’ve used several tools:

4) The results: CPU usage

CPU Usage
CPU Usage

5) The results: Memory consumption

Memory consumption
Memory consumption

6) Conclusion:

  • a user connecting generates more CPU usage than a user that is already connected
  • Red5/AVChat 3 uses about 6-7Mb of RAM for each 100 users (in addition to the memory used by Red5 by default)
  • the cheapest VPS servers (256Mb of RAM) can hold a few hundred users online!
  • this server would hold 1000 users (in text chat mode) before reaching 80-90% CPU usage!
  • in a real world scenario you would not have the peak CPU usage caused by connecting 100 very ast ( AVChat Virtual User app connecs 1 user every second )

This is by no means an attempt  to squeeze as much performance as we can out of this server! There are many ways one cand do that first being the choice of OS.

Note: this is not a clear reflection of real world usage as video creates a lot of load on the media server! The video usage on the server creates a lot more load than the number of users online!

Later edit: for tips on how to improov the performance of AVChat on Red5 see this thread on our forum.

2 thoughts on “Cpu and memory usage with AVChat 3 (text chat only mode), Red5 0.8 and a slow server

  1. Radu Cugut says:

    Nice job and very nice post!
    Can I ask how are you handling (in Red5 server) a user right when he’s connecting? I’m trying to build something quite similar with your chat (for online bidding), but I’m having problems when ~100 users try to connect all at once. I start getting errors like “Closing RTMPMinaConnection …. due to long handshake”. As I understand you added the clients one by one?

    Thanks very much

    1. Octavian says:

      We were adding about 1 user /second.
      We have a lot of logic going on when a user connects!

      Maybe you are trying to connect 100 all at once or have a really slow CPU.
      As you can see in the charts handling connections is much more CPU demanding than just “being in the video chat”.

Leave a Reply to Octavian Cancel reply

Your email address will not be published. Required fields are marked *