Skip to content
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

Question: Why "at least 512 KiB of locked memory"? #606

Open
dezyh opened this issue Sep 25, 2023 · 1 comment
Open

Question: Why "at least 512 KiB of locked memory"? #606

dezyh opened this issue Sep 25, 2023 · 1 comment

Comments

@dezyh
Copy link

dezyh commented Sep 25, 2023

Why is the following limit a requirement?

Please also note Glommio requires at least 512 KiB of locked memory for io_uring to work. You can increase the memlock resource limit (rlimit) as follows:

$ vi /etc/security/limits.conf
*    hard    memlock        512
*    soft    memlock        512

Please note that 512 KiB is the minimum needed to spawn a single executor. Spawning multiple executors may require you to raise the limit accordingly.

To make the new limits effective, you need to log in to the machine again. You can verify that the limits are updated by running the following:

$ ulimit -l
512

To add some context, a coworker of mine vendored and apparently reduced this limit to "at least 64/128 KiB" (I forgot which sorry) and it's now able to run on our GKE nodes, which by default have less than the required 512 KiB memlock configured.

While everything seems to work for now, I'm worried that this is something which could break glommio in a non-obvious way and introduce unintended and potentially hard to debug issues/side-effects in the future.

@glommer
Copy link
Collaborator

glommer commented Sep 25, 2023

This is the amount of memory that is required for io_uring to allocate its internal data structures.

Was the executor created using standard configuration? If the default ring size was reduced, this could explain why it was created with less memory.

There should be no problems in this case, except potentially for performance ones. If there is not enough locked memory at startup, io_uring will fail to allocate and bail. If the executor was allocated, things should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants