We have made a lot of tests on different PCs and optimized MsgCommunicator for working under high load. We tested MsgCommunicator for hours for high numbers of simultaneous connections (up to 100,000), and high numbers of messages. You can perform such test on the greater number if you have enough time to wait a result and enough RAM on your PC. Also, MsgCommunicator was stress-tested on messaging in high load parallel mode (up to 1,500 parallel connecting/messaging/disconnecting, it is the maximum allowed number on the single PC).
All tests were made on typical workstations which have not optimal configuration to work as server. CPUs were AMD Athlon XP 2000+ 1.25GHz, Intel Celeron M380 1.6GHz, Intel Pentium4 2.4GHz; RAM 512 MB or 1GB. OS was the same: Windows XP Pro SP2. Results were equal or slight differ in most cases, so there is no reason to publish them for each configuration. We'll give generalized results only which would hold in most cases.
Speed.
Create/Connect/Logon average speed is about 13 users per second and there is no slowdown up to 5,000 connected clients. Average Create/Connect/Logon speed on 100,000 clients test is about 4 users per second. This slowdown is caused by OS processes of memory usage and winsockets' work. As the result of code optimizations made in MsgCommunicator v.3.00, no any internal slowdowns were discovered such as working with internal memory structures or with users database (even working with "users.all" file, appending a new user takes a much lesser time in comparison with network communication time of connecting/registering/logon process).
A compilation made by Delphi 2006 or newer compiler works up to 20% faster than any one made by Delphi 7 or older compiler due new memory manager is more optimal.
Sending/Receiving messages processing average speed (measured as client sending time + server processing and receiving time, all messages are from different users) is about 63 messages per second. This speed does not depend on the number of simultaneously connected clients in practice, i.e. server will process clients messaging with this speed in case of 1,000 connected clients as well as in case of 100,000 clients.
Memory usage.
Test on 10,000 clients gives memory usage on the server: 34,760 KB; on the client: 18,952 KB. Messaging in this mode of holding 10,000 connections increases memory usage on the value of 8 KB on the server as well as on the client.
On the 100,000 simultaneously connected users, server uses 328,180 KB RAM, and client uses 160,552 KB without messaging. Memory usages on messaging in this mode are 328,204 KB for server and 160,556 KB for client.
Server memory usage can be essentially decreased by using a database module. In this case users' database is stored on the disk while without a database module MsgCommunicator needs about 2 KB RAM per each user to store user details. So, with Accuracer Database Module server uses 110,256 KB RAM only on the 100,000 concurrent connections.
As we wrote above, new memory manager in Delphi 2006 and newer compilers works more optimal and memory usage is about 0.3% less than with Delphi 7 and older compilers. For example, server without database module compiled in Delphi 2006 takes 327,208 KB RAM instead of 328,180 KB for compilation made in Delphi 7.
We recommend to have 4 Kbytes free RAM on the server for each of registered user in case of working without database module and 1.5 Kbytes free RAM per simultaneously connected user on the server in case you work with Accuracer Database Module.
For example, if you plan to have 100,000 users without database module, you need 400 MB RAM on server, so any usual PC with 512 MB RAM can be successfully used for this purpose. In case you need to hold 1 million users and your investigations show that maximum simultaneously connected number will be 100,000, you should run the server on the machine with 4GB RAM if you would not like to work in database mode, but in case of using Accuracer Database Module you need only 150 MB RAM.
Also, note that on old Delphi / C++ Builder versions work with memory limited by 2GB (MAXINT value), so you can compile server which can hold more than 500,000 clients without database module in new IDEs only. Here you can learn details about MsgCommunicator Database Modules and the benefits they bring.
Moreover, in old IDEs (Delphi 2005, Delphi 7 and older), memory usage will be slight greater and speed will be slower (up to 15%) due the old memory manager they use. Database modules work more stable on huge connection numbers with new memory manager in Delphi 2006.
Using proprietary protocol based on UDP, MsgCommunicator can hold up to 231 (more than 2 billions) simultaneous connections. A real number depends on your system and requirements. You can download our test programs to investigate them for free.
|