Skip to content

hprose RPC protocol speed #31

@danielsawan

Description

@danielsawan

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

andot commented on Dec 4, 2017

@andot
Member

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

danielsawan

danielsawan commented on Dec 5, 2017

@danielsawan
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

andot commented on Dec 19, 2017

@andot
Member

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

danielsawan commented on Dec 19, 2017

@danielsawan
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

andot commented on Feb 5, 2018

@andot
Member

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

wu-sheng

wu-sheng commented on Feb 11, 2018

@wu-sheng
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @andot@danielsawan@wu-sheng

        Issue actions

          hprose RPC protocol speed · Issue #31 · hprose/hprose-java