YunoHost-Apps / discourse_ynh

Discourse package for YunoHost
https://www.discourse.org/
GNU General Public License v2.0
24 stars 11 forks source link

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

Open olberger opened 1 year ago

olberger commented 1 year ago

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

https://github.com/YunoHost-Apps/discourse_ynh/issues/106#issuecomment-1060242051 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 commented 1 year ago

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 commented 1 year ago

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 commented 10 months ago

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 commented 10 months ago

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 https://github.com/YunoHost-Apps/discourse_ynh/pull/149

tio-trom commented 10 months ago

Here is the proposal to change the swapiness to 10 https://github.com/YunoHost-Apps/discourse_ynh/pull/161

ndx1905-github commented 7 months ago

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

tio-trom commented 5 months ago

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.