Type to search.

Performance tuning

Serverless Unavailable

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Unavailable

    This functionality is not available in Elastic Cloud Serverless.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

There are different ways to optimize/tune the performance of the RUM agent. Which options to adjust depends on whether you are optimizing for speed, memory usage, bandwidth or storage.

The first knob to reach for when tuning the performance of the agent is transactionSampleRate. Adjusting the sampling rate controls what ratio of requests are traced. By default, the sample rate is set at 1.0, meaning all requests are traced and sent to the APM server.

The sample rate will impact all four performance categories, so simply turning down the sample rate is an easy way to improve performance.

Here’s an example of setting the sample rate to 20%:

JavaScript
import { apm } from "@elastic/apm-rum"

apm.init({
  transactionSampleRate: 0.2
})

The Agent will still record the overall duration and result of unsampled transactions, but will discard associated spans, context information or labels before sending to the APM server.

Breakdown metrics help visualize where your application is spending the majority of its time. The breakdownMetrics config controls whether metrics should be calculated for each transaction based on its corresponding type.

Setting this to true will increase the payload/bandwidth usage data to the APM server.

Activate agent configuration via Kibana to start fetching new configuration changes from the APM server during the agent initialization phase.

Setting the config option centralConfig to true incurs the cost of one additional HTTP request when the agent is initialized and generates more load to the APM server. As a result, central configuration is disabled by default in RUM agent.

It is recommended to disable this configuration when the instrumented application is under heavy load.