|
This document discusses Unity Multiuser Server load testing and performance issues, and presents two laboratory load test results. The results listed here are provided as a convenience, and do not imply a guarantee of Unity Multiuser Server's actual capacity in a specific customer environment.
Users wishing to conduct their own load tests should download the Unity Automated Test Client.
The number of clients supported by Unity Multiuser Server depends on the memory and processor speed of the machine on which the server is running. Specifically, the amount of memory allocated to the JVM and the amount of processor time availbable to the server can greatly affect performance. Other programs running on the machine such as web servers and databases will reduce both the number of supported clients and communication time. In general, Unity Multiuser Server can effortlessly handle 300-400 clients indefinitely. However, system specifications and adjustments can increase that limit dramatically. In laboratory tests, Unity 2 Multiuser Server has been shown to support as many as 2000 client connections (test results are presented below).
Unity 2 Multiuser Server uses native threads by default. Every system has a hard limit on the number of threads it can create and manage. Hitting the systems's thread limit causes errors in Unity 2 Multiuser Server, which requires two threads per client, plus approximately 50 incidental threads. For example, to handle 400 client connections, the system must support approximately 850 threads for Unity alone, plus threads required by other programs. To circumvent the system thread limit, some JVMs offer "green threads", which are run internally by the JVM. In the future, Unity 3 will use Java's NIO to manage client connections, which will effectively remove the thread limit issue.
The basic rule for resource usage is: clients and rooms consume memory while communications take up processing power. So for applications that must support many clients with minimal communication (eg. a ticker that updates clients every 10 seconds) then memory and thread limits are the key factors. For applications that are message intensive for few clients (eg. games) then processing power will be the principle bottleneck.
The Zephyr parser is a custom UPC parser that drastically improves message processing performance. It was developed as a native feature of Unity 3 servers, but is also built-in to the Professional edition of Unity Multiuser Server, Version 2.0.2.
With the Zephyr parser, server-side message processing is virtually eliminated as a contributor to message round-trip time (i.e., the time it takes a message to travel from a client to the server and back to the client again).
For example, suppose 1000 clients are connected to the server, and all clients send a message to the server at roughly the same time. Assuming that network and client processing time contributes 300 milliseconds to the round-trip time of each message, then the following total round-trip times would be expected, based on the laboratory tests presented later in this article:
- Without Zephyr Parser: 1472ms
- With Zephyr Parser: 300.063ms
With the Zephyr parser in use, the server takes less than a millisecond to process the message, and the total round-trip time is virtually unaffected. Without the Zephyr parser in use, the server takes 1172 milliseconds to parse the message, contributing over 80% of the total round-trip time.
Versions of Unity Multiuser Server without the Zephyr parser include:
- Unity 2.0.2 Express Licence
- Any version older than 2.0.2 (e.g., 2.0.1 and 2.0.0)
Internally, Unity Multiuser Server is stress-tested with an automated test client that can generate thousands of connections and messages. The Unity Automated Test Client is available for download here. The automated test client provides a rough approximation of a real user load. Actual applications will have specific memory uses and communication that cannot be simulated with an automated test client. Therefore, we strongly encourage all customers to load test their applications with real-world users before publishing them live.
In the following two automated load test results, Unity 2 Multiuser Server (version 2.0.2) was running on a Pentium 4-2.6Ghz with 768Mb of RAM allocated to the JVM. The JVM used was Sun's Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03). The client was running on an IBM Thinkpad T41 with a Pentium-M 1.6Ghz processor and 450MB of RAM allocated to the JVM.
The automated test client performed the following tasks:
- Connect 100 clients
- Have each client send 1 message
- Wait for the server to respond to all messages
- Repeat until failure (out of memory or threads).
2005-02-18 11:11:48,343 WARN - Messages Processed: 100
2005-02-18 11:11:48,343 WARN - Average Process Time: 0.16
2005-02-18 11:11:48,343 WARN - Total Connected to Server: 100
2005-02-18 11:11:48,500 WARN - ---------------------
2005-02-18 11:11:48,500 WARN - Resetting Test
2005-02-18 11:11:48,500 WARN - ---------------------
2005-02-18 11:11:59,031 WARN - Messages Processed: 200
2005-02-18 11:11:59,031 WARN - Average Process Time: 4.395
2005-02-18 11:11:59,031 WARN - Total Connected to Server: 200
2005-02-18 11:11:59,312 WARN - ---------------------
2005-02-18 11:11:59,312 WARN - Resetting Test
2005-02-18 11:11:59,312 WARN - ---------------------
2005-02-18 11:12:09,859 WARN - Messages Processed: 300
2005-02-18 11:12:09,859 WARN - Average Process Time: 0.203
2005-02-18 11:12:09,859 WARN - Total Connected to Server: 300
2005-02-18 11:12:10,046 WARN - ---------------------
2005-02-18 11:12:10,046 WARN - Resetting Test
2005-02-18 11:12:10,046 WARN - ---------------------
2005-02-18 11:12:20,593 WARN - Messages Processed: 400
2005-02-18 11:12:20,593 WARN - Average Process Time: 0.195
2005-02-18 11:12:20,593 WARN - Total Connected to Server: 400
2005-02-18 11:12:20,875 WARN - ---------------------
2005-02-18 11:12:20,875 WARN - Resetting Test
2005-02-18 11:12:20,875 WARN - ---------------------
2005-02-18 11:12:31,343 WARN - Messages Processed: 500
2005-02-18 11:12:31,343 WARN - Average Process Time: 0.302
2005-02-18 11:12:31,343 WARN - Total Connected to Server: 500
2005-02-18 11:12:31,578 WARN - ---------------------
2005-02-18 11:12:31,578 WARN - Resetting Test
2005-02-18 11:12:31,578 WARN - ---------------------
2005-02-18 11:12:42,109 WARN - Messages Processed: 600
2005-02-18 11:12:42,109 WARN - Average Process Time: 0.026
2005-02-18 11:12:42,109 WARN - Total Connected to Server: 600
2005-02-18 11:12:42,421 WARN - ---------------------
2005-02-18 11:12:42,421 WARN - Resetting Test
2005-02-18 11:12:42,421 WARN - ---------------------
2005-02-18 11:12:52,875 WARN - Messages Processed: 700
2005-02-18 11:12:52,875 WARN - Average Process Time: 0.11
2005-02-18 11:12:52,875 WARN - Total Connected to Server: 700
2005-02-18 11:12:53,125 WARN - ---------------------
2005-02-18 11:12:53,125 WARN - Resetting Test
2005-02-18 11:12:53,125 WARN - ---------------------
2005-02-18 11:13:03,640 WARN - Messages Processed: 800
2005-02-18 11:13:03,640 WARN - Average Process Time: 0.099
2005-02-18 11:13:03,640 WARN - Total Connected to Server: 800
2005-02-18 11:13:03,953 WARN - ---------------------
2005-02-18 11:13:03,953 WARN - Resetting Test
2005-02-18 11:13:03,953 WARN - ---------------------
2005-02-18 11:13:14,343 WARN - Messages Processed: 900
2005-02-18 11:13:14,343 WARN - Average Process Time: 0.034
2005-02-18 11:13:14,343 WARN - Total Connected to Server: 900
2005-02-18 11:13:14,671 WARN - ---------------------
2005-02-18 11:13:14,671 WARN - Resetting Test
2005-02-18 11:13:14,671 WARN - ---------------------
2005-02-18 11:13:25,171 WARN - Messages Processed: 1000
2005-02-18 11:13:25,171 WARN - Average Process Time: 0.063
2005-02-18 11:13:25,171 WARN - Total Connected to Server: 1000
2005-02-18 11:13:25,500 WARN - ---------------------
2005-02-18 11:13:25,500 WARN - Resetting Test
2005-02-18 11:13:25,500 WARN - ---------------------
2005-02-18 11:13:35,953 WARN - Messages Processed: 1100
2005-02-18 11:13:35,953 WARN - Average Process Time: 0.057
2005-02-18 11:13:35,953 WARN - Total Connected to Server: 1100
2005-02-18 11:13:36,125 WARN - ---------------------
2005-02-18 11:13:36,125 WARN - Resetting Test
2005-02-18 11:13:36,125 WARN - ---------------------
2005-02-18 11:13:46,828 WARN - Messages Processed: 1200
2005-02-18 11:13:46,828 WARN - Average Process Time: 0.039
2005-02-18 11:13:46,828 WARN - Total Connected to Server: 1200
2005-02-18 11:13:47,062 WARN - ---------------------
2005-02-18 11:13:47,062 WARN - Resetting Test
2005-02-18 11:13:47,062 WARN - ---------------------
2005-02-18 11:13:57,750 WARN - Messages Processed: 1300
2005-02-18 11:13:57,750 WARN - Average Process Time: 0.024
2005-02-18 11:13:57,750 WARN - Total Connected to Server: 1300
2005-02-18 11:13:57,875 WARN - ---------------------
2005-02-18 11:13:57,875 WARN - Resetting Test
2005-02-18 11:13:57,875 WARN - ---------------------
2005-02-18 11:14:08,578 WARN - Messages Processed: 1400
2005-02-18 11:14:08,578 WARN - Average Process Time: 0.088
2005-02-18 11:14:08,578 WARN - Total Connected to Server: 1400
2005-02-18 11:14:08,812 WARN - ---------------------
2005-02-18 11:14:08,812 WARN - Resetting Test
2005-02-18 11:14:08,812 WARN - ---------------------
2005-02-18 11:14:19,312 WARN - Messages Processed: 1500
2005-02-18 11:14:19,312 WARN - Average Process Time: 0.073
2005-02-18 11:14:19,312 WARN - Total Connected to Server: 1500
2005-02-18 11:14:19,546 WARN - ---------------------
2005-02-18 11:14:19,546 WARN - Resetting Test
2005-02-18 11:14:19,546 WARN - ---------------------
2005-02-18 11:14:36,218 WARN - Messages Processed: 1600
2005-02-18 11:14:36,218 WARN - Average Process Time: 0.097
2005-02-18 11:14:36,218 WARN - Total Connected to Server: 1600
2005-02-18 11:14:36,484 WARN - ---------------------
2005-02-18 11:14:36,484 WARN - Resetting Test
2005-02-18 11:14:36,484 WARN - ---------------------
2005-02-18 11:14:53,531 WARN - Messages Processed: 1700
2005-02-18 11:14:53,531 WARN - Average Process Time: 0.028
2005-02-18 11:14:53,531 WARN - Total Connected to Server: 1700
2005-02-18 11:14:53,765 WARN - ---------------------
2005-02-18 11:14:53,765 WARN - Resetting Test
2005-02-18 11:14:53,765 WARN - ---------------------
2005-02-18 11:15:07,687 WARN - Messages Processed: 1800
2005-02-18 11:15:07,687 WARN - Average Process Time: 0.043
2005-02-18 11:15:07,687 WARN - Total Connected to Server: 1800
2005-02-18 11:15:07,875 WARN - ---------------------
2005-02-18 11:15:07,875 WARN - Resetting Test
2005-02-18 11:15:07,875 WARN - ---------------------
2005-02-18 11:15:33,437 WARN - Messages Processed: 1900
2005-02-18 11:15:33,437 WARN - Average Process Time: 0.065
2005-02-18 11:15:33,437 WARN - Total Connected to Server: 1900
2005-02-18 11:15:33,687 WARN - ---------------------
2005-02-18 11:15:33,687 WARN - Resetting Test
2005-02-18 11:15:33,687 WARN - ---------------------
2005-02-18 11:16:23,687 WARN - Messages Processed: 2000
2005-02-18 11:16:23,687 WARN - Average Process Time: 0.062
2005-02-18 11:16:23,687 WARN - Total Connected to Server: 2000
2005-02-18 11:16:24,000 WARN - ---------------------
2005-02-18 11:16:24,000 WARN - Resetting Test
2005-02-18 11:16:24,000 WARN - ---------------------
2005-02-18 11:16:38,546 WARN - Total Process Time: 111
2005-02-18 11:16:38,546 WARN - Messages Processed: 2100
2005-02-18 11:16:38,546 WARN - Average Process Time: 0.053
2005-02-18 11:16:38,546 WARN - Total Connected to Server: 2100
Test ends due to inability to create new native system threads.
The following test shows the performance of Unity 2.0.2 without the Zephyr parser. These results apply to Unity Multiuser Server Express Licence only (the Professional Licence includes the Zephyr parser). Furthermore, as noted earlier, all versions of Unity Multiuser Server older than 2.0.2 (i.e., 2.0.1 and 2.0.0) do not include the Zephyr parser.
2005-02-19 11:12:33,671 WARN - Messages Processed: 100
2005-02-19 11:12:33,671 WARN - Average Process Time: 371
2005-02-19 11:12:33,671 WARN - Total Connected to Server: 100
2005-02-19 11:12:33,843 WARN - ---------------------
2005-02-19 11:12:33,843 WARN - Resetting Test
2005-02-19 11:12:33,843 WARN - ---------------------
2005-02-19 11:12:44,359 WARN - Messages Processed: 200
2005-02-19 11:12:44,359 WARN - Average Process Time: 246
2005-02-19 11:12:44,359 WARN - Total Connected to Server: 200
2005-02-19 11:12:44,500 WARN - ---------------------
2005-02-19 11:12:44,500 WARN - Resetting Test
2005-02-19 11:12:44,500 WARN - ---------------------
2005-02-19 11:12:55,031 WARN - Messages Processed: 300
2005-02-19 11:12:55,031 WARN - Average Process Time: 372
2005-02-19 11:12:55,031 WARN - Total Connected to Server: 300
2005-02-19 11:12:55,171 WARN - ---------------------
2005-02-19 11:12:55,171 WARN - Resetting Test
2005-02-19 11:12:55,171 WARN - ---------------------
2005-02-19 11:13:08,765 WARN - Messages Processed: 400
2005-02-19 11:13:08,765 WARN - Average Process Time: 328
2005-02-19 11:13:08,765 WARN - Total Connected to Server: 400
2005-02-19 11:13:08,953 WARN - ---------------------
2005-02-19 11:13:08,953 WARN - Resetting Test
2005-02-19 11:13:08,953 WARN - ---------------------
2005-02-19 11:13:25,468 WARN - Messages Processed: 500
2005-02-19 11:13:25,468 WARN - Average Process Time: 543
2005-02-19 11:13:25,468 WARN - Total Connected to Server: 500
2005-02-19 11:13:25,640 WARN - ---------------------
2005-02-19 11:13:25,640 WARN - Resetting Test
2005-02-19 11:13:25,640 WARN - ---------------------
2005-02-19 11:13:45,203 WARN - Messages Processed: 600
2005-02-19 11:13:45,203 WARN - Average Process Time: 694
2005-02-19 11:13:45,203 WARN - Total Connected to Server: 600
2005-02-19 11:13:45,468 WARN - ---------------------
2005-02-19 11:13:45,468 WARN - Resetting Test
2005-02-19 11:13:45,468 WARN - ---------------------
2005-02-19 11:14:13,937 WARN - Messages Processed: 700
2005-02-19 11:14:13,937 WARN - Average Process Time: 705
2005-02-19 11:14:13,937 WARN - Total Connected to Server: 700
2005-02-19 11:14:14,125 WARN - ---------------------
2005-02-19 11:14:14,125 WARN - Resetting Test
2005-02-19 11:14:14,125 WARN - ---------------------
2005-02-19 11:15:30,796 WARN - Messages Processed: 800
2005-02-19 11:15:30,796 WARN - Average Process Time: 592
2005-02-19 11:15:30,796 WARN - Total Connected to Server: 800
2005-02-19 11:15:30,968 WARN - ---------------------
2005-02-19 11:15:30,984 WARN - Resetting Test
2005-02-19 11:15:30,984 WARN - ---------------------
2005-02-19 11:16:59,656 WARN - Messages Processed: 900
2005-02-19 11:16:59,656 WARN - Average Process Time: 961
2005-02-19 11:16:59,656 WARN - Total Connected to Server: 900
2005-02-19 11:16:59,796 WARN - ---------------------
2005-02-19 11:16:59,796 WARN - Resetting Test
2005-02-19 11:16:59,796 WARN - ---------------------
2005-02-19 11:19:10,578 WARN - Messages Processed: 1000
2005-02-19 11:19:10,578 WARN - Average Process Time: 1172
2005-02-19 11:19:10,578 WARN - Total Connected to Server: 1000
2005-02-19 11:19:10,750 WARN - ---------------------
2005-02-19 11:19:10,750 WARN - Resetting Test
2005-02-19 11:19:10,750 WARN - ---------------------
2005-02-19 11:23:15,828 WARN - Messages Processed: 1100
2005-02-19 11:23:15,828 WARN - Average Process Time: 1318
2005-02-19 11:23:15,828 WARN - Total Connected to Server: 1100
Test ends due to client becoming unresponsive.
|