设为首页 收藏本站
查看: 720|回复: 0

[经验分享] memtier_benchmark: A High-Throughput Benchmarking Tool for Redis & Memcached

[复制链接]
发表于 2015-7-22 12:28:02 | 显示全部楼层 |阅读模式
  转载 http://redislabs.com/blog/memtier_benchmark-a-high-throughput-benchmarking-tool-for-redis-memcached#.UxgGr_S1a-B
  
  Benchmarking is the practice of measuring the performance of a system to identify its limits. Benchmarking is an integral part of our service’s development process and we use it both for regression testing (verifying performance has not been reduced between releases) and also as an aid for optimizing database performance. It is generally considered good practice to measure the performance of your system periodically as well as after every change made to ensure it is achieving maximal performance and to potentially uncover relevant issues. To facilitate the execution of these benchmark runs, we developed our own benchmarking tool that we fondly call memtier_benchmark.
  
  This tool can be used to generate various traffic patterns against both Memcached and Redis instances. It provides a robust set of customization and reporting capabilities all wrapped into a convenient and easy-to-use command-line interface. We use it extensively for all our benchmarking needs, both in development as well as to help share our knowledge with the broader community (for example, as we did in this blog post). We’ve released memtier_benchmark source code under the GPLv2 licensing scheme, and you can download it from our github account. The following are some highlights about the tool.


  • It supports both Redis and Memcached (binary and text) protocols so you can use it to test both and even compare their performance under different scenarios
  • memtier_benchmark is capable of launching multiple worker threads (using the -t option), with each thread driving a configurable number of clients (the -c option). Multiple threads enable you to better utilize the hardware resources of your benchmarking client and generate high traffic loads even using a single server.
  • When you instruct the tool to do multiple iterations of the benchmark run (the -x option), it will automatically produce reports for the best and worst runs as well as aggregated averages
  • You can control the ratio between GET and SET operations with the ratio option to measure performance when dealing with different access patterns
  • The tool offers control over the pattern of keys used by the GET and SET operations (key-pattern option). Each operation’s pattern can be set independently to be random or sequential.
  • Keys’ expiry can be common or randomly set from a configurable range (the expiry-range option)
  For more information about these and other features of the tool, below is memtier_benchmark’s usage clause (printed with the help switch). Do feel free to give it a go and let us know what you think.

Usage: memtier_benchmark [options]
A memcache/redis NoSQL traffic generator and performance benchmarking tool.
Connection and General Options:
-s, --server=ADDR              Server address (default: localhost)
-p, --port=PORT                Server port (default: 6379)
-S, --unix-socket=SOCKET       UNIX Domain socket name (default: none)
-P, --protocol=PROTOCOL        Protocol to use (default: redis).  Other
supported protocols are memcache_text,
memcache_binary.
-x, --run-count=NUMBER         Number of full-test iterations to perform
-D, --debug                    Print debug output
--client-stats=FILE        Produce per-client stats file
--out-file=FILE            Name of output file (default: stdout)
--show-config              Print detailed configuration before running
Test Options:
-n, --requests=NUMBER          Number of total requests per client (default: 10000)
-c, --clients=NUMBER           Number of clients per thread (default: 50)
-t, --threads=NUMBER           Number of threads (default: 4)
--test-time=SECS           Number of seconds to run the test
--ratio=RATIO              Set:Get ratio (default: 1:10)
--pipeline=NUMBER          Number of concurrent pipelined requests (default: 1)
--reconnect-interval=NUM   Number of requests after which re-connection is performed
--multi-key-get=NUM        Enable multi-key get commands, up to NUM keys (default: 0)
-a, --authenticate=PASSWORD    Authenticate to redis using PASSWORD
--select-db=DB             DB number to select, when testing a redis server
Object Options:
-d  --data-size=SIZE           Object data size (default: 32)
-R  --random-data              Indicate that data should be randomized
--data-size-range=RANGE    Use random-sized items in the specified range (min-max)
--data-size-list=LIST      Use sizes from weight list (size1:weight1,..sizeN:weightN)
--expiry-range=RANGE       Use random expiry values from the specified range
Imported Data Options:
--data-import=FILE         Read object data from file
--generate-keys            Generate keys for imported objects
Key Options:
--key-prefix=PREFIX        Prefix for keys (default: memtier-)
--key-minimum=NUMBER       Key ID minimum value (default: 0)
--key-maximum=NUMBER       Key ID maximum value (default: 10000000)
--key-pattern=PATTERN      Set:Get pattern (default: R:R)
--help                     Display this help
--version                  Display version information
  - See more at: http://redislabs.com/blog/memtier_benchmark-a-high-throughput-benchmarking-tool-for-redis-memcached#.UxgGr_S1a-B

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-89473-1-1.html 上篇帖子: redis window 安装测试--记录 下篇帖子: 十五分钟介绍 Redis 数据结构
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表