feature request: use `nbd-server -c` in nbdswapd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ltsp (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Noting down an idea, it looks like it has a some benefits over the existing nbdswapd implementation and no drawbacks, but needs implementation + real word testing.
Benefits:
* Only one (sparse) swap file is generated, so it can be big, e.g. 1024M.
* Each client then gets a .diff file, which grows as needed. So the clients get more available swap space while the server normally needs less space in /tmp for them.
* The .diff files are automatically deleted when the connection is closed, so there's no need for the nbdswapd process to hang around and consume RAM, `exec nbd-server` can be used instead.
* hdparm -tT showed no performance hit (it even showed 0.3 MB/sec improvement in my test case).
Implementation:
Once, when the ltsp server boots (or when nbdswapd is first called):
dd if=/dev/zero of=/tmp/ltsp.swap bs=1024k count=0 seek=1024
mkswap /tmp/ltsp.swap
Then, for every connection, either directly in inetd.conf or in nbdswapd:
/bin/nbd-server 0 /tmp/ltsp.swap -c -C /dev/null
Unfortunately `nbd-server -c` makes the .diff files in the same directory as the image, so ltsp.swap should be in /tmp. `mktemp /tmp/ltsp.
Changed in ltsp (Ubuntu): | |
status: | New → Invalid |