mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
fix(self-hosting): cap meilisearch indexing threads by default (#3153)
This commit is contained in:
@@ -412,7 +412,7 @@ FLUXER_DISCOVERY_ENABLED=true
|
|||||||
#FLUXER_POSTGRES_MEMORY_RESERVATION=3gb
|
#FLUXER_POSTGRES_MEMORY_RESERVATION=3gb
|
||||||
#FLUXER_VALKEY_MEMORY_LIMIT=256mb
|
#FLUXER_VALKEY_MEMORY_LIMIT=256mb
|
||||||
#FLUXER_NATS_MEMORY_LIMIT=256mb
|
#FLUXER_NATS_MEMORY_LIMIT=256mb
|
||||||
#FLUXER_MEILISEARCH_MEMORY_LIMIT=768mb
|
#FLUXER_MEILISEARCH_MEMORY_LIMIT=1536mb
|
||||||
#FLUXER_SEAWEEDFS_MEMORY_LIMIT=2gb
|
#FLUXER_SEAWEEDFS_MEMORY_LIMIT=2gb
|
||||||
#FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT=128mb
|
#FLUXER_SEAWEEDFS_INIT_MEMORY_LIMIT=128mb
|
||||||
#FLUXER_LIVEKIT_MEMORY_LIMIT=512mb
|
#FLUXER_LIVEKIT_MEMORY_LIMIT=512mb
|
||||||
@@ -438,8 +438,11 @@ FLUXER_DISCOVERY_ENABLED=true
|
|||||||
#FLUXER_UNFURL_SHARD_MEMORY_LIMIT=256mb
|
#FLUXER_UNFURL_SHARD_MEMORY_LIMIT=256mb
|
||||||
#FLUXER_ADMIN_MEMORY_LIMIT=256mb
|
#FLUXER_ADMIN_MEMORY_LIMIT=256mb
|
||||||
|
|
||||||
# Meilisearch indexing memory. Keep it well under the container limit above.
|
# Meilisearch indexing memory and threads. Each indexing thread needs its own
|
||||||
#FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=384mb
|
# buffers on top of the indexing memory, so raise the threads only together with
|
||||||
|
# the container limit above.
|
||||||
|
#FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=256mb
|
||||||
|
#FLUXER_MEILISEARCH_MAX_INDEXING_THREADS=2
|
||||||
#FLUXER_MEILISEARCH_ENV=production
|
#FLUXER_MEILISEARCH_ENV=production
|
||||||
#FLUXER_MEILISEARCH_NO_ANALYTICS=true
|
#FLUXER_MEILISEARCH_NO_ANALYTICS=true
|
||||||
|
|
||||||
|
|||||||
@@ -330,12 +330,13 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: ${FLUXER_MEILISEARCH_MEMORY_LIMIT:-768mb}
|
memory: ${FLUXER_MEILISEARCH_MEMORY_LIMIT:-1536mb}
|
||||||
environment:
|
environment:
|
||||||
MEILI_ENV: ${FLUXER_MEILISEARCH_ENV:-production}
|
MEILI_ENV: ${FLUXER_MEILISEARCH_ENV:-production}
|
||||||
MEILI_NO_ANALYTICS: "${FLUXER_MEILISEARCH_NO_ANALYTICS:-true}"
|
MEILI_NO_ANALYTICS: "${FLUXER_MEILISEARCH_NO_ANALYTICS:-true}"
|
||||||
MEILI_UPGRADE_DB: "true"
|
MEILI_UPGRADE_DB: "true"
|
||||||
MEILI_MAX_INDEXING_MEMORY: ${FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY:-384mb}
|
MEILI_MAX_INDEXING_MEMORY: ${FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY:-256mb}
|
||||||
|
MEILI_MAX_INDEXING_THREADS: ${FLUXER_MEILISEARCH_MAX_INDEXING_THREADS:-2}
|
||||||
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:?set MEILI_MASTER_KEY in .env}
|
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:?set MEILI_MASTER_KEY in .env}
|
||||||
volumes:
|
volumes:
|
||||||
- meilisearch-data:/meili_data
|
- meilisearch-data:/meili_data
|
||||||
|
|||||||
@@ -1812,11 +1812,15 @@ Default `256mb`. The ceiling for `nats`. Covers JetStream file store metadata as
|
|||||||
|
|
||||||
#### `FLUXER_MEILISEARCH_MEMORY_LIMIT`
|
#### `FLUXER_MEILISEARCH_MEMORY_LIMIT`
|
||||||
|
|
||||||
Default `768mb`. The ceiling for `meilisearch`. Must stay well above `FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY`, which bounds the indexer alone.
|
Default `1536mb`. The ceiling for `meilisearch`. Indexing a backlog of a few hundred thousand messages with two indexing threads peaks near 1 GB, so keep this above 1 GB.
|
||||||
|
|
||||||
#### `FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY`
|
#### `FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY`
|
||||||
|
|
||||||
Default `384mb`. Becomes `MEILI_MAX_INDEXING_MEMORY`. The memory the indexer may use for one batch. Lower it whenever you lower `FLUXER_MEILISEARCH_MEMORY_LIMIT`.
|
Default `256mb`. Becomes `MEILI_MAX_INDEXING_MEMORY`. The memory the indexer may use for one batch. Meilisearch uses more than this while indexing, because every indexing thread also has buffers of its own. Lower it whenever you lower `FLUXER_MEILISEARCH_MEMORY_LIMIT`.
|
||||||
|
|
||||||
|
#### `FLUXER_MEILISEARCH_MAX_INDEXING_THREADS`
|
||||||
|
|
||||||
|
Default `2`. Becomes `MEILI_MAX_INDEXING_THREADS`. Without it Meilisearch indexes on half the host's CPU threads, and each thread can use up to 150 MB of buffers, so a host with many cores runs out of memory under a container limit that suits a small one. Raise it only together with `FLUXER_MEILISEARCH_MEMORY_LIMIT`.
|
||||||
|
|
||||||
#### `FLUXER_MEILISEARCH_ENV`
|
#### `FLUXER_MEILISEARCH_ENV`
|
||||||
|
|
||||||
@@ -2038,8 +2042,8 @@ FLUXER_WORKER_MEMORY_LIMIT=1280mb
|
|||||||
FLUXER_WORKER_MEMORY_RESERVATION=768mb
|
FLUXER_WORKER_MEMORY_RESERVATION=768mb
|
||||||
FLUXER_GATEWAY_MEMORY_LIMIT=512mb
|
FLUXER_GATEWAY_MEMORY_LIMIT=512mb
|
||||||
FLUXER_GATEWAY_MEMORY_RESERVATION=256mb
|
FLUXER_GATEWAY_MEMORY_RESERVATION=256mb
|
||||||
FLUXER_MEILISEARCH_MEMORY_LIMIT=512mb
|
FLUXER_MEILISEARCH_MEMORY_LIMIT=1gb
|
||||||
FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=256mb
|
FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=192mb
|
||||||
FLUXER_SEAWEEDFS_MEMORY_LIMIT=1gb
|
FLUXER_SEAWEEDFS_MEMORY_LIMIT=1gb
|
||||||
FLUXER_SEAWEEDFS_GOMEMLIMIT=768MiB
|
FLUXER_SEAWEEDFS_GOMEMLIMIT=768MiB
|
||||||
FLUXER_GIFS_SHARD_CACHE_MAX_BYTES=134217728
|
FLUXER_GIFS_SHARD_CACHE_MAX_BYTES=134217728
|
||||||
@@ -2062,8 +2066,9 @@ FLUXER_WORKER_MEMORY_LIMIT=640mb
|
|||||||
FLUXER_WORKER_MEMORY_RESERVATION=384mb
|
FLUXER_WORKER_MEMORY_RESERVATION=384mb
|
||||||
FLUXER_GATEWAY_MEMORY_LIMIT=384mb
|
FLUXER_GATEWAY_MEMORY_LIMIT=384mb
|
||||||
FLUXER_GATEWAY_MEMORY_RESERVATION=192mb
|
FLUXER_GATEWAY_MEMORY_RESERVATION=192mb
|
||||||
FLUXER_MEILISEARCH_MEMORY_LIMIT=384mb
|
FLUXER_MEILISEARCH_MEMORY_LIMIT=1gb
|
||||||
FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=128mb
|
FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY=128mb
|
||||||
|
FLUXER_MEILISEARCH_MAX_INDEXING_THREADS=1
|
||||||
FLUXER_MEDIA_PROXY_MEMORY_LIMIT=320mb
|
FLUXER_MEDIA_PROXY_MEMORY_LIMIT=320mb
|
||||||
FLUXER_SEAWEEDFS_MEMORY_LIMIT=320mb
|
FLUXER_SEAWEEDFS_MEMORY_LIMIT=320mb
|
||||||
FLUXER_SEAWEEDFS_GOMEMLIMIT=240MiB
|
FLUXER_SEAWEEDFS_GOMEMLIMIT=240MiB
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const INPUT_NAMES: Record<string, string> = {
|
|||||||
MEILI_ENV: 'FLUXER_MEILISEARCH_ENV',
|
MEILI_ENV: 'FLUXER_MEILISEARCH_ENV',
|
||||||
MEILI_NO_ANALYTICS: 'FLUXER_MEILISEARCH_NO_ANALYTICS',
|
MEILI_NO_ANALYTICS: 'FLUXER_MEILISEARCH_NO_ANALYTICS',
|
||||||
MEILI_MAX_INDEXING_MEMORY: 'FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY',
|
MEILI_MAX_INDEXING_MEMORY: 'FLUXER_MEILISEARCH_MAX_INDEXING_MEMORY',
|
||||||
|
MEILI_MAX_INDEXING_THREADS: 'FLUXER_MEILISEARCH_MAX_INDEXING_THREADS',
|
||||||
GOMEMLIMIT: 'FLUXER_SEAWEEDFS_GOMEMLIMIT',
|
GOMEMLIMIT: 'FLUXER_SEAWEEDFS_GOMEMLIMIT',
|
||||||
WEED_MASTER_VOLUME_GROWTH_COPY_1: 'FLUXER_SEAWEEDFS_VOLUME_GROWTH',
|
WEED_MASTER_VOLUME_GROWTH_COPY_1: 'FLUXER_SEAWEEDFS_VOLUME_GROWTH',
|
||||||
LIVEKIT_KEYS: 'LIVEKIT_API_KEY',
|
LIVEKIT_KEYS: 'LIVEKIT_API_KEY',
|
||||||
|
|||||||
Reference in New Issue
Block a user