SlideShare a Scribd company logo
Jk.cn
TCPCOPY-Real traffic benchmark tool
TCPCOPY 由网易杭研开源,通过复制网卡端口流量,从而模拟线上真实负载,通过 N 倍放大做到真实环境流量翻倍的效果。
对于日常业务的激增起到一个预测作用。
TCPCOPY 可以直接将流量包复制至 MYSQL database,从而模拟线上 client 包流量的翻倍压力,对于测试机器来说,相当于将线
上机器成倍的增加,从而可以压测出当前 MYSQL DB 所能承受的极限值。对于 SQL 而言,也利于在高压力环境下的问题暴露。
Jk.cn
我们的 TCPCOPY 架构图
Jk.cn
通过直接导入线上流量, 模拟 troy 线上压力
测试环境:
online server : 10.128.6.16 master
test server : 10.128.6.83 clone database
assistant server : 10.128.6.84
在 test server 上增加如下路由信息:
route add -host 10.128.10.68 gw 10.128.6.84
route add -host 10.128.11.96 gw 10.128.6.84
route add -host 10.128.13.97 gw 10.128.6.84
route add -host 10.128.16.59 gw 10.128.6.84
route add -host 10.128.17.109 gw 10.128.6.84
route add -host 10.128.17.99 gw 10.128.6.84
route add -host 10.128.19.142 gw 10.128.6.84
route add -host 10.128.19.150 gw 10.128.6.84
route add -host 10.128.19.160 gw 10.128.6.84
route add -host 10.128.6.17 gw 10.128.6.84
Jk.cn
route add -host 10.128.7.121 gw 10.128.6.84
route add -host 10.128.7.122 gw 10.128.6.84
在 test server 上将线上(online server)上的 mysql client IP 请求全部路由到 assistant server 由 assistant sever 跟 这些 client 机器完
成握手,从而完成整个过程。Test server 本身并不负责这些连接的建立。
Jk.cn
Processing :
Jk.cn
在 assistant server 上开启 intercept 进程
/usr/local/intercept/sbin/intercept -i bond0 -F 'tcp and src port 3307' -p 36525 –d
端口设置为 36525
在 online server 上开启 tcpcopy 进程
tcpcopy -x 3307-10.128.6.83:3307 -s 10.128.6.84:36525 -C 4 -n 50
将本地 3307 端口的流量直接复制到 test server (由 test server 路由至 assistant server, 最后由 assistant server 完成应答) ,实际的
数据包则在 test server 上执行 。
-C tcpcopy 进程与 intercept 进程开启并行通信 –n 将线上流量复制 N 倍
[20:33:26root@a1-tcpcopy-assis /usr/local/intercept/sbin]
#netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
ESTABLISHED 5
TIME_WAIT 30
在 test server 上即可看到实际流量,经测试 –n 100 基本是一个极限值(tcpcopy 没有连接池的概念,所以对 test server 的连接都是短
连接,会引起 DB 层的瞬间连接暴增问题,目前没有好的解决方案)对于 troy 来说本身就是一个超过 4 万 QPS 的应用,而 TCPCOPY
极限压测到 5 万的 QPS 已经是上限了
Jk.cn
Test server load
Jk.cn
Interface Traffic
Jk.cn
下一步计划
按成自动化恢复+自动化压测 (需要实际的 slave 激活成 master, 直接线上 slave 压测存在风险)

More Related Content

PPT
Tcpcopy 阿里技术沙龙
drewz lin
 
PDF
Hadoop compress-stream
Schubert Zhang
 
PDF
JK Log-Center architect
Louis liu
 
PDF
Wdt Test
Louis liu
 
PDF
JKDB BACKUP Introduction
Louis liu
 
PDF
Infiniflash benchmark
Louis liu
 
PDF
MySQL Tokudb engine benchmark
Louis liu
 
PDF
Nvmfs benchmark
Louis liu
 
Tcpcopy 阿里技术沙龙
drewz lin
 
Hadoop compress-stream
Schubert Zhang
 
JK Log-Center architect
Louis liu
 
Wdt Test
Louis liu
 
JKDB BACKUP Introduction
Louis liu
 
Infiniflash benchmark
Louis liu
 
MySQL Tokudb engine benchmark
Louis liu
 
Nvmfs benchmark
Louis liu
 

More from Louis liu (20)

PDF
MySQL 5.7 milestone
Louis liu
 
PDF
MySQL Oslayer performace optimization
Louis liu
 
PDF
MySQL async message subscription platform
Louis liu
 
PDF
HBASE Performane Test
Louis liu
 
PDF
Jkcn MySQLDB 架构
Louis liu
 
PDF
基于Mongodb的压力评测工具 ycsb的一些概括
Louis liu
 
PDF
My sql fabric ha and sharding solutions
Louis liu
 
PDF
NetApp ef540 SSD Storage Test
Louis liu
 
PPTX
Exadata best practice on E-commerce area
Louis liu
 
