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

Install fails with "Your swappiness must be higher than 50" even though just a warning #152

Open
olberger opened this issue Jun 5, 2023 · 7 comments

Comments

@olberger
Copy link
Contributor

olberger commented Jun 5, 2023

Install of 2.8.13 fails with a warning without it being easily spotted IMHO:
WARNING - Your swappiness must be higher than 50; please see https://en.wikipedia.org/wiki/Swappiness

When checking on our cloud instance at Gandi (Debian system), I have:

$ cat /proc/sys/vm/swappiness
10

#106 (comment) seems to indicate that 10 would be sufficient ("Note that the Discourse instruction recommend a swappiness of 10 ("Set the swappiness to 10 so its only uses as an emergency buffer"), however I couldn't spot the precise reference of that recommended 10 value looking at the upstream instructions.
Only swap is mentioned in "1 GB RAM minimum (with swap", reading https://github.com/discourse/discourse/blob/1fbcf57767f15d4a3f99e1c32855ee9f0d0fc23c/docs/INSTALL.md
That swap link states "Set the swappiness to 10 so its only uses as an emergency buffer", but maybe this applies only to current versions (2022) whereas 2.8.13 dates back 2 years ?

It would be great to have some documented procedure with a clear reference on whether 10 is enough, why 50, or 60 as suggested in th aforementioned issue.

Of course, automating everything re- swap would be great, as requested in #106

For the time being, fixing the warning as being an error would already be a start.

Thanks in advance.

@olberger
Copy link
Contributor Author

olberger commented Jun 5, 2023

Looking at edits of https://meta.discourse.org/t/create-a-swapfile-for-your-linux-server/13880 seem to reveal that a swapiness of 10 was documented for quite a long time if I can read it well...

@olberger
Copy link
Contributor Author

olberger commented Jun 5, 2023

It seems that, for the time being it's enough to issue sysctl -w vm.swappiness=60 as root on the target server to bypass that check (may need reverting back to original value afterwards, if install succeeds beyond that).

YMMV

@tio-trom
Copy link
Contributor

I came across this issue too....and my server cannot increase the swapiness but I have plenty of ram. Is there a way around it?

@tio-trom
Copy link
Contributor

After investigating I think this is the fault of Yunohost forcing Discourse to use at least 50 for swapiness https://github.com/YunoHost-Apps/discourse_ynh/blob/master/scripts/_common.sh which I think is exaggerated. Even Discord recommends 10. See https://meta.discourse.org/t/create-a-swapfile-for-your-linux-server/13880

So please let's fix this. I see there is a PR to remove this requirement if enough RAM is present #149

@tio-trom
Copy link
Contributor

Here is the proposal to change the swapiness to 10 #161

@ndx1905-github
Copy link

any update?
I tried to install and it didn't work because there is no swap

@tio-trom
Copy link
Contributor

any update? I tried to install and it didn't work because there is no swap

I submitted a fix for this and I am waiting for a merge into testing to test it properly. As soon as they merge it I can test it.

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

3 participants