Understand your Performance Testing invoice
Depending on your plan, Performance Testing billing considers the following:
- Virtual user hours: The number of simulated users active in a test. Note that simulated browser-users are more expensive.
- Static IP addresses: The number of provisioned static IP addresses in your account. For more details, refer to Static IP addresses.
- Data retention: The amount of time that your test data is stored. For more details, refer to Data retention.
Virtual User Hours is the main unit that Grafana Cloud uses when calculating your invoice.
Virtual User Hours calculation
Grafana Cloud k6 subscriptions are based on usage in Virtual User Hours (VU hours, or just VUH).
A Virtual User (VU) is an independent thread of execution that runs concurrently with other VU threads. Often, scripts are designed so that one VU activity represents that of one real user.
A Virtual User Hour (VUH) can be calculated with the following formula:
(Maximum number of VUs * test execution duration in minutes) / 60 minutes = VUH
The above formula is a baseline calculation, but your invoice calculation varies depending on your subscription plan:
- Fractional VUH v2 - this plan offers more flexibility and takes into account a volume-based adjustment, and an on-premise adjustment when calculating your monthly cost.
- Fractional VUH v1 - this plan takes into account the number of VUH used by your tests, and calculates the cost based on fractional increments.
- Full VUH - this plan takes into account the number of VUH used by your tests, and rounds the total number up.
Note
Contact your account team to make changes to your subscription plan.
Types of VUs
For the purposes of VUH calculation, there are two types of VUs:
- Protocol VUs - these are VUs calling API endpoints. They often represent the main portion of a test.
- Browser VUs - these are VUs employing a web browser to test frontend functionality.
The total number of VUs in your test is the sum of Protocol VUs and Browser VUs.
Modes of execution
There are several different ways to run a performance test in Grafana Cloud k6, which include:
- Cloud execution - running a test using
k6 cloud run
. - Cloud streaming - running a test using
k6 run –out cloud
andk6 cloud run –local-execution
.
Both methods count towards your total number of VUH. They can be billed differently depending on your subscription plan.
Billing calculations
Each subscription plan has a different method for calculating the total VUH, as well as any modifiers that are applied to your cost calculation.
Fractional VUH v2 calculation
The Fractional VUH v2 calculation method is:
(Maximum number of VUs * test execution duration in minutes) / 60 minutes = VUH
The minimum cost for a test is 1 VUH. If a test uses both protocol and browser-VUs, the minimum cost is 2 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 only runs for 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).
There are two adjustments that are applied to the VUH calculation method: a volume-based adjustment and an on-premise execution adjustment.
Volume-based adjustment
Tests that use a higher number of VUH receive automatic adjustments to account for scale. The following table describes the adjustment applied to each VUH range:
VUH Range | Effective Rate | Max Charged | Notes |
---|---|---|---|
1-100 VUH | 100% | 100 VUH | No discount |
101-500 VUH | 80% (of 400 VUH) | 320 VUH | Applies only to VUH from 101 to 500. |
501-1,000 VUH | 53.33% (of 500 VUH) | 266.65 VUH | Applies only to VUH from 501 to 1,000. |
1,001-5000 VUH | 33.33% (of 4,000 VUH) | 1333.2 VUH | Applies only to VUH from 1,001 to 5,000. |
5001-10,000 VUH | 26.67% (of 5,000 VUH) | 1333.5 VUH | Applies only to VUH from 5,001 to 10,000. |
10,001+ VUH | 20% | Charged at 0.2 VUH per VUH consumed above 10,000. |
For example, a test that uses 500 VUH would have the following calculation:
100 VUH (no adjustment applied) + 400 VUH * 0.8 = 420 VUH
On-premise execution adjustment
Tests that are run locally using the k6 CLI and then stream results to Grafana Cloud receive a 25% adjustment to account for infrastructure savings.
Refer to Use the CLI to learn more about local test execution.
Protocol and browser VU adjustment
Tests that use different types of VUs also receive an adjustment when calculating the total billing:
- Protocol-based VUs (API requests, HTTP, gRPC, WebSocket, etc.): billed at 1x the standard rate.
- Browser-based VUs: billed at 10x the standard rate due to increased resource usage.
Scenarios
- Small API test: A test that uses 50 VUs for 10 minutes.
(50 VUs * 10 minutes) / 60 minutes = 8.33 VUH
No adjustments are applied to the final amount.
- Large-scale load test with volume adjustment: A test that uses 5,000 VUs for 1 hour.
(5,000 VUs * 60 minutes) / 60 minutes = 5000 VUH
Then, a volume adjustment is applied since the test uses more than 100 VUH:
(100 * 1) + (400 * 0.8) + (500 * 0.53333) + (4000 + 0.3333) = 2,019.865 VUH
- Large-scale load test with volume and on-premise execution adjustment: A test that uses 5,000 VUs for 1 hour, and is executed in a Private Load Zone.
Similar to the previous example, the first two steps of the calculation are:
(5,000 VUs * 60 minutes) / 60 minutes = 5000 VUH
The volume adjustment is applied:
(100 * 1) + (400 * 0.8) + (500 * 0.53333) + (4000 + 0.3333) = 2,019.865 VUH
And then the on-premise execution adjustment is applied:
2,019.865 * 0.75 = 1,514.89875 VUH
Fractional VUH v1 calculation
Note
The Fractional VUH v2 plan offers an improved calculation and adjustments for larger VU performance tests and local test executions. Contact your account team to make changes to your subscription plan.
The Fractional VUH calculation method is:
(Maximum number of VUs * test execution duration in minutes) / 60 minutes = VUH
The minimum cost for a test is 1 VUH. If a test uses both protocol and browser-VUs, the minimum cost is 2 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 only runs for 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).
Protocol and browser VU adjustment
Tests that use different types of VUs receive an adjustment when calculating the total billing:
- Protocol-based VUs (API requests, HTTP, gRPC, WebSocket, etc.): billed at 1x the standard rate.
- Browser-based VUs: billed at 10x the standard rate due to increased resource usage.
Scenarios
- Small API test: A test that uses 50 VUs for 10 minutes.
(50 VUs * 10 minutes) / 60 minutes = 8.33 VUH
- Hybrid API and browser test: A test that uses 50 protocol VUs and 10 browser VUs for 1 hour.
First, calculate the protocol VUH total:
(50 VUs * 10 minutes) / 60 minutes = 8.33 VUH
Then, calculate the browser VUH total:
(10 * 10 VUs * 10 minutes) / 60 minutes = 16.67 VUH
And the total value is the sum of both types of VU:
8.33 VUH + 16.67 VUH = 25 VUH
Full VUH calculation
Note
The Fractional VUH v2 plan offers an improved calculation and adjustments for larger VU performance tests and local test executions. Contact your account team to make changes to your subscription plan.
The Full VUH calculation method is:
Maximum number of VUs * test execution duration rounded up to the next hour = VUH
The minimum cost for a test is 1 VUH. If a test uses both protocol and browser-VUs, the minimum cost is 2 VUH.
Protocol and browser VU adjustment
Tests that use different types of VUs also receive an adjustment when calculating the total billing:
- Protocol-based VUs (API requests, HTTP, gRPC, WebSocket, etc.): billed at 1x the standard rate.
- Browser-based VUs: billed at 10x the standard rate due to increased resource usage.
The cost of running Browser VUs is calculated using the following formula:
(Maximum number of VUs x test execution duration rounded up to the next hour) * 10 = VUH
Scenarios
- Small API test: A test that uses 50 VUs for 10 minutes.
50 VUs * ROUNDUP(10/60) = 50 VUH
- Hybrid API and browser test: A test that uses 50 protocol VUs and 10 browser VUs for 10 minutes.
(50 VUs * ROUNDUP(10/60)) + ((10 Browser VUs * ROUNDUP(10/60)) * 10) = 150 VUH
Arrival-rate executor calculation
k6 has two executors that you can use to set the test load in terms of RPS (requests per second): constant arrival rate and ramping arrival rate.
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: preAllocatedVUs
, and maxVUs
, with maxVUs
taking precedence.
For a fractional VUH subscription, you can use the following formula:
(`maxVUs` or `preAllocatedVUs` x test execution duration in minutes) / 60 minutes = VUH
And for a full VUH subscription, you can use the following formula:
`maxVUs` or `preAllocatedVUs` x (test execution duration in minutes rounded up to the next hour) = VUH
The same 10x multiplier for VUs using browsers apply here too.
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:
Static IP addresses
Static IP addresses are IP addresses that don’t change over time. You can add them to your account, and use them when running performance tests for additional security and convenience. With static IP addresses, you can allowlist traffic from Grafana Cloud public load generators and identify logs and traffic created by tests in your observability suite.
- Refer to Manage static IP addresses for more details on how to manage and use static IP addresses.
- Refer to Grafana Cloud features for pricing details.
Data retention
Warning
Test-result data older than what is specified in your plan is automatically deleted.
Your data retention policy specifies how long the k6 Cloud service keeps your test-result data.
While test-result data is subject to your data retention policy, your user data and test configurations are saved indefinitely. Keep in mind that the data referenced in the following sections of this page refers only to test result data.
Length of data retention
Note
In some informal communication, Grafana might define a data-retention period in months instead of days. In this context, a month of data retention is a unit equal to 30 days.
Performance Testing retains data on a rolling basis, from when the test runs until the length specified by your subscription. This rolling period applies only to active subscriptions. If you cancel your subscription, Performance Testing retains the data for seven days past the subscription expiration.
Refer to Grafana Cloud features for each subscription’s data retention length.
Save test data
Besides purchasing more data retention, you have a few other options to save test data:
- Set the results of a specific test run as a baseline. Baseline test results are exempt from data retention rules and are saved indefinitely.
- Add results from all runs of a test to your saved tests.
- Export the results and save them locally.