FoundationDB does not run on Windows Subsystem For Linux (WSL)

After upgrading to Windows 10 2004 and WSL 2, I can say that FoundationDB does install on WSL2 and seems to be running fine:

By default it binds 127.0.0.1 which is only accessible from inside the WSL guest, not from the windows host. To fix that, I had to edit the /etc/foundationdb/fdb.cluster and change the IP to the guest’s IP. By default the guest and hosts communicates via an Hyper-V Virtual Ethernet Adapter (it was using 172.x.x.x/20 something in my case).

With that done, and by copying the fdb.cluster file over to the windows host, I was able to connect to it:

C:\DATA>fdbcli -C wsl.cluster --exec "status"
Using cluster file `wsl.cluster'.

Configuration:
  Redundancy mode        - single
  Storage engine         - memory-2
  Coordinators           - 1

Cluster:
  FoundationDB processes - 1
  Zones                  - 1
  Machines               - 1
  Memory availability    - 24.9 GB per process on machine with least available
  Fault Tolerance        - 0 machines
  Server time            - 06/03/20 00:05:12

Data:
  Replication health     - Healthy
  Moving data            - 0.000 GB
  Sum of key-value sizes - 0 MB
  Disk space used        - 105 MB

Operating space:
  Storage server         - 1.0 GB free on most full server
  Log server             - 240.3 GB free on most full server

Workload:
  Read rate              - 21 Hz
  Write rate             - 1 Hz
  Transactions started   - 8 Hz
  Transactions committed - 1 Hz
  Conflict rate          - 0 Hz

Backup and DR:
  Running backups        - 0
  Running DRs            - 0

Client time: 06/03/20 00:05:12

Running ps aux in the guest yields the smallest process list I’ve ever seen :slight_smile:

krzys@SATSUKI:~$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0    892   548 ?        Sl   Jun02   0:00 /init
root     31236  0.0  0.0    892    80 ?        Ss   Jun02   0:00 /init
root     31237  0.0  0.0    892    80 ?        R    Jun02   0:00 /init
krzys    31238  0.0  0.0   8852  5820 pts/0    Ss   Jun02   0:00 -bash
root     32058  0.0  0.0   5236  2392 ?        Ss   00:00   0:00 /usr/lib/foundationdb/fdbmonitor --conffile /etc/foundationdb/foundationdb.conf --lockfile /var/run/fdbmonitor.pid
foundat+ 32059  0.1  0.0 167700 14132 ?        Sl   00:00   0:00 /usr/lib/foundationdb/backup_agent/backup_agent --cluster_file /etc/foundationdb/fdb.cluster --logdir /var/log/foun
foundat+ 32060  0.5  0.1 478500 38780 ?        Sl   00:00   0:01 /usr/sbin/fdbserver --cluster_file /etc/foundationdb/fdb.cluster --datadir /var/lib/foundationdb/data/4500 --listen
krzys    32081  0.0  0.0   9104  3540 pts/0    R+   00:05   0:00 ps aux

Since WSL2 is using a virtualized linux kernel, it should work much better than before. Though with the fact that the file system is virtualized as well, the performance will probably be less than running the Windows version on the the Windows host? (needs to be tested!)

1 Like