PDF
MySQL 5.5&5.6 new features summary
Louis liu
 
PDF
Ssd gc review
Louis liu
 
PDF
1号店数据库架构
Louis liu
 
PDF
Architecture of YHD
Louis liu
 
PPT
Oracle dgha
Louis liu
 
PDF
Think of oracle and mysql bind value
Louis liu
 
PDF
ION performance brief hp dl980-8b
Louis liu
 
PDF
How to study oracle by louis liu
Louis liu
 
PDF
Recent my sql_performance Test detail
Louis liu
 
PDF
Advanced tips of dbms statas
Louis liu
 
PDF
MyAWR another mysql awr
Louis liu
 
MySQL 5.7 milestone
Louis liu
 
MySQL Oslayer performace optimization
Louis liu
 
MySQL async message subscription platform
Louis liu
 
HBASE Performane Test
Louis liu
 
Jkcn MySQLDB 架构
Louis liu
 
基于Mongodb的压力评测工具 ycsb的一些概括
Louis liu
 
My sql fabric ha and sharding solutions
Louis liu
 
NetApp ef540 SSD Storage Test
Louis liu
 
Exadata best practice on E-commerce area
Louis liu
 
MySQL 5.5&5.6 new features summary
Louis liu
 
Ssd gc review
Louis liu
 
1号店数据库架构
Louis liu
 
Architecture of YHD
Louis liu
 
Oracle dgha
Louis liu
 
Think of oracle and mysql bind value
Louis liu
 
ION performance brief hp dl980-8b
Louis liu
 
How to study oracle by louis liu
Louis liu
 
Recent my sql_performance Test detail
Louis liu
 
Advanced tips of dbms statas
Louis liu
 
MyAWR another mysql awr
Louis liu
 
Ad

Tcpcopy benchmark

  • 1. Jk.cn TCPCOPY-Real traffic benchmark tool TCPCOPY 由网易杭研开源,通过复制网卡端口流量,从而模拟线上真实负载,通过 N 倍放大做到真实环境流量翻倍的效果。 对于日常业务的激增起到一个预测作用。 TCPCOPY 可以直接将流量包复制至 MYSQL database,从而模拟线上 client 包流量的翻倍压力,对于测试机器来说,相当于将线 上机器成倍的增加,从而可以压测出当前 MYSQL DB 所能承受的极限值。对于 SQL 而言,也利于在高压力环境下的问题暴露。
  • 3. Jk.cn 通过直接导入线上流量, 模拟 troy 线上压力 测试环境: online server : 10.128.6.16 master test server : 10.128.6.83 clone database assistant server : 10.128.6.84 在 test server 上增加如下路由信息: route add -host 10.128.10.68 gw 10.128.6.84 route add -host 10.128.11.96 gw 10.128.6.84 route add -host 10.128.13.97 gw 10.128.6.84 route add -host 10.128.16.59 gw 10.128.6.84 route add -host 10.128.17.109 gw 10.128.6.84 route add -host 10.128.17.99 gw 10.128.6.84 route add -host 10.128.19.142 gw 10.128.6.84 route add -host 10.128.19.150 gw 10.128.6.84 route add -host 10.128.19.160 gw 10.128.6.84 route add -host 10.128.6.17 gw 10.128.6.84
  • 4. Jk.cn route add -host 10.128.7.121 gw 10.128.6.84 route add -host 10.128.7.122 gw 10.128.6.84 在 test server 上将线上(online server)上的 mysql client IP 请求全部路由到 assistant server 由 assistant sever 跟 这些 client 机器完 成握手,从而完成整个过程。Test server 本身并不负责这些连接的建立。
  • 6. Jk.cn 在 assistant server 上开启 intercept 进程 /usr/local/intercept/sbin/intercept -i bond0 -F 'tcp and src port 3307' -p 36525 –d 端口设置为 36525 在 online server 上开启 tcpcopy 进程 tcpcopy -x 3307-10.128.6.83:3307 -s 10.128.6.84:36525 -C 4 -n 50 将本地 3307 端口的流量直接复制到 test server (由 test server 路由至 assistant server, 最后由 assistant server 完成应答) ,实际的 数据包则在 test server 上执行 。 -C tcpcopy 进程与 intercept 进程开启并行通信 –n 将线上流量复制 N 倍 [20:33:26root@a1-tcpcopy-assis /usr/local/intercept/sbin] #netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' ESTABLISHED 5 TIME_WAIT 30 在 test server 上即可看到实际流量,经测试 –n 100 基本是一个极限值(tcpcopy 没有连接池的概念,所以对 test server 的连接都是短 连接,会引起 DB 层的瞬间连接暴增问题,目前没有好的解决方案)对于 troy 来说本身就是一个超过 4 万 QPS 的应用,而 TCPCOPY 极限压测到 5 万的 QPS 已经是上限了
  • 9. Jk.cn 下一步计划 按成自动化恢复+自动化压测 (需要实际的 slave 激活成 master, 直接线上 slave 压测存在风险)