Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Deploy Node.js on Google Cloud C4A (Arm-based Axion VMs)

minutes_to_complete: 30

who_is_this_for: This is an introductory topic for software developers migrating Node.js workloads from x86_64 to Arm-based servers, specifically on Google Cloud C4A virtual machines built on Axion processors.


learning_objectives:
- Provision an Arm-based SUSE SLES virtual machine on Google Cloud (C4A with Axion processors)
- Install and configure Node.js on a SUSE Arm64 (C4A) instance
- Validate Node.js functionality with baseline HTTP server tests
- Benchmark Node.js performance using Autocannon on Arm64 (AArch64) architecture


prerequisites:
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
- Familiarity with networking concepts and [Node.js event-driven architecture](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick)

author: Pareena Verma

##### Tags
skilllevels: Introductory
subjects: Web
cloud_service_providers: Google Cloud

armips:
- Neoverse

tools_software_languages:
- Node.js
- npm
- Autocannon

operatingsystems:
- Linux

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
further_reading:
- resource:
title: Google Cloud documentation
link: https://cloud.google.com/docs
type: documentation

- resource:
title: Node.js documentation
link: https://nodejs.org/en
type: documentation

- resource:
title: Autocannon documentation
link: https://www.npmjs.com/package/autocannon/v/5.0.0
type: documentation

weight: 1
layout: "learningpathall"
learning_path_main_page: "yes"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Getting started with Node.js on Google Axion C4A (Arm Neoverse-V2)

weight: 2

layout: "learningpathall"
---

## Google Axion C4A Arm instances in Google Cloud

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.

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.

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.

## Node.js

Node.js is an open-source, cross-platform JavaScript runtime environment built on Chrome's V8 engine.

It allows developers to build scalable server-side applications, APIs, and backend services using JavaScript. Node.js features an event-driven, non-blocking I/O model, making it highly efficient for handling concurrent connections.

