You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/baseline.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ weight: 6
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Verify Django is working on your Arm-based VM
9
+
## Verify Django installation
10
10
11
11
In this section, you'll confirm that Django is installed correctly and can serve web requests on your Google Cloud C4A VM. You'll create a Django project, run the development server, and access it from your browser.
Confirm ApacheBench is correctly installed and available:
40
+
Confirm ApacheBench is correctly installed and available.
26
41
27
42
```bash
28
43
ab -V
@@ -34,19 +49,19 @@ The output displays the ApacheBench version.
34
49
35
50
Before benchmarking your Django application, you need to install Gunicorn, a production-grade WSGI HTTP server. Gunicorn provides better performance characteristics than Django's development server and more accurately represents real-world deployment scenarios.
36
51
37
-
### Install both Django and Gunicorn using pip:
52
+
### Install both Django and Gunicorn using pip
38
53
39
54
```bash
40
55
python3 -m pip install django gunicorn
41
56
```
42
57
43
-
This installs Django and Gunicorn. Gunicorn is a high-performance WSGI HTTP server that handles multiple concurrent requests efficiently. Unlike Django's built-in development server, Gunicorn is designed for production workloads and provides the multi-worker architecture needed for accurate performance testing.
58
+
This installs Django and Gunicorn. Gunicorn is a production-grade WSGI HTTP server that handles multiple requests at the same time. Unlike Django's built-in development server, Gunicorn uses multiple workers to process requests efficiently, which gives you more accurate performance measurements.
44
59
45
60
## Run Django with Gunicorn
46
61
47
-
Your Django application runs with Gunicorn inside GKE. Gunicorn is deployed inside your Kubernetes Pods and exposed through a Kubernetes Service and LoadBalancer. The benchmark is executed against the external IP of the GKE service.
62
+
Your Django application runs with Gunicorn inside GKE. The Gunicorn server is deployed inside your Kubernetes Pods and exposed through a Kubernetes Service and LoadBalancer. You run the benchmark against the external IP of the GKE service.
48
63
49
-
{{% notice note %}}Ensure your GKE cluster and LoadBalancer are properly configured. If you haven't set up the cluster yet, refer to the previous sections for GKE deployment and service configuration.{{% /notice %}}
64
+
{{% notice Note %}}Ensure your GKE cluster and LoadBalancer are properly configured. If you haven't set up the cluster yet, refer to the previous sections for GKE deployment and service configuration.{{% /notice %}}
50
65
51
66
## Run the benchmark
52
67
@@ -56,9 +71,16 @@ Use ApacheBench to test your Django server with simulated traffic:
56
71
ab -n 5000 -c 100 http://<external_IP_of_the_GKE_service>/healthz/
57
72
```
58
73
59
-
This sends 5000 requests using 100 concurrent connections to your Django REST endpoint exposed through the GKE LoadBalancer. After a few minutes, press CTRL-C to stop the benchmark.
74
+
This command sends 5000 requests with 100 concurrent connections to your Django REST endpoint.
75
+
76
+
Parameters explained:
77
+
-`-n 5000`: total number of requests to send
78
+
-`-c 100`: number of concurrent requests
79
+
-`http://<external_IP_of_the_GKE_service>/healthz/`: your Django health check endpoint
80
+
81
+
Replace `<external_IP_of_the_GKE_service>` with your actual GKE LoadBalancer IP address.
60
82
61
-
The output is similar to:
83
+
The benchmark runs for a few seconds and displays results similar to:
62
84
63
85
```output
64
86
Server Software: gunicorn
@@ -103,24 +125,32 @@ The ApacheBench output provides key performance metrics for evaluating your Djan
103
125
104
126
### Request handling metrics
105
127
106
-
- Concurrency Level: number of simultaneous requests the benchmark sent (100 in this test)
107
-
- Complete Requests: total successful requests processed (5000 in this test)
108
-
- Failed Requests: number of errors or timeouts (0, indicating stable production-grade performance)
128
+
Your benchmark captures three foundational indicators of request handling capacity:
129
+
130
+
- Concurrency Level: simultaneous requests sent during the benchmark (100)
131
+
- Complete Requests: total successful requests processed (5000)
Your Django application's performance under load is measured by three critical metrics:
137
+
112
138
- Requests per Second: how many requests your server handles per second; higher values indicate better throughput (14,001.88 req/sec)
113
139
- Time per Request (mean): average time to complete a single request (7.142 ms)
114
140
- Time per Request (across concurrent): average latency when factoring in concurrent processing (0.071 ms), showing excellent parallel execution on Axion Arm cores
115
141
116
142
### Data transfer metrics
117
143
144
+
The benchmark captures how efficiently your application transfers data across the network stack:
145
+
118
146
- Total Transferred: all data sent and received, including HTTP headers (1,650,000 bytes)
119
147
- HTML Transferred: actual response payload size (75,000 bytes)
120
148
- Transfer Rate: network throughput in KB/sec (4512.32 KB/sec), indicating efficient networking through GKE LoadBalancer
121
149
122
150
### Timing breakdown
123
151
152
+
The timing breakdown section provides detailed insight into how your application spends time processing each request:
153
+
124
154
- Time Taken for Tests: total benchmark duration (0.357 seconds)
125
155
- Connection Times: shows minimum, mean, median, and maximum times for connecting, processing, and waiting
126
156
@@ -134,33 +164,46 @@ Results from the run on the `Axion (C4A) Arm64 GKE nodes`:
134
164
135
165
|**Parameter**|**Description**|**Value**|
136
166
|--------------|------------------|-----------|
137
-
|**Server Software**|Web server used for serving Django | gunicorn |
138
-
|**Server Hostname**|External LoadBalancer IP | 34.132.110.81 |
139
-
|**Server Port**|Port number for benchmark | 80 |
140
-
|**Document Path**|Endpoint used for testing | /healthz/ |
141
-
|**Document Length**|Size of each response | 15 bytes |
142
-
|**Concurrency Level**|Number of concurrent requests | 100 |
143
-
|**Time Taken for Tests**|Total time to complete all requests | 0.357 seconds |
144
-
|**Complete Requests**|Total number of successful requests | 5000 |
145
-
|**Failed Requests**|Number of failed requests | 0 |
The benchmark results demonstrate the strength of running Django on Google Axion (Arm64) GKE:
161
191
162
-
- Extreme Throughput: The cluster sustained 14,000+ requests per second through a public LoadBalancer → GKE → Gunicorn → Django → Cloud SQL → Redis stack.
163
-
- Ultra-Low p95 Latency: Even at 100 concurrent users, 95% of all requests completed within 11 ms.
164
-
- Production Stability: Zero failed requests confirms the platform is resilient under heavy parallel load.
165
-
- Efficient Networking: Over 4.4 MB/sec of data transfer through the GKE LoadBalancer shows Arm-based networking is highly optimized.
166
-
- Cloud-native Scalability: These results validate that Axion Arm64 nodes are well-suited for high-performance, horizontally scalable REST APIs in production.
192
+
- Extreme Throughput: the cluster sustained 14,000+ requests per second through a public LoadBalancer → GKE → Gunicorn → Django → Cloud SQL → Redis stack.
193
+
- Ultra-Low p95 Latency: even at 100 concurrent users, 95% of all requests completed within 11 ms.
194
+
- Production Stability: zero failed requests confirms the platform is resilient under heavy parallel load.
195
+
- Efficient Networking: over 4.4 MB/sec of data transfer through the GKE LoadBalancer shows Arm-based networking is highly optimized.
196
+
- Cloud-native Scalability: these results validate that Axion Arm64 nodes are well-suited for high-performance, horizontally scalable REST APIs in production.
197
+
198
+
## What you've accomplished and what's next
199
+
200
+
In this section, you:
201
+
- Installed and configured ApacheBench for load testing
202
+
- Deployed Gunicorn as a production-grade WSGI server for Django
203
+
- Executed a comprehensive benchmark against your GKE-hosted Django application
204
+
- Analyzed performance metrics showing 14,000+ requests per second with sub-millisecond concurrent latency
205
+
- Validated that Google Axion (Arm64) GKE delivers production-ready performance for Django workloads
206
+
207
+
Your Django application is now proven to handle high-concurrency traffic efficiently on Arm-based infrastructure. You've established a performance baseline that demonstrates the scalability and reliability of running Django on Google Cloud's Axion processors with GKE, Cloud SQL, and Redis.
208
+
209
+
You're ready to optimize further, scale your deployment, or integrate additional services into your cloud-native Django architecture.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/django_application.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ layout: learningpathall
8
8
9
9
## Django REST API with PostgreSQL and Redis
10
10
11
-
This guide walks you through building a production-ready Django REST API that connects to PostgreSQL for data and Redis for caching.
11
+
In this section you'll build a Django REST API that uses PostgreSQL for database storage and Redis for caching. This matches how production applications are typically structured.
12
12
13
-
###Create Django project
13
+
## Create a Django project
14
14
15
15
Set up a clean Python virtual environment and install all runtime dependencies required for Django, PostgreSQL, Redis, and production serving with Gunicorn.
16
16
@@ -37,7 +37,7 @@ django-admin startapp api
37
37
38
38
The Django project structure is ready with all required libraries for database, cache, and API support.
39
39
40
-
###Enable Django apps
40
+
## Enable Django apps
41
41
42
42
Enable the REST framework and API app by editing `django_api/settings.py`. Add 'rest_framework' and 'api' to INSTALLED_APPS, set DEBUG to False, and add '*' to ALLOWED_HOSTS:
43
43
@@ -60,7 +60,7 @@ INSTALLED_APPS = [
60
60
61
61
Django is configured to run as an API server.
62
62
63
-
###Configure PostgreSQL and Redis
63
+
## Configure PostgreSQL and Redis
64
64
65
65
This step connects Django to external managed services instead of local SQLite. This mirrors how real production systems operate.
66
66
@@ -96,7 +96,8 @@ Edit the above addition and set `REDIS_IP` to the actual IP address that you sav
96
96
97
97
The application is configured to use PostgreSQL and Redis.
98
98
99
-
### Migrate the database
99
+
## Migrate the database
100
+
100
101
Django creates tables, metadata, and user models inside PostgreSQL.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/firewall_setup.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,9 @@ For support on GCP setup, see the Learning Path [Getting started with Google Clo
19
19
20
20
Navigate to the Google Cloud Console and create a new firewall rule:
21
21
22
-
- Go to the **Google Cloud Console**
23
-
- Select **VPC network** > **Firewall**
24
-
- Select **Create firewall rule**
22
+
- Go to the **Google Cloud Console**.
23
+
- Select **VPC network** > **Firewall**.
24
+
- Select **Create firewall rule**.
25
25
26
26

Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/installation.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ sudo zypper update -y
20
20
sudo zypper install -y curl git tar gzip
21
21
```
22
22
23
-
###Install Python 3.11
23
+
## Install Python 3.11
24
24
25
25
Install Python 3.11:
26
26
@@ -47,10 +47,6 @@ pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)
47
47
48
48
The Google Cloud CLI is required to authenticate with GCP and allow your Django application VM to interact with Google Cloud services such as GKE, Cloud SQL, Artifact Registry, Memorystore, and to build, deploy, and operate the Django platform.
49
49
50
-
### Install Google Cloud SDK (gcloud)
51
-
52
-
The Google Cloud SDK is required to create and manage GKE clusters.
53
-
54
50
Download and extract the Google Cloud SDK:
55
51
56
52
```bash
@@ -70,7 +66,7 @@ After installation completes, exit and reconnect to apply the PATH changes:
70
66
exit
71
67
```
72
68
73
-
###Initialize gcloud
69
+
## Initialize gcloud
74
70
75
71
Authenticate and configure the Google Cloud CLI:
76
72
@@ -80,7 +76,7 @@ gcloud init
80
76
81
77
During initialization, select **Login with a new account**. You'll be prompted to authenticate using your browser and receive an auth code to copy back. Select the project you want to use and choose default settings when unsure.
82
78
83
-
###Verify authentication
79
+
## Verify authentication
84
80
85
81
```bash
86
82
gcloud auth list
@@ -144,4 +140,4 @@ In this section, you installed:
144
140
- Python 3.11 with a virtual environment
145
141
- Django and Gunicorn for web application development
146
142
147
-
Next, you'll verify Django is working by creating a basic project and running the development server.
143
+
Next, you'll verify Django is working by creating a basic project and running the development server.
0 commit comments