Grafana Cloud k6 subscriptions are based on usage in Virtual-user hours (VU hours, or just VUh).
A VU is an independent thread of execution that runs concurrently to other VU threads. Often, scripts will be designed in such a way that one VU’s activity represents that of one real user.
VUh are deducted for both cloud execution (
k6 cloud) and cloud streaming (
k6 run --out cloud).
Note: We updated our metering algorithm on Jul 13, 2023. Customers who purchased Grafana Cloud k6 before this date will need to contact their account team to discuss making a change.
VUh is calculated by using the following formula:
(Maximum number of VUs x test execution duration in minutes) / 60 minutes = VUh
If your test ramps up to a maximum of 100 VUs and runs for 10 minutes, the test run will use 16.67 VUh ((100 VUs x 10 minutes)/60 = 16.67 VUh).
Note that VU hours are calculated based on the period that the test run executes, not the pre-configured test duration. If the test duration is two or more hours but runs for only 30.01 minutes, then the subscription will be charged for the test-execution period rounded up to the next minute (in this case, 31 minutes).
Arrival-rate executor calculation
When using arrival-rate executors, the calculation for VUh changes. Instead of the formula using the maximum number of VUs, it uses two variables you can set for those scenarios:
maxVUs taking precedence. The formula looks like:
preAllocatedVUsx test execution duration in minutes) / 60 minutes = VUh
In cloud tests with arrival-rate executors, it’s important to properly allocate VUs to meet your RPS target and avoid unnecessary costs from VUs over-provisioning.
For more information on how to allocate VUs in arrival-rate executors, refer to:
Save on VUh by starting locally
To save on VU hours, prototype and debug scripts on a local machine.
After you have the correct logic, increase the load and duration to the desired levels, then run the script with
k6 cloud for managed execution, visualization, and storage.