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/background.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
@@ -31,6 +31,6 @@ To learn more, visit the [Django website](https://www.djangoproject.com/) and ex
31
31
32
32
You now understand the capabilities of Google Axion C4A Arm-based VMs and why Django is an excellent choice for building web applications on Arm infrastructure. The combination provides a cost-effective, high-performance platform for deploying Python web applications at scale.
33
33
34
-
In the next sections, you'll provision your own Arm-based VM on Google Cloud, install Django, and benchmark your application's performance. You're ready to start building!
34
+
In the next sections, you'll provision your own Arm-based VM on Google Cloud, install Django, and benchmark your application's performance.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/baseline.md
+17-26Lines changed: 17 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,22 +8,11 @@ layout: learningpathall
8
8
9
9
## Verify Django is working on your Arm-based VM
10
10
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. This hands-on verification ensures your environment is ready for development and testing.
12
-
13
-
By the end of this section, you'll have:
14
-
- Created a Django project with proper directory structure
15
-
- Configured Django to accept requests from your VM's external IP
16
-
- Run the development server and accessed it from your browser
17
-
- Built a simple Django app with custom routing and views
18
-
- Verified that Django can handle HTTP requests and render responses
19
-
20
-
Let's get started!
21
-
22
-
## Create and test a basic Django project
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.
23
12
24
13
Run the following command to create a new Django project named `myproject`:
25
14
26
-
```console
15
+
```bash
27
16
django-admin startproject myproject
28
17
cd myproject
29
18
```
@@ -46,7 +35,7 @@ The `manage.py` file is Django's command-line utility for project management. Th
46
35
47
36
Set up your project's database by running migrations, which create the required tables for Django's built-in apps:
48
37
49
-
```console
38
+
```bash
50
39
python3 manage.py migrate
51
40
```
52
41
@@ -58,27 +47,29 @@ Before starting the Django development server, you must configure your `ALLOWED_
58
47
59
48
Navigate to your project settings directory:
60
49
61
-
```console
50
+
```bash
62
51
cd~/myproject/myproject/
63
52
```
64
53
65
54
Open `settings.py` using a text editor:
66
55
67
-
```console
56
+
```bash
68
57
edit myproject/settings.py
69
58
```
70
59
71
-
- Locate the `ALLOWED_HOSTS` Line
72
-
Inside the file, find the following line:
60
+
- Locate the ALLOWED_HOSTS line
61
+
62
+
Inside the file, find the following line:
73
63
74
64
```python
75
65
ALLOWED_HOSTS= []
76
66
```
77
67
78
68
Update it to allow your VM's external IP address:
79
69
80
-
- Allow All Hosts (for Testing Only)
81
-
To make your Django app accessible from your VM’s external IP address, update it to:
70
+
- Allow all hosts (for testing only)
71
+
72
+
To make your Django app accessible from your VM's external IP address, update it to:
Now that you've configured `ALLOWED_HOSTS`, start the development server:
94
85
95
-
```console
86
+
```bash
96
87
python3 manage.py runserver 0.0.0.0:8000
97
88
```
98
89
@@ -110,7 +101,7 @@ Replace `<YOUR_VM_EXTERNAL_IP>` with the public IP address of your GCP VM.
110
101
111
102
You should see the Django welcome page with the message "The install worked successfully!":
112
103
113
-

104
+

114
105
115
106
## Build a simple Django app with custom routing
116
107
@@ -124,7 +115,7 @@ Press **Ctrl + C** in your terminal to stop the Django development server.
124
115
125
116
Within your Django project directory, create a new app named `hello`:

228
+

238
229
239
230
## Summary and what's next
240
231
241
-
You've successfully verified that Django is installed and working on your Arm-based VM. Your application can serve web requests, handle routing, and render custom views. Great job, you're ready to benchmark your Django application!
232
+
You've successfully verified that Django is installed and working on your Arm-based VM. Your application can serve web requests, handle routing, and render custom views.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/benchmarking.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,34 +16,35 @@ To begin, if your Django development server is still running, stop it using `Ctr
16
16
17
17
ApacheBench (`ab`) is a command-line tool that simulates multiple HTTP requests to measure web server performance. Install it using the following:
18
18
19
-
```console
19
+
```bash
20
20
sudo zypper install -y apache2-utils
21
21
```
22
22
23
23
### Verify installation
24
-
This command confirms ApacheBench is correctly installed and available system-wide:
25
24
26
-
```console
25
+
Confirm ApacheBench is correctly installed and available:
26
+
27
+
```bash
27
28
ab -V
28
29
```
29
30
30
-
The output displays the ApacheBench version, confirming successful installation.
31
+
The output displays the ApacheBench version.
31
32
32
33
### Install and configure Gunicorn
33
34
34
35
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.
35
36
36
37
### Install both Django and Gunicorn using pip:
37
38
38
-
```console
39
+
```bash
39
40
python3 -m pip install django gunicorn
40
41
```
41
42
This command installs two essential packages. Django is the Python web framework you're benchmarking, while Gunicorn serves as 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.
42
43
43
44
### Run Django with Gunicorn
44
45
Start your Django application using Gunicorn (already running inside GKE):
45
46
46
-
Gunicorn is deployed inside your Kubernetes Pods and exposed via a Kubernetes Service and LoadBalancer.
47
+
Gunicorn is deployed inside your Kubernetes Pods and exposed through a Kubernetes Service and LoadBalancer.
47
48
The benchmark is executed against the **external IP of the GKE service**.
48
49
49
50
{{% notice Note %}}
@@ -54,10 +55,13 @@ Ensure your VM's firewall allows inbound traffic on port 8000. See the firewall
54
55
55
56
Use ApacheBench to test your Django server with simulated traffic:
56
57
57
-
```console
58
+
```bash
58
59
ab -n 5000 -c 100 http://<external_IP_of_the_GKE_service>/healthz/
59
60
```
60
-
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 and display results similar to:
61
+
62
+
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.
63
+
64
+
The output is similar to:
61
65
62
66
```output
63
67
Server Software: gunicorn
@@ -154,7 +158,7 @@ Results from the run on the `Axion (C4A) Arm64 GKE nodes`:
154
158
The benchmark results demonstrate the strength of running Django on Google Axion (Arm64) GKE:
155
159
156
160
- Extreme Throughput: The cluster sustained 14,000+ requests per second through a public LoadBalancer → GKE → Gunicorn → Django → Cloud SQL → Redis stack.
157
-
- Ultra-Low p95 Latency: Even at 100 concurrent users, 95% of all requests completed within 11 ms, proving excellent tail-latency control.
161
+
- Ultra-Low p95 Latency: Even at 100 concurrent users, 95% of all requests completed within 11 ms.
158
162
- Production Stability: Zero failed requests confirms the platform is resilient under heavy parallel load.
159
163
- Efficient Networking: Over 4.4 MB/sec of data transfer through the GKE LoadBalancer shows Arm-based networking is highly optimized.
160
164
- Cloud-native Scalability: These results validate that Axion Arm64 nodes are well-suited for high-performance, horizontally scalable REST APIs in production.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/django-on-gcp/containerization-and-deploy.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ weight: 9
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Containerize and Deploy Django on Axion GKE
10
-
This guide converts your Django REST API into a **production-grade Arm64 container** and deploys it on **Axion-powered Google Kubernetes Engine (GKE)**.
11
-
You will validate that the workload runs **natively on Arm** and is **publicly accessible** via a cloud Load Balancer.
9
+
## Containerize and deploy Django on Axion GKE
12
10
13
-
### Create Docker Image
11
+
This guide converts your Django REST API into a production-grade Arm64 container and deploys it on Axion-powered Google Kubernetes Engine (GKE). You will validate that the workload runs natively on Arm and is publicly accessible through a cloud Load Balancer.
12
+
13
+
### Create Docker image
14
14
This step packages your Django API and all its dependencies into a **portable container image** that can run on any Axion Arm64 node.
15
15
16
16
Create a file called: `requirements.txt` and insert the following:
Please wait until the EXTERNAL-IP field gets populated! It will be needed in the next step.
152
+
Wait until the EXTERNAL-IP field is populated. This is needed in the next step.
151
153
152
154
### Validate public access
153
155
@@ -159,7 +161,7 @@ http://<EXTERNAL-IP>/healthz/
159
161
160
162
You should see output similar to the following:
161
163
162
-

164
+

163
165
164
166
Your Arm-based Django API is live on the internet.
165
167
@@ -171,6 +173,6 @@ You have deployed a fully cloud-native, Arm-optimized application:
171
173
- Exposed through Google Cloud LoadBalancer
172
174
- Backed by Cloud SQL PostgreSQL
173
175
- Accelerated by Memorystore Redis
174
-
- Delivered via Artifact Registry
176
+
- Delivered through Artifact Registry
175
177
176
178
This is a real production architecture running on Arm in GCP.
0 commit comments