Redis性能测试 逃离我推掉我的手 2022-08-06 04:30 1阅读 0赞 ### 性能测试 ### -------------------- Redis性能测试是通过同时执行多个命令实现的 基本命令:`redis-benchmark [option] [option value]` <table style="border-collapse:collapse; border-spacing:0px; margin-top:0px; margin-bottom:16px; display:block; width:858px; overflow:auto; word-break:normal; color:rgb(51,51,51); font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif; font-size:16px; line-height:25.6000003814697px"> <thead style=""> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <th align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">选项</th> <th align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">描述</th> <th align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">默认值</th> </tr> </thead> <tbody style=""> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-h</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">指定服务器主机名</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">127.0.0.1</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-p</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">指定服务器端口</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">6379</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-s</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">指定服务器socket</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)"> </td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-c</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">指定并发连接数</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">50</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-n</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">指定请求数</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">10000</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-d</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">以字节的形式指定 SET/GET 值的数据大小</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">2</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-k</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">1=keep alive 0=reconnect</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">1</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-r</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">SET/GET/INCR 使用随机 key, SADD 使用随机值</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)"> </td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-P</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">通过管道传输 请求</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">1</td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-q</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">强制退出 redis。仅显示 query/sec 值</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)"> </td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">--csv</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">以 CSV 格式输出</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)"> </td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-l</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">生成循环,永久执行测试</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)"> </td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-t</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">仅运行以逗号分隔的测试命令列表。</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)"> </td> </tr> <tr style="border-top-width:1px; border-top-style:solid; border-top-color:rgb(204,204,204); background-color:rgb(248,248,248)"> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">-I</td> <td align="left" style="padding:6px 13px; border:1px solid rgb(221,221,221)">Idle 模式。仅打开 N 个 idle 连接并等待。</td> </tr> </tbody> </table> 如果发现错误,请轻拍,欢迎留言交流,谢谢
还没有评论,来说两句吧...