* filer: improve FoundationDB performance by disabling batch by default This PR addresses a performance issue where FoundationDB filer was achieving only ~757 ops/sec with 12 concurrent S3 clients, despite FDB being capable of 17,000+ ops/sec. Root cause: The write batcher was waiting up to 5ms for each operation to batch, even though S3 semantics require waiting for durability confirmation. This added artificial latency that defeated the purpose of batching. Changes: - Disable write batching by default (batch_enabled = false) - Each write now commits immediately in its own transaction - Reduce batch interval from 5ms to 1ms when batching is enabled - Add batch_enabled config option to toggle behavior - Improve batcher to collect available ops without blocking - Add benchmarks comparing batch vs no-batch performance Benchmark results (16 concurrent goroutines): - With batch: 2,924 ops/sec (342,032 ns/op) - Without batch: 4,625 ops/sec (216,219 ns/op) - Improvement: +58% faster Configuration: - Default: batch_enabled = false (optimal for S3 PUT latency) - For bulk ingestion: set batch_enabled = true Also fixes ARM64 Docker test setup (shell compatibility, fdbserver path). * fix: address review comments - use atomic counter and remove duplicate batcher - Use sync/atomic.Uint64 for unique filenames in concurrent benchmarks - Remove duplicate batcher creation in createBenchmarkStoreWithBatching (initialize() already creates batcher when batchEnabled=true) * fix: add realistic default values to benchmark store helper Set directoryPrefix, timeout, and maxRetryDelay to reasonable defaults for more realistic benchmark conditions.
53 lines
2.0 KiB
Docker
53 lines
2.0 KiB
Docker
# FoundationDB server image for ARM64 using official prebuilt packages
|
|
FROM --platform=linux/arm64 ubuntu:22.04
|
|
|
|
ARG FOUNDATIONDB_VERSION=7.4.5
|
|
ENV FOUNDATIONDB_VERSION=${FOUNDATIONDB_VERSION}
|
|
|
|
# Install prerequisites
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
wget \
|
|
python3 \
|
|
libssl3 \
|
|
libboost-system1.74.0 \
|
|
libboost-filesystem1.74.0 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install FoundationDB server + client debs with checksum verification
|
|
SHELL ["/bin/bash", "-c"]
|
|
RUN set -euo pipefail && \
|
|
apt-get update && \
|
|
case "${FOUNDATIONDB_VERSION}" in \
|
|
"7.4.5") \
|
|
CLIENT_SHA="f2176b86b7e1b561c3632b4e6e7efb82e3b8f57c2ff0d0ac4671e742867508aa"; \
|
|
SERVER_SHA="d7b081afbbabfdf2452cfbdc5c7c895165457ae32d91fc7f9489da921ab02e26"; \
|
|
;; \
|
|
*) \
|
|
echo "Unsupported FoundationDB version ${FOUNDATIONDB_VERSION} for ARM64 runtime" >&2; \
|
|
exit 1 ;; \
|
|
esac && \
|
|
for component in clients server; do \
|
|
if [ "${component}" = "clients" ]; then \
|
|
EXPECTED_SHA="${CLIENT_SHA}"; \
|
|
else \
|
|
EXPECTED_SHA="${SERVER_SHA}"; \
|
|
fi && \
|
|
PACKAGE="foundationdb-${component}_${FOUNDATIONDB_VERSION}-1_aarch64.deb" && \
|
|
PACKAGE_PATH="/tmp/${PACKAGE}" && \
|
|
wget --timeout=30 --tries=3 -O "${PACKAGE_PATH}" \
|
|
"https://github.com/apple/foundationdb/releases/download/${FOUNDATIONDB_VERSION}/${PACKAGE}" && \
|
|
echo "${EXPECTED_SHA} ${PACKAGE_PATH}" | sha256sum -c - && \
|
|
apt-get install -y "${PACKAGE_PATH}" && \
|
|
rm "${PACKAGE_PATH}"; \
|
|
done && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
ldconfig && \
|
|
echo "✅ Installed FoundationDB ${FOUNDATIONDB_VERSION} (server + clients)"
|
|
|
|
# Prepare directories commonly bind-mounted by docker-compose
|
|
RUN mkdir -p /var/fdb/{logs,data,config} /usr/lib/foundationdb
|
|
|
|
# Provide a simple default command (docker-compose overrides this)
|
|
CMD ["/bin/bash"]
|