-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Provide SWAP over NFS #266
Comments
NFS file access is much slower than sdcard, particularly for random access 4K reads/writes which is mostly what swap will be doing. Have you tried this? I imagine it will be painfully slow. |
Obviously, I cannot test the swap from my raspberry, because there is not support, but I can do some benchmarchs. The scenario is:
As you can see, performance is about 4.5 times better on NFS than in SD! Yes, it is linear and not random access, but I think that will be something to be handled in the server side. I mean, if the NFS server has plenty of RAM, the swap file will live in the server buffer cache and the access pattern would not matter so much, will it? Maybe I could use some Naturally, not everybody will benefit from this feature, but somebody (me!) probably will. Another advantage of swap-over-nfs is that my SD has little free space, but I have practically unlimited NFS space available. |
http://www.raspberrypi.org/documentation/linux/kernel/building.md Go build the kernel with it enabled and give us an idea of what the performance is like and what the difference is in free memory when enabled (but not used) just to understand what the effect is for other users who don't need it. Gordon |
@ghollingworth: Ok, I did what you suggested and compiled the kernel with and without CONFIG_NFS_SWAP. I couldn't test it yet, because my rpi is currently being used ;-)... Anyway, a few obvervations I made:
So, my estimations are:
Actually, thinking about my benchmarks above, they make sense: the RPi ethernet is 100 Mbps, that is roughly, 10MB/s. Take some overhead here and there and you get my 7.2 MB/s. Cheapest SD cards are about 2 MB/s [1], hence my 1.6 MB/s. Yeah, I know, swapping at 7.2 MB/s must be painful... but swapping at 1.6 MB/s is so much worse! |
A decent sdcard can provide over 20MB/s (50MHz clock with 4-bit bus), and has much lower latency (important for random access 4K reads/writes). I agree that the additional code is trivial, so I don't mind including it in next firmware update. I would be interested in a proper benchmark (e.g. run a few copies of midori on a complex site so swap file is busy, and time how long it takes to refresh). |
See: raspberrypi/linux@e570fc8 kernel: fiq_fsm: clear hcintmsk for aborted transactions See: raspberrypi/linux@526dd19 kernel: fiq_fsm: enable by default See: raspberrypi/linux@ea08dec kernel: config: Add CONFIG_NFS_SWAP See: #266 kernel: bump to 3.12.18
This should be in next firmware tree. |
See: raspberrypi/linux@e570fc8 kernel: fiq_fsm: clear hcintmsk for aborted transactions See: raspberrypi/linux@526dd19 kernel: fiq_fsm: enable by default See: raspberrypi/linux@ea08dec kernel: config: Add CONFIG_NFS_SWAP See: raspberrypi/firmware#266 kernel: bump to 3.12.18
I've just updated my RPi to the 'next' branch, but alas, the kernel option is not yet available :-(
|
Should be in latest master branch firmware now. |
kernel: config: Add CONFIG_NFS_SWAP See: #266 firmware: alsa: fix for wrong volume when starting playback See: raspberrypi/linux#570 firmware: Support passthrough through alsa with channels=0 See: raspberrypi/linux#528
kernel: config: Add CONFIG_NFS_SWAP See: raspberrypi/firmware#266 firmware: alsa: fix for wrong volume when starting playback See: raspberrypi/linux#570 firmware: Support passthrough through alsa with channels=0 See: raspberrypi/linux#528
kernel: config: Add CONFIG_NFS_SWAP See: raspberrypi#266 firmware: alsa: fix for wrong volume when starting playback See: raspberrypi/linux#570 firmware: Support passthrough through alsa with channels=0 See: raspberrypi/linux#528
The Raspberry, particularly model A, is a low memory device, and given that the SD card is also quite slow, the ability to swap over NFS may be valuable to some users.
Proper support for this feature is available since 3.6 1. Just compile the kernel with NFS_SWAP option set. The overhead to people not using it should be minimal.
Thank you in advance.
The text was updated successfully, but these errors were encountered: