ArticleDirectory
- Single Object response
- List object response
- High connection concurrency
Ms provides iocp support for. Net socket Asynchronization. For the iocp model, I believe all the friends who have worked on network applications know their performance. But what is the performance of. Net After packaging? The following are the results of the. NET socket throughput test. The test server configuration is core e4300 1.8 GB 2 GB memory win2003sp2. The configuration seems a bit old, but it is easier to reflect the performance of. Net socket.
Single Object response
The client initiates a request. After the server responds, the client initiates the next request.
Request object
Public class get: iMessage {Public String ID ;}
Response object
Getresponse response = new getresponse (); response. user = new user (); response. user. name = "henryfan"; response. user. e-mail = "henryfan@msn.com"; response. user. city = "Guangzhou"; response. user. counrty = "China"; response. user. id = 2324; response. user. age = 45; response. user. birthday = 45454545; response. user. enabled = true; response. user. fdata = 4454.45f; response. user. dData = 34343242.242;
Test results for different connections
List object response
The client initiates a request. After the server responds, the client initiates the next request.
Request object
Class request: iMessage {}
Response object
Response response = new response (); For (INT I = 0; I <5; I ++) {order = New Order (); Order. orderid = 10248; Order. customerid = "wilmk"; Order. employeeid = 5; Order. orderdate = 629720352000000000; Order. requireddate = 629744544000000000; Order. shipaddress = "59 Rue de l 'abbaye"; Order. shipcity = "Reims"; Order. shipcountry = "France"; Order. shipname = "Vins et alcools chevalier"; Order. shippostalcodes = "51100"; Order. shipregion = "RJ"; response. orders. add (order );}
Test Results
Limited bandwidth, so only 1000 connections can be tested
High connection concurrency
The client sends a request every second.
Request object
Register = new register (); register. Username = "henryfan"; register. Email = "henryfan@msn.com ";
Response object
User user = new user (); User. name = "henryfan"; user. email = "henryfan@msn.com"; user. city = "Guangzhou"; user. counrty = "China"; user. id = 2324; user. age = 45; user. birthday = 45454545; user. enabled = true; user. fdata = 4454.45f; user. dData = 34343242.242;
Test results of different connections
from the data obtained above ,. the socket throughput capability provided by net is still very good. The conservative computation in the case that the average household PC has full load five years ago can also process the IO operations of 5 W send + 5 W receive. Why is it conservative, because the above test involves not only socket throughput, but also protocol analysis object serialization and so on. According to the subsequent tests, the number of connections is not the main factor affecting the performance. It can be said that there are very few impacts, so there is no need to pay attention to the number of connections during the design; in some communication processes, many people are concerned about this as soon as possible. After reading this result, I believe it is correct. net socket throughput capabilities do not know friends should be generally understand, need to do this application friends make good use of it, its performance is really good.