Skip to content

Commit 44ae9fe

Browse files
Added Performance Testing Utility for Redis
1 parent c359066 commit 44ae9fe

17 files changed

+504
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Scripts/__pycache__

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# redis-load-test
1+
# Redis Performance Testing - A OpsTree utility to test load on Redis
2+
3+
This main goal of creating this utility is to provide easy and fast performance testing for Redis.
4+
5+
## Dependencies
6+
7+
The list of dependencies are not quite long but yes we do have some dependencies.
8+
9+
#### System Dependencies
10+
- [X] **python3**
11+
12+
#### Python Dependencies
13+
- [X] **locust**
14+
- [X] **json**
15+
- [X] **argparse**
16+
- [X] **redis**
17+
18+
Don't worry we have taken care the python dependencies in [requirments.txt](./Scripts/requirments.txt)
19+
20+
## Overview of Utility Structure
21+
22+
In this repository we have:-
23+
- **Scripts**:- Scripts folder contains all the codebase which is required for performance testing.
24+
- **[redis_set.py](./Scripts/redis_set.py)**:- This script is used to set random keys in Redis.
25+
- **[redis_read.py](./Scripts/redis_read.py)**:- This script is used to perform *GET* action on Redis.
26+
- **[redis_get_set.py](./Scripts/redis_get_set.py)**: This script is used to perform *SET* and *GET* operation simultaneously on Redis.
27+
- **[redis.json](./Scripts/redis.json)**:- This is a json file in which we have to define our connection details of Redis. I created this file because I believe that code should not be changed.
28+
29+
- **Results**:- This is a directory in which I am dumping some of my test results.
30+
- **[redis_get_1000_users_stats.md](./Results/mardownResults/redis_get_1000_users_stats.md)**:- This is a test result of *GET* operation with 1000 users.
31+
- **[redis_get_set_100_users_stats.md](./Results/mardownResults/redis_get_set_100_users_stats.md)**:- This is a test result of *GET* and *SET* operation simultaneously with 100 users.
32+
33+
You may need to install python3 manually, for other things you can use **[requirments.txt](./Scripts/requirments.txt)**
34+
35+
```shell
36+
cd Scripts
37+
pip3 install -r requirments.txt
38+
```
39+
40+
## Usage
41+
42+
The use of this utility is not a fancy thing, just need to update the **[redis.json](./Scripts/redis.json)** with your redis connection details. Content of file should be like this:-
43+
44+
```json
45+
{
46+
"redis_host": "18.215.118.208",
47+
"redis_port": "6379",
48+
"redis_password": ""
49+
}
50+
```
51+
52+
#### For SET Operation in Redis
53+
54+
```shell
55+
./redis_set.py --filepath redis.json
56+
```
57+
58+
#### For GET Operation in Redis
59+
60+
```shell
61+
locust -f redis_read.py
62+
```
63+
64+
#### For GET and SET simultaneously operation in Redis
65+
66+
```shell
67+
locust -f redis_get_set.py
68+
```
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
Method,Name,# requests,# failures,Median response time,Average response time,Min response time,Max response time,Average Content Size,Requests/s
2+
GET,key1,1320,0,310,314,258,661,6,100.16
3+
write,key1,8,0,300,297,267,310,1,0.61
4+
write,key10,6,0,270,283,266,309,1,0.46
5+
write,key11,7,0,280,285,266,307,1,0.53
6+
write,key12,11,0,310,331,301,584,1,0.83
7+
write,key13,1,0,290,291,291,291,1,0.08
8+
write,key14,4,0,290,291,264,307,1,0.3
9+
write,key15,4,0,280,290,280,307,1,0.3
10+
write,key16,7,0,310,299,270,316,1,0.53
11+
write,key17,8,0,310,300,272,313,1,0.61
12+
write,key18,3,0,310,297,271,312,1,0.23
13+
write,key19,10,0,310,350,265,572,1,0.76
14+
write,key2,6,0,300,291,268,309,1,0.46
15+
write,key20,17,0,300,299,267,330,1,1.29
16+
write,key21,10,0,310,302,287,310,1,0.76
17+
write,key22,5,0,310,359,292,588,1,0.38
18+
write,key23,5,0,300,290,268,309,1,0.38
19+
write,key24,9,0,290,287,264,316,1,0.68
20+
write,key25,3,0,310,307,307,308,1,0.23
21+
write,key26,5,0,310,344,267,568,1,0.38
22+
write,key27,5,0,300,298,289,309,1,0.38
23+
write,key28,13,0,300,295,268,309,1,0.99
24+
write,key29,7,0,280,286,265,331,1,0.53
25+
write,key3,5,0,300,295,274,306,1,0.38
26+
write,key30,2,0,310,308,308,309,1,0.15
27+
write,key31,2,0,280,287,284,291,1,0.15
28+
write,key32,3,0,310,305,293,313,1,0.23
29+
write,key33,6,0,290,339,280,566,1,0.46
30+
write,key34,10,0,290,294,269,307,1,0.76
31+
write,key35,1,0,290,287,287,287,1,0.08
32+
write,key36,4,0,290,290,268,305,1,0.3
33+
write,key37,6,0,310,354,306,587,1,0.46
34+
write,key38,4,0,290,291,273,304,1,0.3
35+
write,key39,9,0,310,305,288,310,1,0.68
36+
write,key4,10,0,300,336,269,728,1,0.76
37+
write,key40,3,0,300,305,281,331,1,0.23
38+
write,key41,4,0,310,309,308,313,1,0.3
39+
write,key42,8,0,310,307,300,309,1,0.61
40+
write,key43,4,0,310,302,287,309,1,0.3
41+
write,key44,5,0,290,293,272,310,1,0.38
42+
write,key45,6,0,290,289,268,311,1,0.46
43+
write,key46,3,0,290,289,269,309,1,0.23
44+
write,key47,3,0,300,305,305,307,1,0.23
45+
write,key48,14,0,310,300,268,323,1,1.06
46+
write,key49,4,0,300,301,288,308,1,0.3
47+
write,key5,9,0,300,300,288,309,1,0.68
48+
write,key50,7,0,300,365,267,572,1,0.53
49+
write,key51,9,0,310,303,290,309,1,0.68
50+
write,key52,8,0,300,302,287,311,1,0.61
51+
write,key53,3,0,310,301,288,309,1,0.23
52+
write,key54,11,0,310,299,268,314,1,0.83
53+
write,key55,6,0,310,311,307,328,1,0.46
54+
write,key58,3,0,310,307,306,310,1,0.23
55+
write,key59,8,0,310,305,287,311,1,0.61
56+
write,key6,5,0,300,359,292,571,1,0.38
57+
write,key60,1,0,310,308,308,308,1,0.08
58+
write,key61,14,0,310,307,268,345,1,1.06
59+
write,key62,4,0,280,287,273,308,1,0.3
60+
write,key63,4,0,300,305,301,309,1,0.3
61+
write,key64,6,0,310,350,271,621,1,0.46
62+
write,key65,2,0,290,296,286,307,1,0.15
63+
write,key66,1,0,290,289,289,289,1,0.08
64+
write,key67,3,0,300,292,269,308,1,0.23
65+
write,key68,4,0,310,313,306,327,1,0.3
66+
write,key69,2,0,270,283,271,295,1,0.15
67+
write,key7,10,0,300,302,288,310,1,0.76
68+
write,key70,8,0,290,288,265,314,1,0.61
69+
write,key71,11,0,270,280,265,310,1,0.83
70+
write,key72,14,0,290,289,266,309,1,1.06
71+
write,key73,3,0,290,291,283,304,1,0.23
72+
write,key74,5,0,290,291,268,309,1,0.38
73+
write,key75,4,0,280,291,267,307,1,0.3
74+
write,key76,4,0,270,286,267,307,1,0.3
75+
write,key77,1,0,260,264,264,264,1,0.08
76+
write,key78,6,0,310,307,300,312,1,0.46
77+
write,key79,6,0,310,354,289,600,1,0.46
78+
write,key8,10,0,280,286,267,307,1,0.76
79+
write,key80,1,0,270,267,267,267,1,0.08
80+
write,key81,6,0,310,303,289,309,1,0.46
81+
write,key82,9,0,310,304,289,312,1,0.68
82+
write,key83,1,0,580,584,584,584,1,0.08
83+
write,key84,4,0,290,288,273,309,1,0.3
84+
write,key85,6,0,310,305,289,310,1,0.46
85+
write,key86,9,0,300,299,269,313,1,0.68
86+
write,key87,2,0,270,289,270,309,1,0.15
87+
write,key88,1,0,310,309,309,309,1,0.08
88+
write,key89,4,0,310,304,290,312,1,0.3
89+
write,key9,7,0,300,290,268,306,1,0.53
90+
write,key90,8,0,290,288,264,309,1,0.61
91+
write,key91,12,0,300,304,292,312,1,0.91
92+
write,key92,4,0,290,296,283,308,1,0.3
93+
write,key93,1,0,270,270,270,270,1,0.08
94+
write,key94,2,0,280,285,284,287,1,0.15
95+
write,key95,6,0,300,296,270,309,1,0.46
96+
write,key96,1,0,290,288,288,288,1,0.08
97+
write,key97,12,0,310,298,272,310,1,0.91
98+
write,key98,7,0,310,349,308,581,1,0.53
99+
write,key99,6,0,300,301,269,326,1,0.46
100+
None,Total,1891,0,310,311,258,728,4,143.49
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Method,Name,# requests,# failures,Median response time,Average response time,Min response time,Max response time,Average Content Size,Requests/s
2+
GET,key1,196029,0,322000,352540,252437,4128581,6,1363.53
3+
None,Total,196029,0,322000,352540,252437,4128581,6,1363.53
16.7 KB
Loading
21 KB
Loading
15.5 KB
Loading
41.5 KB
Loading
39.9 KB
Loading
26.4 KB
Loading

0 commit comments

Comments
 (0)