负载均衡之带宽速率分析

近期的需要做负载均衡,而负载均衡就涉及到资源的利用情况,本文主要分析以下方面的性能评估方式:

  • 网络传输速率
  • 硬盘读写速率
  • 内存读写速率

1 网络传输速率

1. 工具安装 & 使用

网络带宽测试工具有比较多,如 iperf, nuttcp等 ,这里介绍iperf
安装iperf

sudo apt-get install iperf

server

iperf -s

client

iperf -c 10.32.225.37 -d

client 结果

------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 10.32.225.37, TCP port 5001
TCP window size:  255 KByte (default)
------------------------------------------------------------
[  5] local 10.32.225.190 port 53022 connected with 10.32.225.37 port 5001
[  4] local 10.32.225.190 port 5001 connected with 10.32.225.37 port 32906
[ ID] Interval       Transfer     Bandwidth
[  5]  0.0-10.0 sec   616 MBytes   516 Mbits/sec
[  4]  0.0-10.0 sec   860 MBytes   719 Mbits/sec
2.性能分析

A,B都是本地服务器
上行速度 516Mbits/sec ,下行速度 719Mbits/sec
A,C在不同地域的服务器
上行速度是2.7Mbits/sec,下行速度960Kbits/sec

  • 不同地域性能差别很大
  • 虽然是同在域但是上行和下行但是有差别.

2 硬盘的读写速度

dd if=/dev/zero of=file bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.361674 s, 3.0 GB/s

/dev/zero 是一个专用于生成NULL的文件 bs表示一个块大小 count 块数目
硬盘的读写速度3GB/s

3. 内存读写速度

dd if=/dev/zero of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.0484203 s, 22.2 GB/s

内存的读写速度远快于内存.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值