Nerdsense

Smoke Tests: The Production Combine

Greg Heffner September 11, 2024
Smoke Test

Solutions Used:

Uptime Robot: https://dashboard.uptimerobot.com/monitors/796996039
Locust: https://locust.io
Lens: lensapp/lens

I load test my webpage I built at home with some free tools to make sure I am ready for this site to take off!

I am running a nginx webpage in a kubernetes three node cluster. I like track my websites uptime and keep it as high as possible. I use UptimeRobot because its free and my current uptime is 99.943%!!! This is way over the top but if you havent found out already, when I am interested in something I go all in. One thing I have learned both professionally and personally is no matter how small the change you need to validate after the fact.

Uptime

Build Details: K8s Build: GitHub K8 build
NGINX docker Image: docker pull technotuba/nginx:v2
Prod URL: https://greg.heffner.live

Locust is a open-source load testing tool that is made to test the performance of websites.

I like to test my webpage with 100,000 simulated users with a hatch rate of about 1,000 user bursts. Locust acts like a swarm of users and the bursts are the waves of additional people.

locust

Some important definitions

  • RPS: Requests per Second
  • Failures/s: Number of failed requests per second
  • 95th percentile: the top traffic response time
  • Average response time: the time it takes to load the page on average
  • Number of users: Users in the test
Perf test

Interpretation:

I look for three main things when I run my performance tests. When I look into the Requests per Second I look for steep dives. These dives for example at around 9:02:49 PM where we see around 800 RPS to about 300 RPS. This could point to issues with the pods like over utilization, bottlenecks, or network issues. The opposite spike with a steep incline in the response times would be bad as well. The higher the response time the longer it takes for the page to load. If you see high response times this could lead to a bad customer experience. Finally I look at Lens while the tests are running to make sure my horizontal pod autoscalers are working and to monitor the cluster.

K8 cluster

To wrap up, maintaining a high-performing and reliable website is no small feat, but with the right tools and dedication, its certainly achievable. By leveraging Kubernetes for scalability, NGINX for efficient web serving, and tools like UptimeRobot and Locust for monitoring and load testing, youve built a robust system ready to handle significant traffic.

Bing AI explaining what Locust is

What is Locust?

Imagine you have a toy that can test how strong your other toys are. Locust is like that toy, but for computers and websites. Its a tool that helps people see how well a website or app can handle lots of people using it at the same time. How to Use Locust

Pretend Play: Think of Locust as a game where you pretend to be lots of people visiting a website.
Write a Story: You write a little story (in computer language) about what these people do on the website. For example, they might click buttons, fill out forms, or just look around.
Start the Game: You tell Locust to start the game. It will pretend to be all those people and do what you wrote in the story.
Watch the Fun: Locust will show you how the website is doing. If the website is slow or has problems, Locust will let you know.

Why Use Locust?

Just like testing how strong your toys are, Locust helps people make sure their websites and apps are strong and can handle lots of visitors without breaking.

About Me

I served in the U.S. Army, specializing in Network Switching Systems and was attached to a Patriot Missile System Battalion. After my deployment and Honorable discharge, I went to college in Jacksonville, FL for Computer Science. I have two beautiful and very intelligent daughters. I have more than 20 years professional IT experience. This page is made to learn and have fun. If its messed up, let me know. Im still learning :)

Weather Loop