Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hprose RPC protocol speed #31

Open
danielsawan opened this issue Nov 28, 2017 · 6 comments
Open

hprose RPC protocol speed #31

danielsawan opened this issue Nov 28, 2017 · 6 comments

Comments

@danielsawan
Copy link

Hi there

I made some test in order to benchmark hprose RPC protocol and i was very surprised to see that it is slower then making an http request.

The test i made is really simple i just wrote a hello world http method that answer "hello" to an http get and wrote a client that call it 100 times.

Then i wrote a hrpose server listening on TCP having a helloworld method and call it from an hprose client 100 times.

I monitoring the execution time of both protocol and HTTP protocol win all the time expect when the number of call is above 1000.

I was exepecting that a self made protocole was quicker then HTTP.

Did i made something wrong here ?

@andot
Copy link
Member

andot commented Dec 4, 2017

I don't know what's wrong, but on my computer, http get on tomcat: 2000-3000qps, and tcp hprose server: 80000-100000qps.

@danielsawan
Copy link
Author

can you please try to put your remote method on another host then localhost ? In my test the client was on localhost but both serveur (http, hprose) was on a remote host. So the traffic had to go threw TCP like a prod context.

@andot
Copy link
Member

andot commented Dec 19, 2017

If you use TCP, you can use setFullDuplex method to set the fullDuplex property to true on the client. It will be faster than the default setting.

@danielsawan
Copy link
Author

The change is not hudge. Here is the results i get

10 requests :
duration hpro : 175899988
duration http : 82985343
HTTP WIN

100 requests :
duration hpro : 783401527
duration http : 716310436
HTTP WIN

500 requests :
duration hpro : 3416468571
duration http : 3536256223
HPROSE WIN

1000 requests :
duration hpro : 6644799171
duration http : 6926884271
HPROSE WIN

As i wrote before for a little number of request HTTP seems to be faster (real world situation) but when we loop over hundred of request then Hprose seems to be faster. I guess it is because HTTP Open & Close ressources for each call while Hprose let the connection Opened. But still in my little test HTTP seems to be faster.

@andot
Copy link
Member

andot commented Feb 5, 2018

My test is 1 client, 40 threads, 25000 requests on each thread.

@wu-sheng
Copy link
Member

@andot I think @danielsawan 's tests bring some important info. Limited requests per thread/connection seem more important to me. I suggest you should dive in to find out what is really happening in those cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants