At Hotels.com™, part of Expedia Group™, we deploy our services on Kubernetes. Many of those services are deployed to production multiple times per week while Kubernetes restarts pods and applications on a regular basis.
When an application starts as part of a deploy, redeploy, or restart, the very first requests are expected to be slow.
Although there are many reasons that contribute to this and to various extents (e.g. class loading, lazy initialization of connection pools and thread pools, SSL handshake), having a warmup routine that sends dummy requests before the application receives any traffic is a common practice to reduce the impact of the so called “cold-start” issue.
Despite the fact that many tools exist for making either HTTP/REST or gRPC calls most of them only support REST, and it’s not trivial to run them on Kubernetes or as linked containers.
Its main features are summarised below:
You can run it as a standalone [command-line tool], as a [linked Docker container], or even as a [sidecar on Kubernetes].
Mittens is written in Go. It uses default libraries for HTTP calls and makes use of reflection and of the grpcurl tool for gRPC calls.
The application receives a number of command-line flags. You can read the [documentation]
Mittens has been open-sourced
Mittens run as a sidecar container next to the main container in our application pods. It usually runs for a time-window between 1 and 2 minutes.
A useful feature for many application owners has been the placeholders for random elements. This can be used to test the same endpoint with different combinations and values for parameters, hence avoiding cache hits. Another common use case for applications serving a booking website is to be able to generate and send requests to urls that include valid dates.
It is worth mentioning that a successful run of the tool is not a requirement for our applications to start. This decision has been taken by having the following in mind:
#docker #open-source #software-engineering #devops #kubernetes