Skip to content

Cut idle memory of the embedding service #7

Description

@TorstenDittmann

Summary

The embedding container holds high RSS while idle. Appwrite self-hosted starts appwrite/embedding with EMBEDDING_MODELS=nomic-embed-text and does not set EMBEDDING_POOL_SIZE, so the process defaults to available_parallelism() copies of full-precision Nomic.

This issue tracks measuring idle RSS and cutting it without changing embedding quality (stay on NomicEmbedTextV15).

Constraints

  • Keep POST /embed request/response shape
  • Keep full-precision nomic (NomicEmbedTextV15, 768-d)
  • No quantized / smaller-model default

Planned levers

  1. Default EMBEDDING_POOL_SIZE to 1 (not CPU count)
  2. Lazy-load models so /health does not pin weights
  3. Idle-unload after EMBEDDING_IDLE_UNLOAD_SECS (reload same checkpoint from disk)
  4. Cap ORT intra-op threads
  5. jemalloc so dropped sessions return RSS to the OS
  6. Cache nomic only in the image (not nomic,bge-small)

Measurements

Baseline vs each lever will be posted as comments.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions