-
Notifications
You must be signed in to change notification settings - Fork 782
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
Ubuntu 24.10 VPS with Low (1GB) Ram freezes during build of YJIT on ruby-3.3.0 install #2515
Comments
Hi, thank you for detailed description of the problem and also sharing how you solved it. Unfortunately, from user reports such as yours it is known that machines with low RAM have trouble compiling Ruby, but neither ruby-build (this project) nor Ruby itself have any detection of this being the case, primarily because this would be hard to maintain cross-platform. Our wiki has a note about temporarily resizing the I agree that the build process freezing up with no error message nor other kind of explanation is bad user experience, but this is also something that is technically hard to solve. @hsbt: Would you think that this (i.e. low RAM scenarios) is something that Ruby's build system could potentially handle better? BTW, what was the error message you got due to using the outdated version of
|
@mislav thank you for the information. Hear you on the difficulty of implementing cross platform RAM usage/status. I tried to reproduce the So the steps above were very similar, starting an Ubuntu 24.10 VPS with 1GB ram, I only installed First, without resizing /tmp/
rbenv installed this version of rustc:
got stuck here Using the Then after remount + resizing of tmpfsTrying again after Build gets stuck on:
I tried with a new version of rust (1.85.1) and this also got stuck. The build only completes when a swapfile is created. using the Solution: Creating a swapfileFor every scenario above where the build failed when only installing
The following scenarios I tested succeeded each time
Creating a swapfile and increasing tmpfs to 1G is necessary for the builds to complete. That would be useful to add to the docs, even though it's a workaround. |
Steps to reproduce the behavior
Start a new digital ocean VPS/droplet on Ubuntu 24.10, with 1GB of ram or less.
Install dependencies
apt install libpq-dev
apt install rbenv
rbenv init
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
reconnect to server...
rbenv install 3.3.0 --verbose
Build freezes at building Rust YJIT (see logs)
Temp file system is at half usage.
Expected vs. actual behavior
Expected behavior:
Using a lower than recommended amount of ram, expected a message that lets me know why the build is frozen or will not complete.
Actual behavior:
Build freezes and doesnt complete. If using non-verbose mode, the build appears stuck at
make -j 1
and there are no logs. The only way out is to cancel the build and manually increase /tmp/ (see the solution below)Logs
rbenv install 3.3.0 --verbose
got stuck hereSolution
Use a VPS with 2GB of ram.
Or follow these steps if you're trying to save money:
Preparing to try install of ruby-3.3.0 again by wiping /tmp...
disclaimer: I dont know how bad it is to run
rm -rf /tmp/
, but it's probably bad practiceManually adding a swapfile and increasing available tmp space with virtual ram:
sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=1024
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile
Then increase tempfs size:
mount -o remount,size=1G /tmp/
Attempt install of ruby-3.3.0 again
rbenv install 3.3.0 --verbose
It should succeed this time
It should succeed this time, but if doesnt, I tried these steps a few days ago (Mar 22) and this would still not work because Ubuntu 24.10 shipped with an older version of
rustc
. So I needed to manually install the latest rustup with these steps:sudo apt remove rustc
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
add to PATH:
source "$HOME/.cargo/env"
Cleanup:
Turn off the swapfile
sudo swapoff /mnt/swapfile
Remount
/tmp/
filesystem to original sizemount -o remount,size=481M /tmp/
check
/tmp/
is configured with origin sizeThe text was updated successfully, but these errors were encountered: