Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to compare the performance Test of Redis and Memcache

Shulou Source: shulou.com Published: 2022-05-31 22:57:59 10月05日 Update

This article shows you how to compare Redis and Memcache performance tests. the content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Redis and Memcache, the test server is a personal PC: general configuration (2CPU\ 2G memory), CentOS installed by the operating system.

1. When redis memcache is empty

Redis set 100000 values start time: 1311742106

Redis set 100000 values time: 1311742123 time: 16.8817

Memcache set 100000 values start time: 1311742123

Memcache set 100000 values end time: 1311742138 time: 15.2574

2. When redis and memcache have data:

Redis set 100000 values start time: 1311742721

Redis set 100000 values time: 1311742738 time: 17.3401

Memcache set 100000 values start time: 1311742738

Memcache set 100000 values end time: 1311742753 time: 15.6892

3. Test the data acquisition speed of redis and memcache respectively:

Redis array gets 100000 values start time: 1311742144

Redis array to get 100000 values time: 1311742398 time: 253.9285

Redis gets 100000 values one by one. Start time: 1311742398

Redis gets 100000 values one by one time: 1311742414 time: 16.339

Memcache array gets 100000 values start time: 1311742414

Memcache array to get 100000 values end time: 1311742415 time: 0.8022

Memcache gets 100000 values one by one. Start time: 1311742415

Memcache gets 100000 values one by one end time: 1311742428 time: 13.38

There is little difference between Redis and Memcache in write performance, and Memcache outperforms in read performance, especially batch read performance. Of course, Redis also has its own advantages, such as data persistence, support for more data structures (Set List ZSet), and so on.

The above is how to compare Redis and Memcache performance tests. have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Time performance testing data arrays content skills more knowledge conciseness operating system concise small personal advantages memory that is differences data structures articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Linux Docker MariaDB Shulou Technology