Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create the firewall rule
/ 100
Create the firewall rule
/ 100
In this hands-on lab, you read through real-world scenarios, recreate the environments, and work on improving the performance of troubled networks.
You compare the different instances to each other, just like the troubleshooting use case, so you can prove the results and become familiar with the steps used to improve your own systems' performance.
This lab adapts blog posts by Colt McAnlis: Core Count and the Egress problem and Internal IP vs External IP. Colt blogs about Google Cloud network performance on Medium.
In this lab, you learn how to perform the following tasks:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
The goal of this lab is to show you the relationship between core size and throughput, so the lab preconfigures six instances when you start the lab.
Run a quick connection test to make sure things are working well.
In the console, for instance-1, click SSH.
In the SSH terminal, run the following command to ping instance-2 (replace <external ip address of instance-2> with the external IP address of instance-2):
Example output:
instance-3 (replace <external ip address of instance-3> with the external IP address of instance-3):Example output:
Everything looks good, so continue to the next section.
This lab also includes preconfigured firewall rules.
The iperftesting firewall rule uses the following configuration:
| Field | Value | Comments |
|---|---|---|
| Name | iperftesting | New rule name |
| Targets | All instances in the network | |
| Source IP ranges | 0.0.0.0/0 | Opens the firewall for any IP address from the internet. |
| Protocols and ports | tcp:5001; udp:5001 | |
| Direction of traffic | Ingress | |
| Action on match | Allow |
Now you're ready to start using the lab.
In this first scenario, you see how the size of the machines you use affects measurable throughput.
Dobermanifesto is a video microblogging network exclusively for pets. Users worldwide can upload animal-based videos and send them anywhere for others to view and experience.
While transferring data to and from their Compute Engine backends, the company observed lower bandwidth than expected:
To reproduce this behavior, engineers created two instances in the same zone and ran iperf between them 100 times.
This performance is even worse! Obviously something was wrong with the test. You need more information and a deeper set of reproduction steps from the company.
Now you set up the scenario.
Return to the VM instances page in the Google Cloud console.
For instance-1 (1vCPU 3.75GB), click SSH, and then run the following command to start an iperf server:
iperf traffic to instance-1 (replace <external ip address of instance-1> with the external IP address of instance-1):Example output:
instance-1 SSH terminal, and then press CTRL+C to stop the iperf server.In the console, for instance-6 (1vCPU e2-micro .6GB), click SSH.
Run the following command to start an iperf server:
Example output:
instance-2 SSH terminal, run the following command to test the connection to instance-6 (replace <internal ip address of instance-6> with the internal IP address of instance-6):Example output:
instance-6 SSH terminal, and then press CTRL+C to stop the iperf server.What happened? Bandwidth appears to have gone up. It may have in your case as well, or it may have been less.
In the next section, you see how total core count constrains bandwidth, and that with a core count of 1, bandwidth never exceeds 2 Gbits/sec or so. As a result, the network speed is slow and bandwidth-constrained, similar to what Dobermanifesto experienced. When you test with 4-vCPU machines next, you see higher throughput.
Why weren't the results much different? The Compute Engine network bandwidth documentation states:
Outbound or egress traffic from a virtual machine is subject to maximum network egress throughput caps. These caps are dependent on the number of vCPUs that a virtual machine instance has. Each core is subject to a 2 Gbits/second (Gbps) cap for peak performance. Each additional core increases the network cap, up to a theoretical maximum of 16 Gbps for each virtual machine.
This means that the more virtual CPUs in your network, the more networking throughput you get.
To evaluate what this looks like in practice, engineers set up different core size groups in the same zone and ran iperf between them 1,000 times.
As the core count goes up, so does the average and maximum throughput. Even with this simple test, you can see that hard 16 Gbps limit on the larger machines.
iperf with multiple threads (~8 or so), you can exceed 10 Gbps and reach about 16 Gbps using an e2-standard-16 or larger machine. This lab environment does not include a machine of that size, so you run a test with multiple threads on a 4-vCPU machine next.The Dobermanifesto network uses 1-vCPU machines. Increasing the core count helps Dobermanifesto achieve better results. Now you test this theory.
iperf server:Example output:
instance-3 (replace <internal ip address of instance-3> with the internal IP address of instance-3):Example output:
instance-4 SSH terminal, run the following command to test with 4 parallel threads (replace <internal ip address of instance-3> with the internal IP address of instance-3):instance-4 SSH terminal, run the following command to test with 8 parallel threads (replace <internal ip address of instance-3> with the internal IP address of instance-3):instance-3 SSH terminal, and then press CTRL+C to stop the iperf server.In these experiments, both the server and client use 4 vCPUs, which greatly increases the speed. The transfer rate increases by 6.64 GBytes, and the bandwidth increases by 5.71 Gbits/sec. With multiple threads, the performance reaches the cap for that core count.
instance-5, which is a higher-performance 4-vCPU machine of instance type highcpu-4.This instance type has faster CPUs, but less memory. What differences do you see, if any, when testing with multiple threads?
Now the Dobermanifesto team needs to decide what route to take. After profiling their CPU usage and reviewing the Compute Engine pricing, they chose an e2-standard-4 machine, which gave them almost 4x the average throughput at a lower cost than e2-standard-8 machines.
One of the nice things about moving to the larger machine is that it actually runs less frequently. It turns out that their machines were spending a lot of time staying awake just to transfer data. With the new machine size, their instances had more downtime, allowing the load balancer to reduce the total number of instances on a daily basis. So on one hand, they paid for a higher-grade machine, but on the other hand, they use fewer core-hours on a monthly basis.
Once your performance directly impacts the bottom line, there are many nuanced tradeoffs to consider.
In this next example, you use iperf to test throughput speed. You set up one machine as the server, point other machines to it, and compare the results.
Gecko Protocol, a B2B company offering a custom, lightweight networking protocol built for gaming and other real-time graphics systems, observed lower-than-expected throughput on its backend machines that transfer and transcode large video and graphics files.
Here are the results of their baseline iperf test:
When duplicating the test, the network setup was identical, but the test results were quite different:
1.95 Gbits/sec was much higher than what Gecko Protocol saw in their graphs. So what's going on?
Now recreate this scenario.
iperf server:Example output:
<external ip address of instance-1> with the external IP address of instance-1):Example output:
Further discussion with Gecko Protocol revealed that they used external IPs to connect their machines, whereas the test used internal IPs. When the machines are in the same network, connecting them with internal IPs results in faster throughput.
instance-2 SSH terminal, run the following command to test the connection using the internal IP address (replace <internal ip address of instance-1> with the internal IP address of instance-1):Example output:
Look at the two different Transfer and Bandwidth rates. In this example, changing to the internal IP address resulted in a 0.9 GBytes improvement in transfer rate, and a 0.78 Gbits/sec improvement in bandwidth. You just proved that the internal connection is faster.
Building on what you learned from solving the Dobermanifesto problem, can using a larger machine improve the network speed even more? instance-2 has only 1 vCPU. How fast is the connection if the machine is a little larger, or a lot larger? Continue to test using the internal IP address (and test the external IP address as well if you have time).
<internal ip address of instance-1> with the internal IP address of instance-1):Example output (your results may differ):
<internal ip address of instance-1> with the internal IP address of instance-1):Example output:
This really improves the throughput rate.
Gecko Protocol also needs to consider which core size works best. This small debugging session improved their video and graphics data transfer by ~14x, which is a significant gain because their offering relies on high-performance backend services.
This lab doesn't cover how to test your own system, but here's additional information to take back with you. For more information on testing your own network, read Network Throughput Testing with iPerf.
If you have time and want to set up a VM to test, feel free. When you create your VMs, make sure to use the iperftest firewall rule and tag. Test both your internal and external IP addresses.
In the Google Cloud console, on the Navigation menu (☰), select VPC network > Firewall.
Click Create firewall rule. Use the following configuration to create a firewall rule:
| Field | Value | Comments |
|---|---|---|
| Name | iperf-testing | New rule name |
| Targets | All instances in the network | |
| Source IP ranges | 0.0.0.0/0 | Opens the firewall for any IP address from the internet. |
| Direction of traffic | Ingress | |
| Action on match | Allow | |
| Protocols and ports | tcp:5001; udp:5001 |
Click Check my progress to verify the objective.
The tendency is to get the workload as close to 100% as possible, which leaves little space for the disk to defragment.
Usage at 90–93% is healthy, but at 98% usage, performance drops because of high contention.
When you test, if I/O performance decays, check the throttle counters. If the counters show no throttling, check CPU usage. If CPU usage is high, that is the source of the problem.
In the lab interface, the Student Resources panel includes links to videos related to this lab.
Congratulations! In this lab, you learned how to test network connectivity and performance using open source tools, and how the size of your machine can affect the performance of your network.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated November 10, 2026
Lab Last Tested October 30, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one