apple / foundationdb

FoundationDB - the open source, distributed, transactional key-value store
https://apple.github.io/foundationdb/
Apache License 2.0
14.19k stars 1.29k forks source link

FoundationDB is unresponsive on MacOS ARM64 when disk usage is high #11376

Closed fungiboletus closed 2 months ago

fungiboletus commented 2 months ago

Hei, I'm trying to test FoundationDB on my 16GB M1 macbook pro, but the server is very unresponsive.

I followed the Getting Started on macOS guide. Here is a fbdcli output, that runs very slowly:

$fdbcli
Using cluster file `/usr/local/etc/foundationdb/fdb.cluster'.

The database is available, but has issues (type 'status' for more information).

Welcome to the fdbcli. For help, type `help'.
fdb> status

WARNING: Long delay (Ctrl-C to interrupt)

Using cluster file `/usr/local/etc/foundationdb/fdb.cluster'.

Unable to start default priority transaction after 5 seconds.

Unable to start batch priority transaction after 5 seconds.

Unable to retrieve all status information.

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

Cluster:
  FoundationDB processes - 1
  Zones                  - 1
  Machines               - 1
  Memory availability    - 0.3 GB per process on machine with least available
                           >>>>> (WARNING: 4.0 GB recommended) <<<<<
  Fault Tolerance        - 0 machines
  Server time            - 05/08/24 16:02:00

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             - 0.0 GB free on most full server

Workload:
  Read rate              - 4 Hz
  Write rate             - 0 Hz
  Transactions started   - 2 Hz
  Transactions committed - 0 Hz
  Conflict rate          - 0 Hz
  Performance limited by server ac2a710ad25efb38: Log server MVCC memory.

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

Client time: 05/08/24 16:01:52

I also tried the hello world tutorial, and I can get it to run in the few seconds following a fdbserver restart, but it usually hangs forever.

I tried various versions of FoundationDB (7.3.41, 7.3.27, 7.1.59).

My macOS version is 14.4.1.

I also tried to run the docker foundation/foundation container to see if I would get more luck on Linux, but it's only amd64 so it doesn't work.

I can see for the warning that it's not happy about the amount of free memory. But I have more than enough to store the hello world tuple without swapping. I also find it strange that it works fast for a few seconds before it stop responding.

fungiboletus commented 2 months ago

After looking a bit more, I see that the bug and a workaround is described there: https://forums.foundationdb.org/t/how-to-run-foundationdb-on-a-mac/3563/30

You need to add the following line, as the disk usage is indeed high on my machine.

[fbserver]
knob_min_available_space_ratio=0.001