Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the QPS float of Redis?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly talks about "how much is the QPS float of Redis". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how much is the QPS float of Redis"?

Test environment configuration

Ubuntu Intel (R) Core (TM) i5-5257U CPU @ 2.70GHz 8GB DDR3, 40GB SSD

Redis

Go to the Redis [1] official website and use the following steps to install.

$wget http://download.redis.io/releases/redis-5.0.5.tar.gz $tar xzf redis-5.0.5.tar.gz $cd redis-5.0.5$ make

Start the service

$src/redis-server

Run the benchmark tool that comes with Redis, run set,get 1000000 times, exit and display the data after 1 second

$cd src $. / redis-benchmark-n 1000000-t set,get-Q

The data is shown below, and the result is SET 48009 get 56960.

SET: 48009.98 requests per second GET: 56960.59 requests per second

Of course, this data is not using pipeline, so what is the scenario of using pipeline? Run the command as follows: run set,get 1000000 times, send 200 requests to the server each time, exit and display the data after 1 second

$cd src $. / redis-benchmark-n 1000000-t set,get-P 200-Q

The data are shown below, and the result is SET 315258 get 330797. Here you can adjust the value of-P to keep it steady around 30000, so the following data is the best test data in theory.

SET: 315258.53 requests per second GET: 330797.22 requests per second

OK, that's all we know. The approximate figure for Redis is 50000-300000, so let's take a look at MySQL.

MySQL

You can go to the MySQL [2] official website to install MySQL. My service environment is Ubuntu, so my installation command is as follows.

$sudo apt-get install mysql-server $sudo apt-get install mysql-client

I used the sysbench [3] tool to test the performance of MySQL, so we need to install it next.

$url-s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash sudo apt-y install sysbench

After installing sysbench, there will be some test scripts under the / usr/share/sysbench/ directory, which can be used directly. We just need to manually create a database named benchmark, and then run the following command to prepare the data-> test data

Sysbench/ usr/share/sysbench/oltp_read_write.lua-mysql-user=root-mysql-password=root-mysql-db=benchmark-tables=10-table-size=1000000-events=100000000-report-interval=10-threads=4-time=300 prepare sysbench/ usr/share/sysbench/oltp_read_write.lua-mysql-user=root-mysql-password=root-mysql-db=benchmark-tables=10 table-size=1000000 events=100000000 report-interval=10 threads=4 time=300 run

After the operation is completed, the data are as follows

[10s] thds: 4 tps: 198.84 qps: 3982.73 (r/w/o: 2788.48 reconn/s 796.17 qps 398.08) lat (ms,95%): 54.83 err/s: 0.00 reconn/s: 0.00 [20s] thds: 4 tps: 174.38 qps: 3486.62 (r/w/o: 2440.73 r/w/o 697.12 lat 348.76) lat (ms) 95%): 52.89 err/s: 0.00 reconn/s: 0.00 [30s] thds: 4 tps: 204.54 qps: 4089.94 (r/w/o: 2863.12 reconn/s 817.75 409.07) lat (ms,95%): 55.82 err/s: 0.00 reconn/s: 0.00 [40s] thds: 4 tps: 214.98 qps: 4299.59 (r/w/o: 3009.71 + 859.92) lat (ms) 95%): 49.21 err/s: 0.00 reconn/s: 0.00 [50s] thds: 4 tps: 188.31 qps: 3767.98 (r/w/o: 2637.12 Mather 754.24max 376.62) lat (ms,95%): 52.89 err/s: 0.00 reconn/s: 0.00 [60s] thds: 4 tps: 228.00 qps: 4559.06 (r/w/o: 3191.64 Universe 911.41 Universe 456.01) lat (ms) 95%): 49.21 err/s: 0.00 reconn/s: 0.00

Ding Ding, did you find something? The data show that the QPS of MySQL floats around 4000.

At this point, I believe you have a deeper understanding of "how much is the QPS float of Redis?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report