Node.js is widely used for web servers, real-time applications, microservices, and cloud-native backend services. Learn more from the [Node.js official website](https://nodejs.org/en) and its [official documentation](https://nodejs.org/docs/latest/api/).
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
title: Node.js baseline testing on Google Axion C4A Arm Virtual machine
weight: 5

### FIXED, DO NOT MODIFY
layout: learningpathall
---


Since Node.js has been successfully installed on your GCP C4A Arm virtual machine, please follow these steps to make sure that it is running.

## Validate Node.js installation with a baseline test

### 1. Run a Simple REPL Test
The Node.js REPL (Read-Eval-Print Loop) allows you to run JavaScript commands interactively.

```console
node
```
Inside the REPL, type:

```console
console.log("Hello from Node.js");
```
You should see an output similar to:

```output
Hello from Node.js
undefined
```
This confirms that Node.js can execute JavaScript commands successfully.

### 2. Test a Basic HTTP Server
You can now create a small HTTP server to validate that Node.js can handle web requests.

Create `app.js`:

```javascript
const http = require('http');

const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Baseline test successful!\n');
});

server.listen(3000, '0.0.0.0', () => {
console.log('Server running at http://0.0.0.0:3000/');
});
```
- This server listens on port 3000.
- Binding to 0.0.0.0 allows connections from any IP, not just localhost.

Run the server:

```console
node app.js
```
You should see an output similar to:

```output
Server running at http://0.0.0.0:3000/
```
{{% notice Note %}}
Make sure your GCP firewall allows TCP traffic on port 3000. On SUSE Arm64, internal firewalls are usually disabled, so only the GCP firewall needs to be configured.

```console
sudo zypper install -y firewalld
sudo firewall-cmd --permanent --add-port=3000/tcp
sudo firewall-cmd --reload
```
{{% /notice %}}
#### Test Locally with Curl

```console
curl http://localhost:3000
```

You should see an output similar to:

```output
Baseline test successful!
```

#### Test from a Browser
Also, you can access it from the browser with your VM's public IP. Run the following command to print your VM’s public URL, then open it in a browser:

```console
echo "http://$(curl -s ifconfig.me):3000/"
```

You should see the following message in your browser, confirming that your Node.js HTTP server is running successfully:

![Node.js Browser alt-text#center](images/node-browser.png)

This verifies the basic functionality of the Node.js installation before proceeding to the benchmarking.
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: Node.js Benchmarking
weight: 6

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Node.js Benchmarking by Autocannon

After validating that Node.js is installed and your HTTP server is running, you can benchmark it using **Autocannon**.

### Install Autocannon
**Autocannon** is a fast HTTP/1.1 benchmarking tool for Node.js, used to measure server throughput, latency, and request handling under concurrent load.

```console
sudo npm install -g autocannon
```

### Start Your Node.js HTTP Server

```console
node app.js
```

Server should be listening on port 3000:

```output
Server running at http://0.0.0.0:3000/
```

### Run a Basic Benchmark (Local)

```console
autocannon -c 100 -d 10 http://localhost:3000
```
- `-c 100` → 100 concurrent connections
- `-d 10` → duration 10 seconds
- URL → endpoint to test

You should see an output similar to:
```output
Running 10s test @ http://localhost:3000
100 connections


┌─────────┬──────┬──────┬───────┬──────┬────────┬─────────┬───────┐
│ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │
├─────────┼──────┼──────┼───────┼──────┼────────┼─────────┼───────┤
│ Latency │ 1 ms │ 1 ms │ 3 ms │ 3 ms │ 1.2 ms │ 0.62 ms │ 24 ms │
└─────────┴──────┴──────┴───────┴──────┴────────┴─────────┴───────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬──────────┬─────────┐
│ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼──────────┼─────────┤
│ Req/Sec │ 45,279 │ 45,279 │ 54,719 │ 55,199 │ 53,798.4 │ 2,863.96 │ 45,257 │
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼──────────┼─────────┤
│ Bytes/Sec │ 8.78 MB │ 8.78 MB │ 10.6 MB │ 10.7 MB │ 10.4 MB │ 557 kB │ 8.78 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴──────────┴─────────┘

Req/Bytes counts sampled once per second.
# of samples: 10

538k requests in 10.03s, 104 MB read
```

### Understanding Node.js benchmark metrics and results with Autocannon

- **Avg (Average Latency)** → The mean time it took for requests to get a response.
- **Stdev (Standard Deviation)** → How much individual request times vary around the average. Smaller numbers mean more consistent response times.
- **Min (Minimum Latency)** → The fastest request observed during the test.

### Benchmark summary on x86_64
To compare the benchmark results, the following results were collected by running the same benchmark on a `x86 - c4-standard-4` (4 vCPUs, 15 GB Memory) x86_64 VM in GCP, running SUSE:

Latency (ms):

| Metric | 2.5% | 50% (Median) | 97.5% | 99% | Avg | Stdev | Max |
|----------|------|--------------|-------|-----|--------|--------|-------|
| Latency | 0 | 1 | 2 | 2 | 0.73 | 0.87 | 104 |

Throughput:

| Metric | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|------------|--------|--------|---------|---------|----------|-----------|---------|
| Req/Sec | 70,143 | 70,143 | 84,479 | 93,887 | 84,128 | 7,547.18 | 70,095 |
| Bytes/Sec | 13.6 MB| 13.6 MB| 16.4 MB | 18.2 MB | 16.3 MB | 1.47 MB | 13.6 MB|

### Benchmark summary on Arm64
Results from the earlier run on the `c4a-standard-4` (4 vCPU, 16 GB memory) Arm64 VM in GCP (SUSE):

Latency (ms):

| Metric | 2.5% | 50% (Median) | 97.5% | 99% | Avg | Stdev | Max |
|----------|------|--------------|-------|-----|------|-------|------|
| Latency | 1 | 1 | 3 | 3 | 1.2 | 0.62 | 24 |

Throughput:

| Metric | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
|------------|--------|--------|---------|---------|----------|----------|---------|
| Req/Sec | 45,279 | 45,279 | 54,719 | 55,199 | 53,798.4 | 2,863.96 | 45,257 |
| Bytes/Sec | 8.78 MB| 8.78 MB| 10.6 MB | 10.7 MB | 10.4 MB | 557 kB | 8.78 MB |

### Node.js performance benchmarking comparison on Arm64 and x86_64
When you compare the benchmarking results, you will notice that on the Google Axion C4A Arm-based instances:

- Average latency is very low (~1.2 ms) with consistent response times.
- Maximum latency spikes are rare, reaching up to 24 ms.
- The server handles high throughput, averaging ~53,798 requests/sec.
- Data transfer rate averages 10.4 MB/sec, demonstrating efficient performance under load.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Install Node.js
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Install Node.js
This guide walks you through installing **Node.js v24.8.0** on a SUSE Arm64 virtual machine using the official tarball package.

### 1. Download Node.js Binary
First, download the Node.js package (precompiled binaries for Linux Arm64) from the official website.

```console
sudo wget https://nodejs.org/dist/latest/node-v24.8.0-linux-arm64.tar.gz
```

### 2. Extract the Tarball
Unpack the downloaded file so we can access the Node.js binaries.

```console
sudo tar -xvf node-v24.8.0-linux-arm64.tar.gz
```

### 3. Rename Extracted Directory
Rename the extracted folder to something shorter such as node-v24.8.01 for easier reference.

```console
sudo mv node-v24.8.0-linux-arm64 node-v24.8.0
```

### 4. Create a Symlink (Optional)
This step creates a shortcut (`/usr/local/node`) pointing to your Node.js installation directory.

It makes future upgrades easier — you only need to update the symlink instead of changing paths everywhere.

```console
sudo ln -s /usr/local/node-v24.8.0 /usr/local/node
```

### 5. Update PATH Environment Variable

Add Node.js binaries to your PATH so you can run `node` and `npm` commands from anywhere in your terminal.

```console
echo 'export PATH=$HOME/node-v24.8.0/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
```

### 6. Verify Installation
Check that Node.js and npm (Node’s package manager) are installed correctly.

```console
node -v
npm -v
```
You should see an output similar to:
```output
v24.8.0
11.6.0
```

Node.js installation is complete. You can now proceed with the baseline testing.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Create a Google Axion C4A Arm virtual machine on GCP
weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Overview

In this section, you will learn how to provision a Google Axion C4A Arm virtual machine on Google Cloud Platform (GCP) using the `c4a-standard-4` (4 vCPUs, 16 GB memory) machine type in the Google Cloud Console.

{{% notice Note %}}
For support on GCP setup, see the Learning Path [Getting started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/).
{{% /notice %}}

## Provision a Google Axion C4A Arm VM in Google Cloud Console

To create a virtual machine based on the C4A instance type:
- Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
- Go to **Compute Engine > VM Instances** and select **Create Instance**.
- Under **Machine configuration**:
- Populate fields such as **Instance name**, **Region**, and **Zone**.
- Set **Series** to `C4A`.
- Select `c4a-standard-4` for machine type.

![Create a Google Axion C4A Arm virtual machine in the Google Cloud Console with c4a-standard-4 selected alt-text#center](images/gcp-vm.png "Creating a Google Axion C4A Arm virtual machine in Google Cloud Console")


- Under **OS and Storage**, select **Change**, then choose an Arm64-based OS image. For this Learning Path, use **SUSE Linux Enterprise Server**. Pick the preferred version for your Operating System. Ensure you select the **Arm image** variant. Click **Select**.
- Under **Networking**, enable **Allow HTTP traffic**.
- Click **Create** to launch the instance.