Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
BETALoad TestingInfrastructure

Harness-Managed Infrastructure

Run load tests on Kubernetes infrastructure that Harness provisions and manages, without installing an agent or connecting your own cluster

This feature is in Beta and requires enablement. View all early access features.

Harness-managed infrastructure runs your load test on Kubernetes infrastructure that Harness provisions, operates, and cleans up for you. You do not install a chaos agent, connect a cluster, or onboard a service before your first run. Select the option when you create a load test, then click Run.


What you will learn from this topic

  • When to use it: How Harness-managed infrastructure compares with self-hosted infrastructure.

  • How to use it: Create and run a load test on Harness-managed infrastructure.

  • What to expect: How Harness prepares the infrastructure, what it creates in your project, and when it cleans up.

  • Limits: The quotas that apply to Harness-managed runs and what to do when a run reaches one.


Before you begin

  • Load Testing enabled: Load Testing is behind a feature flag (CHAOS_LOAD_TESTING_ENABLED). Go to Get started with Load Testing to create your first load test.

  • Harness-managed infrastructure enabled: The option appears in the Load Test Studio only when it is enabled for your account.

  • Reachable target: An application endpoint that accepts traffic from a Harness-hosted Kubernetes cluster.

Contact Harness Support

If Harness-managed infrastructure does not appear under Execution Environment in the Load Test Studio, contact your account administrator or Harness Support to enable it for your account.


Choose between managed and self-hosted infrastructure

Every load test runs on one of two kinds of infrastructure. You select the kind on the Overview tab of the Load Test Studio, under Execution Environment > Infrastructure.

Infrastructure
Who runs it
What you set up first
Best for

Harness-managed infrastructure

Harness provisions and manages Kubernetes infrastructure for your project.

Nothing. Harness prepares the infrastructure on the first run.

Getting started quickly, and testing endpoints that are reachable from outside your network.

Self-hosted infrastructure

You connect a Kubernetes cluster or Linux VM to Harness through a chaos agent.

A chaos infrastructure, an environment, and an onboarded service.

Testing private endpoints, running on Linux VMs, and controlling where the load comes from.

Harness-managed infrastructure always runs on Kubernetes, so the Python, JavaScript, and Java engines are all available. Go to Load testing key concepts to compare the Kubernetes and Linux VM target types for self-hosted infrastructure.

Load comes from a Harness-hosted cluster

On Harness-managed infrastructure, the virtual users run in a Kubernetes cluster that Harness hosts, not inside your network. Test endpoints that the internet can reach. To test an endpoint that is reachable only from your private network, use self-hosted infrastructure.


Create a load test on Harness-managed infrastructure

Harness-managed infrastructure is the default for a new load test when it is enabled for your account. The following steps create a test and run it.

1

Open the Load Test Studio

In your project, go to Load Tests, then select the Load Tests tab. Click New Load Test, then select Create from scratch.

You can also select one of the sample tests from the same menu. A sample test starts on Harness-managed infrastructure too.

2

Select Harness-managed infrastructure

On the Overview tab, enter a Name for the test. Under Execution Environment, select the Harness-managed infrastructure card if it is not already selected.

The Execution Environment section of the Load Test Studio with the Harness-managed infrastructure card selected next to the Self-hosted infrastructure card

When Harness-managed infrastructure is selected, the Studio hides the Target Type, Load Test Infrastructure, and Services fields. Harness chooses the infrastructure, and the test does not need an onboarded service.

3

Select an engine and configure the test

Select a Load Test Engine, then click Next. On the Test Configuration tab, define the workload and the Load Configuration exactly as you would for self-hosted infrastructure. Keep the Users, Duration, and Worker Count within the limits for Harness-managed runs.

Go to Create a Load Test to configure the Python, JavaScript, or Java engine.

4

Save and run the test

Click Save, then click Run. Harness opens the run page and starts to prepare the infrastructure.

The infrastructure choice is fixed after you save

You cannot switch a saved load test between Harness-managed and self-hosted infrastructure. When you edit the test, the other card is disabled. To run the same workload on the other kind of infrastructure, create a new load test.


Watch Harness prepare the infrastructure

Before the load starts, the run page shows a Preparing infrastructure panel in place of the charts. A progress ring shows how far preparation has gone, and the panel moves through three steps:

  • Connecting execution agent: Harness connects the execution agent that runs load tests for your account.

  • Preparing project environment: Harness creates the environment and infrastructure that your project uses for load tests.

  • Ready to run: The infrastructure is ready. The load test starts automatically.

The Preparing infrastructure panel at 48 percent, with Connecting execution agent completed, Preparing project environment in progress, and Ready to run not started

How long preparation takes depends on whether your project already has infrastructure that is ready:

  • First run, or first run after 24 hours without use: Preparation takes a few minutes, because Harness sets up the infrastructure for your project.

  • Later runs: The infrastructure is already ready, so the load test starts almost immediately.

If you click Stop while Harness prepares the infrastructure, the run moves to Stopped. Harness does not tear down the infrastructure, so the next run can use it.

Review the run

When preparation finishes, the panel is replaced by the run metrics. The Load Test Infrastructure field shows Harness Chaos Sandbox, the infrastructure that Harness manages for your project.

A running load test on Harness-managed infrastructure, with Load Test Infrastructure set to Harness Chaos Sandbox and the Summary and Active Users chart reporting live results

