-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Secrets on PostgreSQL plugin require increased limit on locked memory #12980
Comments
Do you know why or how the lock ulimit is set to 64kb? I am not seeing the same on a 22.04 VM. Is this a container, VM, or baremetal system? Can you get the output from the following commands:
This is the route we probably are going to go for now. Sven will continue working with the memguard library to see if we can use the pages more effectively or if we need to go a different direction as well. Thanks! |
If set too low, the lock memory can run out when using any plugin that makes use of the secrets data type. Locking and unlocking memory takes a page each, so multiple plugins or mulitple instances of a plugin can quickly go through pages. fixes: influxdata#12980
I reproduced this issue in odd setup: a "Docker VM" (docker run --privileged /sbin/init) on Docker Desktop on MacOS But I took the 64kb value from a EC2 running Ubuntu 22.04 on a service run by systemd. Here the result on the "Docker VM":
Here the result on the real server where I hit the issue:
In my case, the 64kb limit come from But on both server, we don't set DefaultLimitMEMLOCK, it's the default from the binary:
|
Thanks for the fast response! I put up PR #12990 which sets the lock memory limit to be 8192kb, more than enough.
ah ok I was getting my bytes and kilobytes mixed up. My 22.04 VM does in fact show systemd memory lock limit of 64k :( while my desktop running arch shows 8192kb. |
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.26.0 Ubuntu 22.04
Docker
No response
Steps to reproduce
Expected behavior
PostgreSQL metrics still being sent.
Actual behavior
PostgreSQL stop being monitored and part of Telegraf (anything that depend on blocked PostgreSQL input) will hang
Additional info
The hang itself is due to awnumar/memguard#147
The cause of the hang is due to each Gather() from PostgreSQL input required some new locked memory pages:
cat /proc/$PID/smaps_rollup
). Those 3 pages come from: left, right and rand of memguardp.Address.Get()
).It might be possible to reduce requirement for locked memory, we could do the Sanitize address once ? It don't seems to contains the password and don't need locked memory.
We might also say that Telegraf require more locked memory and increase the limit in the Telegraf SystemD unit ( LimitMEMLOCK).
The text was updated successfully, but these errors were encountered: