PikaLabs / floyd

A raft consensus implementation that is simply and understandable
GNU General Public License v3.0
321 stars 106 forks source link

improve floyd performance #3

Open baotiao opened 7 years ago

baotiao commented 7 years ago

I have wrote a simple test to get the performance of floyd

write 10000 cost time microsecond(us) 8136502, qps 1229
      Node           | Role    |   Term    | CommitIdx |    Leader         |  VoteFor          | LastLogTerm | LastLogIdx | LastApplyIdx |
      127.0.0.1:8901      leader          2      10000       127.0.0.1:8901         127.0.0.1:8901            2      10000      10000
      127.0.0.1:8902    follower          2      10000       127.0.0.1:8901         127.0.0.1:8901            2      10000      10000
      127.0.0.1:8903    follower          2      10000       127.0.0.1:8901         127.0.0.1:8901            2      10000      10000
      127.0.0.1:8904    follower          2      10000       127.0.0.1:8901         127.0.0.1:8901            2      10000      10000
      127.0.0.1:8905    follower          2      10000       127.0.0.1:8901         127.0.0.1:8901            2      10000      10000

write 10000 cost time microsecond(us) 8325906, qps 1201
      Node           | Role    |   Term    | CommitIdx |    Leader         |  VoteFor          | LastLogTerm | LastLogIdx | LastApplyIdx |
      127.0.0.1:8901      leader          2      20000       127.0.0.1:8901         127.0.0.1:8901            2      20000      20000
      127.0.0.1:8902    follower          2      20000       127.0.0.1:8901         127.0.0.1:8901            2      20000      20000
      127.0.0.1:8903    follower          2      20000       127.0.0.1:8901         127.0.0.1:8901            2      20000      20000
      127.0.0.1:8904    follower          2      20000       127.0.0.1:8901         127.0.0.1:8901            2      20000      20000
      127.0.0.1:8905    follower          2      20000       127.0.0.1:8901         127.0.0.1:8901            2      20000      20000

it's qps is about 1000+, it is to low, so we had better to improve it

baotiao commented 7 years ago

right now, it's qps is about 1.2w. However, it still has very large room for improving.