为什么我的 cassandra 插入率在同一主机中 client/node 比在不同主机中的客户端和一个节点更好?

Why is my cassandra insert rate better with a client/node in the same host than with client and one node in separate hosts?

这是这个问题的后续问题:

我的架构目前看起来像这样(blob 的大小大致相同,大约 140 字节):

create keyspace nms WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1 };
use nms;
CREATE TABLE qos(
                hour timestamp,
                qos int,
                id int,
                ts timestamp,
                tz int,
                data blob,
              PRIMARY KEY ((hour, qos), id, ts));

在这两种情况下,我都有一个节点。除了明显的 IP 地址和存储位置外,Apache C* 2.1.5 配置是开箱即用的。

当我 运行 客户端和单独主机中的单个节点时,我得到大约 55K inserts/s。 cfhistograms 输出大致如下所示:

nms/qos histograms
Percentile  SSTables     Write Latency      Read Latency    Partition Size        Cell Count
                              (micros)          (micros)           (bytes)
50%             0.00             86.00              0.00             42510               535
75%             0.00            124.00              0.00             42510               642
95%             0.00            179.00              0.00             61214              1109
98%             0.00            215.00              0.00             61214              1109
99%             0.00            258.00              0.00             61214              1109
Min             0.00              4.00              0.00               150                 3
Max             0.00          61214.00              0.00             61214              1109

当我 运行 客户端与单个节点位于同一主机上时,我得到大约 90K inserts/s。直方图快照看起来像这样(与上面几乎相同):

nms/qos histograms
Percentile  SSTables     Write Latency      Read Latency    Partition Size        Cell Count
                              (micros)          (micros)           (bytes)
50%             0.00             86.00              0.00             42510               535
75%             0.00            103.00              0.00             42510               642
95%             0.00            179.00              0.00             61214              1109
98%             0.00            310.00              0.00             61214              1109
99%             0.00            535.00              0.00             61214              1109
Min             0.00              3.00              0.00               150                 3
Max             0.00         126934.00              0.00             61214              1109

为什么插入率差异如此之大?我原以为拆分设置中的费率会相同或更好?

顺便说一句,我看到这种奇怪的行为与我可用的所有硬件排列有关,所以它不仅仅是客户端马力。

马克 B,你是对的。如果您看到此消息并希望 post 您的评论作为答案,我会为您点赞。

更详细地说,发生的事情是,虽然我的网络连接是 1G,但我正在某处通过一个意外的 100Mb 路由器。一旦我意识到这一点并确保所有移动部件都在同一个 1G 网络中,我的速率就跃升至 180K inserts/s。

万一有人关心,Linux检查接口速度的命令是

sudo ethtool eth0

测试框间速度的工具是iperf