Skip to content

Commit f93301c

Browse files
committed
Deploy Redis for data searching on Google Cloud C4A (Arm-based Axion VMs)
Signed-off-by: odidev <[email protected]>
1 parent ae0802b commit f93301c

File tree

8 files changed

+561
-0
lines changed

8 files changed

+561
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Deploy Redis for data searching on Google Cloud C4A (Arm-based Axion VMs)
3+
4+
minutes_to_complete: 30
5+
6+
who_is_this_for: This learning path is intended for software developers deploying and optimizing Redis-based data searching workloads on Linux/Arm64 environments, specifically using Google Cloud C4A virtual machines powered by Axion processors.
7+
8+
learning_objectives:
9+
- Provision an Arm-based SUSE SLES virtual machine on Google Cloud (C4A with Axion processors)
10+
- Install Redis on a SUSE Arm64 (C4A) instance
11+
- Verify Redis functionality by running the server and performing baseline data insertion and retrieval tests on the Arm64 VM
12+
- Measure Redis SET (write) and GET (read) performance using the official redis-benchmark tool to evaluate throughput and latency on Arm64 (Aarch64)
13+
14+
prerequisites:
15+
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
16+
- Basic familiarity with [Redis](https://redis.io/)
17+
18+
author: Pareena Verma
19+
20+
##### Tags
21+
skilllevels: Introductory
22+
subjects: Databases
23+
cloud_service_providers: Google Cloud
24+
25+
armips:
26+
- Neoverse
27+
28+
tools_software_languages:
29+
- Redis
30+
- redis-benchmark
31+
32+
operatingsystems:
33+
- Linux
34+
35+
# ================================================================================
36+
# FIXED, DO NOT MODIFY
37+
# ================================================================================
38+
further_reading:
39+
- resource:
40+
title: Google Cloud documentation
41+
link: https://cloud.google.com/docs
42+
type: documentation
43+
44+
- resource:
45+
title: Redis documentation
46+
link: https://redis.io/docs/
47+
type: documentation
48+
49+
- resource:
50+
title: Redis benchmark documentation
51+
link: https://redis.io/docs/latest/operate/oss_and_stack/management/optimization/benchmarks/
52+
type: documentation
53+
54+
weight: 1
55+
layout: "learningpathall"
56+
learning_path_main_page: "yes"
57+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Getting started with Redis on Google Axion C4A (Arm Neoverse-V2)
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## Google Axion C4A Arm instances in Google Cloud
10+
11+
Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
12+
13+
The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
14+
15+
To learn more about Google Axion, refer to the [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) blog.
16+
17+
## Redis
18+
19+
[Redis](https://redis.io/) is an open-source, **in-memory data structure store** developed under the [Redis project](https://redis.io/). It is used as a **database**, **cache**, and **message broker**, supporting a variety of data structures such as **strings**, **hashes**, **lists**, **sets**, and **sorted sets**.
20+
21+
Redis is designed for **high performance**, **low latency**, and **high throughput**, making it ideal for real-time applications. It supports **persistence**, **replication**, **Lua scripting**, **transactions**, and **high availability** through Redis Sentinel and **automatic partitioning** with Redis Cluster.
22+
23+
Redis is widely adopted for **caching**, **session management**, **real-time analytics**, **pub/sub messaging**, and **leaderboards** in gaming and web applications. It integrates seamlessly with programming languages like **Python**, **Java**, **Go**, and **Node.js**.
24+
25+
To learn more, visit the [Redis official website](https://redis.io/) and explore the [documentation](https://redis.io/docs/latest/).
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
title: Redis Baseline Testing on Google Axion C4A Arm Virtual Machine
3+
weight: 5
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Redis Baseline Testing on GCP SUSE VMs
10+
This section performs baseline testing for Redis running on a GCP SUSE Arm64 VM, focusing on data insertion, retrieval, and search performance.
11+
12+
### Prerequisites
13+
This command launches the Redis server process in the background. It allows you to run subsequent commands in the same terminal session while Redis continues running.
14+
Start the Redis service in the background:
15+
16+
```console
17+
redis-server &
18+
```
19+
20+
**Check if Redis is active and responding to commands:**
21+
22+
The redis-cli ping command sends a simple health check request to the Redis server. A PONG response confirms that the server is running correctly and the client can communicate with it.
23+
```console
24+
redis-cli ping
25+
```
26+
27+
output:
28+
29+
```output
30+
PONG
31+
```
32+
33+
### Insert Sample Data
34+
These steps populate the Redis database with a sample dataset to validate insertion performance and data persistence. You will create 10,000 key-value pairs using a simple shell loop and verify that the data has been successfully stored.
35+
36+
Use `redis-cli` to insert **10,000 sample key-value pairs**:
37+
```console
38+
for i in $(seq 1 10000); do
39+
redis-cli SET key:$i "value-$i" > /dev/null
40+
done
41+
```
42+
- This command iterates through numbers **1 to 10,000**, setting each as a Redis key in the format `key:<number>` with the corresponding value `"value-<number>"`.
43+
- The `> /dev/null` part suppresses command output to make the insertion process cleaner and faster.
44+
45+
**Verify Data Storage Count:**
46+
47+
The `DBSIZE` command returns the total number of keys currently stored in the Redis database.
48+
49+
```console
50+
redis-cli DBSIZE
51+
```
52+
53+
```output
54+
(integer) 10000
55+
```
56+
Seeing `(integer) 10000` confirms that all key-value pairs were inserted successfully.
57+
58+
**Verify Sample Data Retrieval**
59+
60+
Fetch one of the inserted keys to confirm data correctness:
61+
62+
```console
63+
redis-cli GET key:5000
64+
```
65+
- The `GET` command retrieves the value of a given key.
66+
- If Redis returns `"value-5000"`, it confirms that data insertion worked properly and the database is responding as expected.
67+
68+
You should see an output similar to:
69+
70+
```output
71+
"value-5000"
72+
```
73+
74+
### Perform Basic Data Search Tests
75+
This step verifies Redis’s ability to retrieve specific data efficiently using unique keys. The `GET` command fetches the value associated with a given key from Redis.
76+
77+
You can test this by retrieving a known key-value pair:
78+
79+
```console
80+
redis-cli GET key:1234
81+
```
82+
83+
You should see an output similar to:
84+
85+
```output
86+
"value-1234"
87+
```
88+
This confirms that Redis is storing and retrieving data correctly from memory.
89+
90+
### Search for Multiple Keys Using Pattern Matching
91+
This test demonstrates how Redis can locate multiple keys that match a pattern, useful for exploratory queries or debugging.
92+
93+
Use the `KEYS` command to search for keys matching a pattern:
94+
95+
```console
96+
redis-cli KEYS "key:1*"
97+
```
98+
`KEYS` is fast but **blocks the server** when handling large datasets, so it’s not recommended in production.
99+
100+
You should see an output similar to:
101+
102+
```output
103+
1) "key:1392"
104+
2) "key:1076"
105+
3) "key:1683"
106+
4) "key:1490"
107+
5) "key:117"
108+
6) "key:1293"
109+
7) "key:1791"
110+
8) "key:1891"
111+
9) "key:1543"
112+
..........
113+
```
114+
115+
### Production-Safe Searching with SCAN
116+
This step introduces a production-friendly method for iterating through keys without blocking Redis operations.
117+
118+
Use the `SCAN` command for larger datasets — it is non-blocking and iterates safely.
119+
120+
```console
121+
redis-cli SCAN 0 MATCH "key:1*" COUNT 100
122+
```
123+
124+
You should see an output similar to:
125+
126+
```output
127+
1) "9792"
128+
2) 1) "key:151"
129+
2) "key:1845"
130+
3) "key:1397"
131+
4) "key:1501"
132+
5) "key:1994"
133+
6) "key:1475"
134+
7) "key:1522"
135+
8) "key:1884"
136+
```
137+
Redis will return a cursor value (for example, `9792`).
138+
Continue scanning by reusing the cursor until it returns `0`, meaning the iteration is complete.
139+
140+
### Measure Data Retrieval Performance
141+
This step measures how quickly Redis can retrieve a single key from memory, helping establish a baseline for data access latency on the Arm-based VM.
142+
143+
**Time Single Key Lookup**: Redis operations are extremely fast since data is stored in-memory. To quantify this, the Unix `time` command is used to measure the latency of retrieving a single key using `redis-cli`.
144+
145+
```console
146+
(time redis-cli GET key:9000) 2>&1
147+
```
148+
149+
This command measures three time metrics:
150+
151+
- **real** – Total elapsed time (wall-clock time)
152+
- **user** – Time spent in user mode
153+
- **sys** – Time spent in kernel mode
154+
155+
You should see an output similar to:
156+
157+
```output
158+
"value-9000"
159+
160+
real 0m0.002s
161+
user 0m0.002s
162+
sys 0m0.000s
163+
```
164+
These results show that Redis retrieves data almost instantly (in milliseconds or microseconds), confirming that the instance is performing efficiently under baseline conditions.

0 commit comments

Comments
 (0)