-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
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 ?
Activity
andot commentedon 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 commentedon Dec 5, 2017
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 commentedon Dec 19, 2017
If you use TCP, you can use
setFullDuplex
method to set thefullDuplex
property totrue
on the client. It will be faster than the default setting.danielsawan commentedon Dec 19, 2017
The change is not hudge. Here is the results i get
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 commentedon Feb 5, 2018
My test is 1 client, 40 threads, 25000 requests on each thread.
wu-sheng commentedon Feb 11, 2018
@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.