Performance Comparison Between Restful and TCP call methods in WCF, wcfrestful

Source: Internet
Author: User

Performance Comparison Between Restful and TCP call methods in WCF, wcfrestful

1. Lab background
For the distributed access service provided by WCF, the two most common methods are Restful and Tcp.
The results show that the Rest mode is the best performance in stress testing.
In addition, it is considered to be cross-platform, and automated testing is convenient. It also uses the Restful method to provide services.

2. Features of the WCF Service:
This service provides real-time and unified serial numbers for all clients (CS clients or B/S browsers ).

3. Test Results
Test 1: Provides services based on the Restful method, and the client uses the http route request method to access the service:
Rest service address: http://xxx.xxx.xxx.xxx: 6211/ITSTemplate. Study. RestAPI/SeqService/
Two clients call 100000 times, respectively. Average Call time: 0.59 ~ 0.61 ms, 50 times the performance of TCP (2.66/0.59 ).

Before calling, you can use netstat-aon | findstr "6211". Restful has no client to call the instance.



In the call, you can use netstat-aon | findstr "6211". Restful has two clients to call the instance.



After the call is completed, the last call is completed. About 1 minute later, WCF will automatically release the 6211 port instance created by the server. You can see that the average call time is 0.59 ~ 0.61 Ms



Test 2: Provides services based on the TCP mode. The client uses the Libary interface to reference the class library to access the service:
TCP Service address: net. tcp: // xxx. xxx: 6212/ITSTemplate. Study. RestAPI/SeqService/
Two clients call 100000 times, with an average call time of 2.66 s.
 
Before calling, you can use netstat-aon | findstr "6212". TCP has no client to call the instance.


 
In the call, you can use netstat-aon | findstr "6212". TCPl has two clients to call the instance.



After the call is completed, the last call is completed. About 1 minute later, WCF will automatically release the 6211 port instance created by the server. You can see that the average call time is 2.66 milliseconds.


 
Summary: in the next section, I will test the concurrent performance of REST on a remote ECs instance, and set the response timeout time of REST to 1 second.
In addition, through MQ, the server can handle concurrent requests as much as possible and make asynchronous and asynchronous responses to client service requests.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.