You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Limits can be set from the command line using `--ulimit=soft:hard`, see [Set ulimits in container (--ulimit)](https://docs.docker.com/reference/cli/docker/container/run/#ulimit).
2. If you are using {{ech}}, replace the `-E output.elasticsearch.hosts` line with the Cloud ID and elastic password using the syntax shown earlier.
951
+
952
+
953
+
## Modify the `nofile` ulimit [modify-nofile-ulimit]
954
+
955
+
When run as a standalone binary APM Server will inherit the `nofile` limit from the user running the process. On most system this is configured to `1024`. This limit is too low for higher throughput scenarios or when using Tail Based Sampling.
956
+
957
+
To chose the new limit, consider these guidelines:
958
+
- there is no system performance impact of using a limit of ``;
959
+
- a limit of `1024` would suffice for low throughput use cases;
960
+
- the major contributor to open files will be the number of incoming connections;
961
+
- Tail Based Sampling is file based, when enabling it the number of open files will be higher in proportion to the throughput and sampling policies.
962
+
963
+
To configure the limit for your user, you need to know the username you will run APM Server process with.
964
+
965
+
```sh
966
+
whoami
967
+
```
968
+
969
+
Edit `/etc/security/limits.conf` with root privileges:
970
+
971
+
```sh
972
+
sudo nano /etc/security/limits.conf
973
+
```
974
+
975
+
Add the following lines to set soft and hard limits for your user:
976
+
977
+
```text
978
+
apm-server soft nofile 524287 <1>
979
+
apm-server hard nofile 524287 <1>
980
+
```
981
+
982
+
1. Replace `apm-server` with the username you will run APM Server process with.
Copy file name to clipboardExpand all lines: solutions/observability/apm/apm-server/systemd.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,16 @@ systemctl restart apm-server
88
88
It is recommended that you use a configuration management tool to include drop-in unit files. If you need to add a drop-in manually, use `systemctl edit apm-server.service`.
89
89
::::
90
90
91
+
#### Configuring the NOFILE limit [configuring-nofile-limit]
92
+
93
+
::::{note}
94
+
There should be no need to manually configure this limit when running APM Server.
95
+
::::
96
+
97
+
In systemd the `LimitNOFILE` defaults are set to `1024` (soft) and `524288` (hard) and most Linux systems with systemd will not change these values or reduce them drastically. Golang since 1.19 (see [golang/go#46279](https://github.com/golang/go/issues/46279)) automatically bump the process limit up to the available hard limit. This means that by default APM Server runs with the limit set to the hard limit value by the Operating System is being run on, generally `524287` on a recent system. There should be no reason to change this limit, as back-pressure from too many open files will happen from memory usage.
98
+
99
+
For guidelines on the value to set this value to see [Modifying the `nofile` ulimit](/solutions/observability/apm/apm-server/binary.md#modify-nofile-ulimit).
On systems with POSIX file permissions, the APM Server configuration file is subject to ownership and file permission checks. These checks prevent unauthorized users from providing or modifying configurations that are run by APM Server.
Copy file name to clipboardExpand all lines: solutions/observability/apm/apm-server/tail-based-sampling.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,14 @@ Most options on this page are supported by all APM Server deployment methods whe
20
20
Enhanced privileges are required to use tail-based sampling. For more information, refer to [Create a tail-based sampling role](/solutions/observability/apm/create-assign-feature-roles-to-apm-server-users.md#apm-privileges-tail-based-sampling).
21
21
::::
22
22
23
+
::::{note}
24
+
If you are manually configuring systemd `LimitNOFILE` or `LimitNOFILESoft` when using Tail Based Sampling and it affects the APM Server process, this may result in a `too many open files` error. Please see [configuring the NOFILE limit](/solutions/observability/apm/systemd.md#configuring-nofile-limit).
25
+
::::
26
+
27
+
::::{note}
28
+
If you are running the binary standalone (not using the provided dev or rpm packages or the docker images) you need to adjust the `nofile` limit based on your throughput requirements. See [modifying the `nofile` ulimit](/solutions/observability/apm/apm-server/binary.md#modify-nofile-ulimit).
0 commit comments