Following up on my earlier post, I am publishing a perftest utility application that measures web page performance, including underlying network latency, and which further demonstrates how to use some of the features of the Rafay platform. First, I want to point out we're not a performance testing company ... we use Pingdom and other services to monitor our production infrastructure. But performance measurement is a passion of mine, and this was a good way to learn about net/http and httptrace in GoLang...
What is Rafay Systems? We're a start-up building and operating a platform to distribute, scale and run containerized applications anywhere in the world, with lower effort and cost than building your own clusters. We believe in cloud-native, open-source, multi-cloud, and distributed computing. We're sharing code and lessons learned from our journey as part of giving back to the community that helped us get this far so fast.
Measuring Web Performance - The Perftest Application
There are a variety of performance measurement applications available, focused on many different needs. Why do we need another one? Perhaps we don't... but let me outline a few reasons why this application may be of interest. Then you be the judge.
- Perftest lets you measure performance over time, across multiple web sites, with a small disk and memory footprint. To get here I learned some cool tricks on how to build minimal containers from scratch.
- The github repo takes you through a journey from a simple standalone application to a containerized microservice running in many clusters. This may be helpful if you are transitioning a standalone application to a cloud-native microservices environment.
- The fully evolved perftest app includes alerts if response goes beyond a bound you set (via Twilio text/email), and data visualization (via Kibana/Elastic), which shows how performance changes over a day, a week, or more. I have observed some interesting anomalies.
- When deployed across many locations, you can see how sites and applications perform from different geographies at the same time. Network round trip time (RTT, think ping time) varies by location, so you can "triangulate" the location of a website, or determine that a single hostname runs from many locations.
- Finally, it's free code you can experiment with to build your own tailored applications. For example, perhaps you want to run a series of requests to GET a base page, POST login credentials, navigate to a second page, and report the total transaction time.
The application illustrates how you can use the Rafay platform to run a microservice across many public and private cloud locations – but of course you're not tied to our platform. You can take the source and build and run it where you like.
Show Me The Code
OK! Let's get right into it. The code is on github in our new rafayopen org. In that repo the Makefile lets you build and run three flavors of web site performance measurement and monitoring:
- Standalone – build the golang code and run it from the shell.
- Docker – build a container and run as a component, locally or on other systems.
- Rafay Workload – publish the docker container to one or more Rafay cluster locations on our platform.
The README file walks you through the steps to build each flavor. The git history also lets you see the app through time, from the minimal version 1 to the evolved version 2 with alerting and reporting. Let's look quickly at the evolution of this application.
The first version (tagged v1 in DockerHub and the v1 branch GitHub) contains the core performance testing code, leveraged from Dave Cheney's httpstat (which built upon the python httpstat by reorx). It includes the core structures and functions to fetch a page and report the detailed timing information.
The second version adds reporting via a webhook, which can send measurements to any JSON-compatible ingest service. We used a StreamSets receiver. It also can publish to AWS CloudWatch, where you can visualize the data using ElasticSearch and Kibana, to see web page performance over time. Finally, it adds code to integrate with the Twilio email and text message alerting system, so you can send a text if a request takes too long.
Inclusion of the v2 features impacts readability a bit, and increases the size of the application from about 8.5 MB for the v1 docker container to 13.5 MB for the v2 app. So I created the two versions. I'm interested in any feedback you may have for me.
How Do I Run This On Rafay
Instructions in the README file describe how to can sign up for a free account, and walks you through the steps to publish the docker container to the Rafay platform. Give it a try! You get instant access to compute across the world...
I hope the perftest example app will be useful and interesting to you. And there's much more to come.
Soon we are publishing the Kubernetes CRDs that turn a vanilla Kubernetes cluster into a Rafay cluster. And some additional tools and sample applications that demonstrate how to make use of the platform we've built. We are interested in comments, questions and suggestions and welcome you to join the discussion via our blog, on github, or directly via email … I’m email@example.com or you can contact firstname.lastname@example.org for more information about the business.