Tune APM Server output parameters for your Elasticsearch clusteredit
If your Elasticsearch cluster is not ingesting the amount of data you expect, you can tweak a few APM Server settings:
output.elasticsearch.workers. See tune for indexing speed for an overview.
output.elasticsearch.bulk_max_sizeis set to a high value, for example 5120. The default of 50 is very conservative.
queue.mem.eventsis set to a reasonable value compared to your other settings. A good rule of thumb is that
The output configuration section shows more details.
Adjust internal queue sizeedit
APM Server uses an internal queue to buffer incoming events.
A larger queue can retain more data if Elasticsearch is unavailable for longer periods,
and it alleviates problems that might result from sudden spikes of traffic.
You can adjust the queue size by overriding
queue.mem.events can significantly affect APM Server memory usage.
Adjust concurrent requestsedit
APM Server has a limit to how many requests can be processed concurrently.
This limit is determined by the
Increasing this value will improve throughput, but it can significantly affect APM Server memory usage.
Add APM Server instancesedit
If the APM Server cannot process data quickly enough, you will see request timeouts.
One way to solve this problem is to increase processing power. This can be done by either migrating your APM Server to a more powerful machine or adding more APM Server instances. Having several instances will also increase availability.
Reduce the payload sizeedit
Large payloads may result in request timeouts. You can reduce the payload size by decreasing the flush interval in the agents. This will cause agents to send smaller and more frequent requests.
Read more in the agents documentation.