From here, the run behaves like any other load test. Go to Analyze Load Test Results to read the metrics, endpoint statistics, and threshold outcomes.

When a run fails during preparation, the panel title changes to Infrastructure preparation failed and the page shows the error code and message at the top. Go to Troubleshooting to resolve the error.


What Harness creates in your project

On the first run in a project, Harness creates the resources it needs in that project. Each resource uses the identifier harness_chaos_sandbox:

  • Environment: An environment named Harness Chaos Sandbox.

  • Kubernetes connector: The connector that points at the Harness-hosted cluster.

  • Infrastructure definition: The infrastructure definition in that environment.

  • Chaos infrastructure: The infrastructure that load tests run on.

The project Environments list showing the Harness Chaos Sandbox environment with the identifier harness_chaos_sandbox

Harness owns these resources. You cannot modify or delete the chaos infrastructure; Harness rejects the change with the message this infrastructure is managed by Harness and cannot be modified or deleted. Do not edit or delete the environment, connector, or infrastructure definition either, because Harness-managed runs in the project depend on them.

The Harness Chaos Sandbox environment does not appear in the environment pickers for chaos experiments. It exists only to run load tests.

Idle cleanup

When no load test uses the project's Harness-managed infrastructure for 24 hours, Harness tears the infrastructure down. The Harness Chaos Sandbox environment stays in your project. The next run prepares the infrastructure again, which takes a few minutes.


Limits

Harness applies the following limits to Harness-managed infrastructure. When a run reaches a limit, Harness does not start it. The run fails with the error code E2019: MANAGED_INFRA_LIMIT_REACHED and a message that names the limit.

Limit
Default
What to do when a run reaches it

Virtual users per run

5,000

Lower Users, then run the test again.

Run duration

10,000 seconds

Shorten Duration, then run the test again.

Workers per run

20

Lower Worker Count, then run the test again.

Concurrent runs per project

5

Wait for a run in the project to finish, or stop one.

Concurrent runs per account

20

Wait for a run in the account to finish, or stop one.

Total workers across an account's active runs

100

Wait for a run to finish, or use fewer workers.

Projects per account

10

Each project that has Harness-managed infrastructure counts toward this limit. A project stops counting after idle cleanup tears down its infrastructure.

Infrastructure preparation timeout

900 seconds

A run that is still preparing after 15 minutes fails with E2021. Run the test again.

Idle cleanup

24 hours

Not a quota. Harness tears down unused infrastructure after this time.

Harness also caps overall capacity for Harness-managed infrastructure: up to 50 accounts can use it, and each Harness-hosted cluster serves up to 200 projects. When no cluster has room for your project, the run fails with E2017.


Limitations

The following scenarios are not supported on Harness-managed infrastructure.

Unsupported scenarios

  • Linux VM: Harness-managed infrastructure runs on Kubernetes only.

  • Load test templates: A load test template does not offer the Harness-managed infrastructure option.

  • Private endpoints: The virtual users run in a Harness-hosted cluster, so they cannot reach an endpoint that is available only inside your network.

  • Custom image registries: Image registry settings that you configure at the account, organization, project, or infrastructure level do not apply. Harness uses its own default images.

  • Switching infrastructure: You cannot change a saved test between Harness-managed and self-hosted infrastructure.


Troubleshooting

Harness-managed infrastructure does not appear in the Load Test Studio

The option appears only when Harness-managed infrastructure is enabled for your account, and only for load tests, not load test templates. If you are creating a test and the card is missing, contact your account administrator or Harness Support to enable it.

The Self-hosted infrastructure card is disabled when I edit a load test

A saved load test keeps the infrastructure it was created with. To run the same workload on self-hosted infrastructure, create a new load test and select Self-hosted infrastructure on the Overview tab.

The first run spends several minutes on Preparing infrastructure

This is expected on the first run in a project, and on the first run after 24 hours without use. Harness sets up the infrastructure for your project before the load test starts. Later runs start almost immediately. If preparation does not finish within 15 minutes, the run fails with E2021.

E2019: MANAGED_INFRA_LIMIT_REACHED

The run asks for more than a Harness-managed run allows, or the project or account is already at a limit. The message names the limit, for example this run asks for 6000 virtual users, which is more than the 5000 a managed infrastructure run may use; lower the number of users and try again. Go to Limits to find the limit and the fix.

A failed run showing the E2019 MANAGED_INFRA_LIMIT_REACHED error for 6000 virtual users above the 5000 limit, with the Infrastructure preparation failed panel at 0 percent
E2017: MANAGED_INFRA_UNAVAILABLE

Harness has no infrastructure available for your project right now, or the project's infrastructure is still being torn down after idle cleanup. Wait a few minutes, then run the test again. If the error continues, contact Harness Support.

E2018: MANAGED_INFRA_DELEGATE_NOT_CONNECTED

The execution agent for your account is not connected yet. Wait a few minutes, then run the test again.

E2020: MANAGED_INFRA_PROVISIONING_FAILED

Harness could not provision the infrastructure for your project. Contact Harness Support with the run ID shown at the top of the run page.

E2021: MANAGED_INFRA_PREPARATION_TIMEOUT

The infrastructure was not ready within 15 minutes. Run the test again. If the error continues, contact Harness Support.


Next steps

You can now run load tests without connecting infrastructure of your own.

Last updated

Was this helpful?