首页 > 代码库 > 基于业务封装API进行Redis服务性能测试记录
基于业务封装API进行Redis服务性能测试记录
背景
开发方面给予redis开源客户端做了二次封装,且做了reids集群部署;ld要求对redis服务性能做一次摸底测试;
测试需求
- 单实例的读写压力极限
- 单机的读写压力极限(可能瓶颈在网卡)
- proxy单实例的压力极限
- proxy单机的压力极限
- 主备的切换的可靠性测试 ------------ 本次未做
- 平滑迁移的有效性 ------------ 本次未做
- 迁移对访问性能的影响(可选) ------------ 本次未做
从上述开发提出的需求看出,本次是以性能验证为主要目的的一次测试;运行场景为通过封装的API,及不同实例配置来验证处理能力;
测试准备工作
1、业务分析;
- 1个proxy实例可能对应多个redis实例;
- 实际业务目前只有一个主实例;
- 理想情况:每个redis实例分别有主、备2个实例;
- 业务调用都是通过redis_access.h文件中的方法来使用的;
- redis_access.h中封装有8个公共方法作为api;
----------- 其实都是拼装命令、参数后使用RAcess::Query来进行执行;
----------- 另外封装有序列化,以及从CA中查询IP端口等方法;读:Get,写:SetNX/Set,删除:Del;其中用的最多的是Get和SetNX;
----------测试时采用Set;
区别:
SetNX对key有判断,如果key存在则不写入;
Set:无论是否存在都进行写入动作;
数据长度,无法确定具体业务长度可能是多少;此处采取两种业务长度
A、1024字节;---- 测试单实例、单机极限;
B、114字节;----- 测试实际业务及各配置实例数的表现;
- 业务模型:
a、 Redis实例进行RDB备份;AOF备份;
RDB:时间间隔内生成数据集的时间点快照;
AOF:实时记录所有的写操作命令和数据; ----- 这个文件会很大,目测是有单读的脚本进行备份等处理;
b、主实例写入后同步给备份实例;主实例挂掉后,JCA切换配置配置中心服务为备份实例的IP端口;
2、用例设计(此处与业务数据一起贴出
a) 采用并发测试,峰值模型;
代理机实例 | redis实例 | 单条数据长度(B) | client | iTotalReq | iReqSucc | iReqFailed | 失败占比 | iAvgReq(/s) | dAvgConTime(s) | dMaxConTime(s) | dMinConTime(s) | iReqLess25ms | <=25ms占比 | iReqLess50ms | (25ms,50ms] | iReqLess100ms | iReqLess200ms | iReqLess300ms | iReqLess400ms | iReqLess500ms | iReqLarger500ms | |||
写 | 写 | 读 | 读 | |||||||||||||||||||||
1 | 1 | 1024 | 0 | 0 | 50 | 50 | 677400 | 677345 | 55 | 0.01% | 67739 | 0.0014705 | 0.003758 | 0.00037 | 677314 | 99.99% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 31 |
1 | 1 | 1024 | 0 | 0 | 100 | 100 | 907357 | 907219 | 138 | 0.02% | 90735 | 0.0021945 | 0.00465 | 0.000415 | 907188 | 99.98% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 31 |
1 | 1 | 1024 | 0 | 0 | 200 | 200 | 1037329 | 1036972 | 357 | 0.03% | 103732 | 0.0038405 | 0.007181 | 0.000303 | 1036950 | 99.96% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 22 |
1 | 1 | 1024 | 0 | 0 | 300 | 300 | 944094 | 943566 | 528 | 0.06% | 47204 | 0.0063335 | 0.009548 | 0.000369 | 943566 | 99.94% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 1 | 1024 | 50 | 50 | 0 | 0 | 595208 | 595142 | 66 | 0.01% | 59520 | 0.001651 | 0.027065 | 0.000405 | 595060 | 99.98% | 75 | 0.01% | 0 | 0 | 0 | 0 | 0 | 7 |
1 | 1 | 1024 | 100 | 100 | 0 | 0 | 878012 | 867846 | 166 | 0.02% | 86800 | 0.002276 | 0.04661 | 0.000565 | 866602 | 98.70% | 1229 | 0.14% | 0 | 0 | 0 | 0 | 0 | 15 |
1 | 1 | 1024 | 200 | 200 | 0 | 0 | 903398 | 903083 | 315 | 0.03% | 90339 | 0.0043955 | 0.051096 | 0.000426 | 899283 | 99.54% | 3541 | 0.39% | 252 | 0 | 0 | 0 | 0 | 7 |
1 | 1 | 1024 | 300 | 300 | 0 | 0 | 839742 | 839238 | 504 | 0.06% | 83973 | 0.007115 | 0.063232 | 0.000368 | 831482 | 99.02% | 7144 | 0.85% | 600 | 0 | 0 | 0 | 0 | 0 |
PS: 单实例600时失败数量已经0.03%,继续加大只会增加失败率;
代理机实例 | redis实例 | 单条数据长度(B) | client(保持读写4:1) | iTotalReq | iReqSucc | iReqFailed | 失败占比 | iAvgReq(/s) | dAvgConTime(s) | dMaxConTime(s) | dMinConTime(s) | iReqLess25ms | <=25ms占比 | iReqLess50ms | (25ms,50ms] | iReqLess100ms | iReqLess200ms | iReqLess300ms | iReqLess400ms | iReqLess500ms | iReqLarger500ms |
1 | 1 | 1024 | 读:160 | 645701 | 645617 | 84 | 0.01% | 64570 | 0.002459 | 0.005615 | 0.000523 | 645617 | 99.99% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | |||
写:40 | 189338 | 189300 | 38 | 0.02% | 18933 | 0.002084 | 0.007453 | 0.000483 | 189300 | 99.98% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 835039 | 834917 | 122 | 0.01% | 83503 | 0.0022715 | 0.007453 | 0.000483 | 834917 | 99.99% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 1 | 1024 | 读:320 | 705176 | 704882 | 294 | 0.04% | 70517 | 0.004518 | 0.009682 | 0.00027 | 704882 | 99.96% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | |||
写:80 | 216001 | 215927 | 74 | 0.03% | 21600 | 0.003667 | 0.009511 | 0.000576 | 215927 | 99.97% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 921177 | 920809 | 368 | 0.04% | 92117 | 0.0040925 | 0.009682 | 0.00027 | 920809 | 99.96% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
1 | 1 | 1024 | 读:240 | 443597 | 443367 | 230 | 0.05% | 44359 | 0.005397 | 0.010659 | 0.000345 | 443365 | 99.95% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 2 | |||
读:240 | 406149 | 405926 | 223 | 0.05% | 40614 | 0.005893 | 0.010737 | 0.002223 | 405926 | 99.95% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
写:120 | 225609 | 225534 | 75 | 0.03% | 22560 | 0.005283 | 0.010755 | 0.000763 | 225531 | 99.97% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 3 | ||||||
汇总数据: | 1075355 | 1074827 | 528 | 0.05% | 107533 | 0.005524333 | 0.010755 | 0.000345 | 1074822 | 99.95% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 5 | ||||||
10 | 10 | 114 | 读:160 | 1826112 | 1826049 | 63 | 0.00% | 182611 | 0.000866 | 0.050923 | 0.000195 | 1824311 | 99.90% | 1688 | 0.09% | 48 | 0 | 0 | 0 | 0 | 2 | |||
写:40 | 468944 | 468924 | 20 | 0.00% | 46894 | 0.000833 | 0.050611 | 0.00022 | 468462 | 99.90% | 453 | 0.10% | 9 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 2295056 | 2294973 | 83 | 0.00% | 229505 | 0.0008495 | 0.050923 | 0.000195 | 2292773 | 99.90% | 2141 | 0.09% | 57 | 0 | 0 | 0 | 0 | 2 | ||||||
10 | 10 | 114 | 读:160 | 1294460 | 1294348 | 112 | 0.01% | 129446 | 0.001224 | 0.052741 | 0.000204 | 1292630 | 99.86% | 1624 | 0.13% | 94 | 0 | 0 | 0 | 0 | 0 | |||
读:160 | 1240525 | 1240463 | 62 | 0.00% | 124052 | 0.001279 | 0.052716 | 0.000202 | 1238733 | 99.86% | 1647 | 0.13% | 83 | 0 | 0 | 0 | 0 | 0 | ||||||
写:80 | 632294 | 632256 | 38 | 0.01% | 63229 | 0.001242 | 0.052677 | 0.000225 | 631325 | 99.85% | 871 | 0.14% | 60 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 3167279 | 3167067 | 212 | 0.01% | 316727 | 0.001248333 | 0.052741 | 0.000202 | 3162688 | 99.86% | 4142 | 0.13% | 237 | 0 | 0 | 0 | 0 | 0 | ||||||
10 | 10 | 114 | 读:240 | 1500907 | 1500686 | 221 | 0.01% | 150090 | 0.001591 | 0.064988 | 0.00021 | 1498983 | 99.87% | 1527 | 0.10% | 161 | 0 | 0 | 0 | 0 | 15 | |||
读:240 | 1421333 | 1421168 | 165 | 0.01% | 142133 | 0.001677 | 0.064967 | 0.000207 | 1419206 | 99.85% | 1791 | 0.13% | 164 | 0 | 0 | 0 | 0 | 7 | ||||||
写:120 | 733923 | 733901 | 22 | 0.00% | 73392 | 0.001614 | 0.064954 | 0.000213 | 732913 | 99.86% | 893 | 0.12% | 80 | 0 | 0 | 0 | 0 | 15 | ||||||
汇总数据: | 3656163 | 3655755 | 408 | 0.01% | 365615 | 0.001627333 | 0.064988 | 0.000207 | 3651102 | 99.86% | 4211 | 0.12% | 405 | 0 | 0 | 0 | 0 | 37 | ||||||
10 | 10 | 114 | 读:320 | 1549554 | 1548923 | 631 | 0.04% | 154955 | 0.002032 | 0.075963 | 0.000218 | 1544633 | 99.68% | 3601 | 0.23% | 689 | 0 | 0 | 0 | 0 | 0 | |||
读:320 | 1456784 | 1456169 | 615 | 0.04% | 145678 | 0.002165 | 0.075957 | 0.000211 | 1451926 | 99.67% | 3551 | 0.24% | 692 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 610631 | 610405 | 226 | 0.04% | 61063 | 0.001924 | 0.075723 | 0.000226 | 608885 | 99.71% | 1261 | 0.21% | 259 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 3616969 | 3615497 | 1472 | 0.04% | 361696 | 0.002040333 | 0.002165 | 0.075723 | 3605444 | 99.68% | 8413 | 0.23% | 1640 | 0 | 0 | 0 | 0 | 0 | ||||||
0 | 10 | 114 | 读:320 | 610020 | 609706 | 314 | 0.05% | 61002 | 0.005253 | 0.627738 | 0.000099 | 607675 | 99.62% | 1365 | 0.22% | 109 | 0 | 553 | 0 | 2 | 2 | |||
读:320 | 595228 | 595107 | 121 | 0.02% | 59522 | 0.005396 | 0.629112 | 0.00011 | 593782 | 99.76% | 543 | 0.09% | 287 | 0 | 485 | 0 | 0 | 10 | ||||||
写:160 | 345303 | 345154 | 149 | 0.04% | 34530 | 0.004628 | 0.217036 | 0.000105 | 344380 | 99.73% | 303 | 0.09% | 243 | 0 | 228 | 0 | 0 | 0 | ||||||
汇总数据: | 1550551 | 1549967 | 584 | 0.04% | 155054 | 0.005092333 | 0.005396 | 0.217036 | 1545837 | 99.70% | 2211 | 0.14% | 639 | 0 | 1266 | 0 | 2 | 12 | ||||||
0 | 5 | 114 | 读:320 | 840549 | 840244 | 305 | 0.04% | 84054 | 0.003815 | 0.207115 | 0.000098 | 833555 | 99.17% | 6360 | 0.76% | 328 | 0 | 1 | 0 | 0 | 0 | |||
读:320 | 814279 | 813977 | 302 | 0.04% | 81427 | 0.003946 | 0.207329 | 0.000095 | 806649 | 99.06% | 7001 | 0.86% | 324 | 0 | 3 | 0 | 0 | 0 | ||||||
写:160 | 434906 | 434774 | 132 | 0.03% | 43490 | 0.003676 | 0.0704 | 0.000107 | 431021 | 99.11% | 3594 | 0.83% | 159 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 2089734 | 2088995 | 739 | 0.04% | 208971 | 0.003812333 | 0.003946 | 0.0704 | 2071225 | 99.11% | 16955 | 0.81% | 811 | 0 | 4 | 0 | 0 | 0 | ||||||
10 | 5 | 114 | 读:320 | 1354907 | 1354653 | 254 | 0.02% | 135490 | 0.002348 | 0.072427 | 0.000185 | 1353002 | 99.86% | 1435 | 0.11% | 210 | 0 | 0 | 0 | 0 | 6 | |||
读:320 | 1317697 | 1317390 | 307 | 0.02% | 131769 | 0.002417 | 0.072407 | 0.000203 | 1315665 | 99.85% | 1509 | 0.11% | 206 | 0 | 0 | 0 | 0 | 10 | ||||||
写:160 | 715005 | 714928 | 77 | 0.01% | 71500 | 0.002221 | 0.07217 | 0.000222 | 714109 | 99.87% | 715 | 0.10% | 97 | 0 | 0 | 0 | 0 | 7 | ||||||
汇总数据: | 3387609 | 3386971 | 638 | 0.02% | 338759 | 0.002328667 | 0.002417 | 0.07217 | 3382776 | 99.86% | 3659 | 0.11% | 513 | 0 | 0 | 0 | 0 | 23 | ||||||
0 | 1 | 114 | 读:320 | 438536 | 438238 | 298 | 0.07% | 43853 | 0.007279 | 0.014527 | 0.001809 | 438238 | 99.93% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | |||
读:320 | 417519 | 417207 | 312 | 0.07% | 41751 | 0.00764 | 0.016628 | 0.002803 | 417207 | 99.93% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 242664 | 242509 | 155 | 0.06% | 24266 | 0.006565 | 0.013832 | 0.000151 | 242509 | 99.94% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 1098719 | 1097954 | 765 | 0.07% | 109870 | 0.007161333 | 0.00764 | 0.013832 | 1097954 | 99.93% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
10 | 1 | 114 | 读:320 | 933792 | 933586 | 206 | 0.02% | 93379 | 0.003409 | 0.023699 | 0.00027 | 933585 | 99.98% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 1 | |||
读:320 | 884170 | 884032 | 138 | 0.02% | 88417 | 0.0036 | 0.020115 | 0.000345 | 884032 | 99.98% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 469366 | 469311 | 55 | 0.01% | 46936 | 0.003395 | 0.014032 | 0.000346 | 469299 | 99.99% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 12 | ||||||
汇总数据: | 2287328 | 2286929 | 399 | 0.02% | 228732 | 0.003468 | 0.0036 | 0.014032 | 2286916 | 99.98% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 13 | ||||||
1 | 1 | 114 | 读:320 | 425174 | 424861 | 313 | 0.07% | 42517 | 0.007503 | 0.013577 | 0.000132 | 424861 | 99.93% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | |||
读:320 | 393193 | 392893 | 300 | 0.08% | 39319 | 0.008115 | 0.017125 | 0.003374 | 392893 | 99.92% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 205225 | 205076 | 149 | 0.07% | 20522 | 0.007775 | 0.015942 | 0.000672 | 205076 | 99.93% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 1023592 | 1022830 | 762 | 0.07% | 102358 | 0.007797667 | 0.008115 | 0.013577 | 1022830 | 99.93% | 0 | 0.00% | 0 | 0 | 0 | 0 | 0 | 0 |
10 | 5 | 114 | 读:320 | 1377005 | 1376753 | 252 | 137700 | 0.002312 | 0.065274 | 0.000202 | 1375096 | 1277 | 377 | 0 | 0 | 0 | 0 | 3 | |||
读:320 | 1340049 | 1339784 | 265 | 134004 | 0.002376 | 0.088987 | 0.000205 | 1338042 | 1019 | 703 | 0 | 0 | 0 | 0 | 20 | ||||||
写:160 | 714969 | 714849 | 120 | 71496 | 0.002215 | 0.08899 | 0.000206 | 713976 | 510 | 363 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 3432023 | 3431386 | 637 | 343200 | 0.002301 | 0.002376 | 0.065274 | 3427114 | 2806 | 1443 | 0 | 0 | 0 | 0 | 23 | ||||||
10 | 8 | 114 | 读:320 | 1208533 | 1208248 | 285 | 120853 | 0.002636 | 0.076197 | 0.000209 | 1198618 | 8890 | 740 | 0 | 0 | 0 | 0 | 0 | |||
读:320 | 1185273 | 1184968 | 305 | 118527 | 0.002685 | 0.076225 | 0.00021 | 1175468 | 8782 | 718 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 651023 | 650887 | 136 | 65102 | 0.002436 | 0.076097 | 0.00023 | 646235 | 4287 | 363 | 0 | 0 | 0 | 0 | 2 | ||||||
汇总数据: | 3044829 | 3044103 | 726 | 304482 | 0.002585667 | 0.002685 | 0.076097 | 3020321 | 21959 | 1821 | 0 | 0 | 0 | 0 | 2 | ||||||
10 | 10 | 114 | 读:320 | 1348939 | 1348670 | 269 | 134893 | 0.002358 | 0.078353 | 0.000207 | 1343000 | 4604 | 1065 | 0 | 0 | 0 | 0 | 1 | |||
读:320 | 1328420 | 1328132 | 288 | 132842 | 0.002395 | 0.078262 | 0.000209 | 1322475 | 4579 | 1078 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 713346 | 713206 | 140 | 71334 | 0.00222 | 0.078177 | 0.000238 | 710428 | 2249 | 529 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 3390705 | 3390008 | 697 | 339069 | 0.002324333 | 0.002395 | 0.078177 | 3375903 | 11432 | 2672 | 0 | 0 | 0 | 0 | 1 | ||||||
0 | 5 | 114 | 读:320 | 778997 | 778920 | 77 | 77899 | 0.004095 | 0.065985 | 0.000103 | 750055 | 28288 | 577 | 0 | 0 | 0 | 0 | 0 | |||
读:320 | 708764 | 708471 | 293 | 70876 | 0.004503 | 0.064115 | 0.000095 | 678885 | 29106 | 480 | 0 | 0 | 0 | 0 | 0 | ||||||
写:160 | 394627 | 394498 | 129 | 39462 | 0.004036 | 0.065387 | 0.000109 | 379819 | 14418 | 261 | 0 | 0 | 0 | 0 | 0 | ||||||
汇总数据: | 1882388 | 1881889 | 499 | 188237 | 0.004211333 | 0.004503 | 0.064115 | 1808759 | 71812 | 1318 | 0 | 0 | 0 | 0 | 0 | ||||||
0 | 8 | 114 | 读:320 | 910940 | 910678 | 262 | 91094 | 0.003528 | 1.00478 | 0.0001 | 901645 | 8334 | 405 | 0 | 288 | 0 | 2 | 4 | |||
读:320 | 806025 | 805857 | 168 | 80602 | 0.003959 | 0.216591 | 0.000134 | 799706 | 5071 | 952 | 0 | 128 | 0 | 0 | 0 | ||||||
写:160 | 483931 | 483798 | 133 | 48393 | 0.003291 | 0.216577 | 0.000137 | 480623 | 2558 | 545 | 0 | 72 | 0 | 0 | 0 | ||||||
汇总数据: | 2200896 | 2200333 | 563 | 220089 | 0.003592667 | 0.003959 | 0.216577 | 2181974 | 15963 | 1902 | 0 | 488 | 0 | 2 | 4 | ||||||
0 | 10 | 114 | 读:320 | 770839 | 770580 | 259 | 77083 | 0.004221 | 1.017051 | 0.000052 | 767117 | 2531 | 156 | 0 | 746 | 0 | 10 | 20 | |||
读:320 | 603203 | 603055 | 148 | 60320 | 0.005297 | 1.012624 | 0.000134 | 600003 | 2493 | 172 | 0 | 375 | 0 | 2 | 10 | ||||||
写:160 | 374955 | 374820 | 135 | 37495 | 0.00425 | 1.013057 | 0.000163 | 373355 | 1209 | 74 | 0 | 169 | 0 | 2 | 11 | ||||||
汇总数据: | 1748997 | 1748455 | 542 | 174898 | 0.004589333 | 0.005297 | 1.012624 | 1740475 | 6233 | 402 | 0 | 1290 | 0 | 14 | 41 |
环境准备工作
- Redis集群配置:由redis集群平台配置(BID,实例,设备等),同时需要部署CA,注册机器设备;
服务器配置
redis: | proxy |
cpu cores : 6 | cpu cores : 8 |
processor:24 | processer:32 |
mem:128G | mem:32G |
disk:600G | disk:600G |
网卡:1000Mb/s | 网卡:1000Mb/s |
- 服务部署:IP略;RPM:redis服务,redis_stencel,tweprox,共2redis服务(1主1备),6加压机,2proxy机器;
脚本开发工作
- 压力工具:test_client框架(C++编写),修改框架代码分段传参;编写业务脚本,采用中奖结构体,2个字段;长度控制:重复填充对象;
- 服务器性能数据收集:sar/vmstat/mpstat/top等工具手工收集;
测试执行和数据分析
- 执行:手工执行;
- 服务器数据简介:
- Proxy:
- 114B时10实例,800并发,总cpu低于20%,,部分内核吃满;开启irqbalance后依然如此;磁盘写入很低,内存/网卡等占用正常;
- 1024时,单实例600写并发;网卡200MB+;假设继续加实例和并发,则网卡很容易就被吃满;
- Redis:114B时,800并发,redis总CPU30%左右;部分内核吃满,修改部分参数,开启irqbalance后,分布平均;磁盘写入正常,并不大;网卡在15~20MB左右;
开启irqbalance前,所有软中断全部压在cpu0
开启irqbalance后,CPU分布(同一个用例的效果未抓图,此处切另一个用例的图):
通过观察/proc/softirq文件,可以看到被沾满的CPU大部分是在等待网卡;判断增加网卡可能会提升数据表现;
- l数据观察原则:
- 数据观察点:由CPU/内存/网卡/磁盘等大项目进行观察;有异常的地方重复执行用例,观察具体实例数据;
- 每次均应收集服务器性能指标数据,以备对比;
- 数据采样:单个用例多次执行,如结果浮动不大,则采取中间值;如波动较大,找出原因后,给出区间;
测试结果
1、114字节的数据,读写比例4:1下性能数据: ------源自开发估算
直连redis,单实例 10w/s
直连redis,单机(10实例) 35w/s
1接入机+1 redis机 40w/s
2接入机+1 redis机 62w/s
2、理论值114字节数据可以达到100W/S,实际只有62W左右; ------ 根据执行结果估算;
3、瓶颈在于两点:
- Proxy的内核负载不平均,软中断过高;已开启irqbalance,但还是不平均;
- Proxy的网卡流量限制;------ 暂无法解决;
其他说明:
l 每次修改实例数后,需要重新执行写入动作,让数据平均分布到各实例,否则在读取的时候不准确;部分读命令无法找到数据;
l 本次测试场景考虑比较简单,属于验证能力类的测试;比如未考虑网络影响(实际上主备实例是跨机房的,这里是同机房不同机器)
另外,发现直连比代理方式的bo/bi更多,未能找到多写入了什么东东。暂时未解决此处;
基于业务封装API进行Redis服务性能测试记录