What is Valence?

Written by Domenic Rosati | 14-05-2019

Hiya 👋, As Kubernetes operators, we love Kubernetes autoscaling, resource control, and scheduling capabilities, but ran into issues with how to autoscale, how to set resources, and how to ensure performance in the most cost effective way. So, we built Valence as a tool to help with that. Here's a little more about what Valence is and how it works.

What: Valence is a cost and performance management solution for Kubernetes. It’s an operator that figures out replicas, limits, requests, and quality of service for the most cost-efficient and performant way of running your applications in Kubernetes. Operators use Valence by declaring their performance in Service Level Objective manifests and it is Valence's job to go figure out the best way to run, resource, and auto-scale the app based on those Service Level Objectives.


apiVersion: optimizer.valence.io/v1alpha1
kind: ServiceLevelObjective
 name: slo-webapps
   slo: slo-webapps
   - type: HTTP
         percentile: 95
         responseTime: 500ms

Why: Kubernetes, as a platform, is agnostic to how you resource your applications, how they perform, and how much they cost. As an operator in Kubernetes it is your job to figure out the quality of service for your application, figure out the optimal resources, limits, replicas (or optimal autoscaling config/metrics/threshold) and continually update those as your code changes. It is also your job to figure out how those relate to your cost within Kubernetes and the resulting performance from those resources.

How: Valence is built on control theory. Valence models application behavior by learning the dynamics of how applications consume resources as related to 1) their workloads (ie. HTTP requests in the case of HTTP applications) and 2) their controls (ie. what happens when I change replicas or CPU limits). Once we model applications we can learn the optimal tradeoff between efficiency resourcing and performance. On top of this, Valence utilizes time series analysis to learn to forecast workloads in order to make better decisions about when to change resources in order to continually meet service level objectives.

What about the k8s autoscalers: Isn't this what the autoscalers (will) do? Sure this is, in-part, what the autoscalers in Kubernetes accomplish. There are two fundamental differences though that make Valence and the notion of declarative performance interesting for us to pursue:

  1. DDeclaring Performance and Service Level Objectives is more declarative than configuring autoscalers based on manually calculated thresholds and metrics.
  2. Understanding your applications design, behaviour, and workloads is hard. If there was a way to take declared performance, learn application behaviour, forecast its workload, and configure everything accordingly - it seems to us worth pursuing.

Why would I use it? There are several use cases that we'd like to begin publishing here on our blog but generally they lump into three categories:

  1. To determine what your resources (requests, limits, and replicas) and quality of service (difference between limit and request) should be. It’s either hard to determine these or takes lots of time. By using Valence on your applications you are able to determine these from the beginning.
  2. Performance management and Service Level Objective compliance - How can I ensure the performance of my application? What resources do they need? How should they be autoscaled? What quality of service should they get? How can I preemptively resource before workloads spikes? By using Valence you'll be able to declare your performance objectives and have Valence go an figure out the answers to those questions.
  3. Cost efficiency and Density - How can I reduce the costs of my Kubernetes cluster? How can I pack more applications on nodes and reduce slack capacity / under utilization? How do I do these without degrading performance? Valence meets performance objectives with the minimum resources necessary and it knows to do this based on learned application behaviour and forecasted traffic. By knowing the application dynamics, Valence can ensure optimal resourcing without performance degradation.

How can I use it?

Valence is available right now and you can get started on our github repo: https://github.com/valencenet/valence-manifests. Or our quick getting started guide

It has everything you need to get Valence up and running for unlimited deployments!

If you have any feedback we’d love to hear it! You can email us at feedback @ info@valence.net.