2024-12-03 06:48:36 +00:00
|
|
|
# Based on docker compose .env file
|
2025-08-15 16:05:33 +08:00
|
|
|
|
|
|
|
|
# Global image pull secrets configuration
|
|
|
|
|
imagePullSecrets: []
|
|
|
|
|
|
2024-12-03 06:48:36 +00:00
|
|
|
env:
|
|
|
|
|
# The type of doc engine to use.
|
|
|
|
|
# Available options:
|
|
|
|
|
# - `elasticsearch` (default)
|
|
|
|
|
# - `infinity` (https://github.com/infiniflow/infinity)
|
2025-07-18 12:26:11 +01:00
|
|
|
# - `opensearch` (https://github.com/opensearch-project/OpenSearch)
|
2024-12-03 06:48:36 +00:00
|
|
|
# DOC_ENGINE: elasticsearch
|
|
|
|
|
DOC_ENGINE: infinity
|
2025-07-18 12:26:11 +01:00
|
|
|
# DOC_ENGINE: opensearch
|
2024-12-03 06:48:36 +00:00
|
|
|
|
|
|
|
|
# The version of Elasticsearch.
|
|
|
|
|
STACK_VERSION: "8.11.3"
|
|
|
|
|
|
|
|
|
|
# The password for Elasticsearch
|
|
|
|
|
ELASTIC_PASSWORD: infini_rag_flow_helm
|
|
|
|
|
|
2025-07-18 12:26:11 +01:00
|
|
|
# The password for OpenSearch.
|
|
|
|
|
# At least one uppercase letter, one lowercase letter, one digit, and one special character
|
|
|
|
|
OPENSEARCH_PASSWORD: infini_rag_flow_OS_01
|
|
|
|
|
|
2024-12-03 06:48:36 +00:00
|
|
|
# The password for MySQL
|
|
|
|
|
MYSQL_PASSWORD: infini_rag_flow_helm
|
|
|
|
|
# The database of the MySQL service to use
|
|
|
|
|
MYSQL_DBNAME: rag_flow
|
|
|
|
|
|
|
|
|
|
# The username for MinIO.
|
|
|
|
|
MINIO_ROOT_USER: rag_flow
|
|
|
|
|
# The password for MinIO
|
|
|
|
|
MINIO_PASSWORD: infini_rag_flow_helm
|
|
|
|
|
|
|
|
|
|
# The password for Redis
|
|
|
|
|
REDIS_PASSWORD: infini_rag_flow_helm
|
|
|
|
|
|
|
|
|
|
# The local time zone.
|
2025-10-23 23:02:27 +08:00
|
|
|
TZ: "Asia/Shanghai"
|
2024-12-03 06:48:36 +00:00
|
|
|
|
|
|
|
|
# Uncomment the following line if you have limited access to huggingface.co:
|
|
|
|
|
# HF_ENDPOINT: https://hf-mirror.com
|
|
|
|
|
|
|
|
|
|
# The maximum file size for each uploaded file, in bytes.
|
|
|
|
|
# You can uncomment this line and update the value if you wish to change 128M file size limit
|
|
|
|
|
# MAX_CONTENT_LENGTH: "134217728"
|
2024-12-11 18:39:09 +08:00
|
|
|
# After making the change, ensure you update `client_max_body_size` in nginx/nginx.conf correspondingly.
|
2024-12-03 06:48:36 +00:00
|
|
|
|
Feat: make document parsing and embedding batch sizes configurable via environment variables (#8266)
### Description
This PR introduces two new environment variables, `DOC_BULK_SIZE` and
`EMBEDDING_BATCH_SIZE`, to allow flexible tuning of batch sizes for
document parsing and embedding vectorization in RAGFlow. By making these
parameters configurable, users can optimize performance and resource
usage according to their hardware capabilities and workload
requirements.
### What problem does this PR solve?
Previously, the batch sizes for document parsing and embedding were
hardcoded, limiting the ability to adjust throughput and memory
consumption. This PR enables users to set these values via environment
variables (in `.env`, Helm chart, or directly in the deployment
environment), improving flexibility and scalability for both small and
large deployments.
- `DOC_BULK_SIZE`: Controls how many document chunks are processed in a
single batch during document parsing (default: 4).
- `EMBEDDING_BATCH_SIZE`: Controls how many text chunks are processed
in a single batch during embedding vectorization (default: 16).
This change updates the codebase, documentation, and configuration files
to reflect the new options.
### Type of change
- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [x] Documentation Update
- [ ] Refactoring
- [x] Performance Improvement
- [ ] Other (please describe):
### Additional context
- Updated `.env`, `helm/values.yaml`, and documentation to describe
the new variables.
- Modified relevant code paths to use the environment variables instead
of hardcoded values.
- Users can now tune these parameters to achieve better throughput or
reduce memory usage as needed.
Before:
Default value:
<img width="643" alt="image"
src="https://github.com/user-attachments/assets/086e1173-18f3-419d-a0f5-68394f63866a"
/>
After:
10x:
<img width="777" alt="image"
src="https://github.com/user-attachments/assets/5722bbc0-0bcb-4536-b928-077031e550f1"
/>
2025-06-16 13:40:47 +08:00
|
|
|
# The number of document chunks processed in a single batch during document parsing.
|
|
|
|
|
DOC_BULK_SIZE: 4
|
|
|
|
|
|
|
|
|
|
# The number of text chunks processed in a single batch during embedding vectorization.
|
|
|
|
|
EMBEDDING_BATCH_SIZE: 16
|
|
|
|
|
|
2024-12-03 06:48:36 +00:00
|
|
|
ragflow:
|
2025-08-15 16:05:33 +08:00
|
|
|
image:
|
|
|
|
|
repository: infiniflow/ragflow
|
2025-11-19 09:50:23 +08:00
|
|
|
tag: v0.22.1
|
2025-08-15 16:05:33 +08:00
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
2025-07-02 02:58:17 +01:00
|
|
|
# Optional service configuration overrides
|
|
|
|
|
# to be written to local.service_conf.yaml
|
|
|
|
|
# inside the RAGFlow container
|
|
|
|
|
# https://ragflow.io/docs/dev/configurations#service-configuration
|
|
|
|
|
service_conf:
|
|
|
|
|
|
|
|
|
|
# Optional yaml formatted override for the
|
|
|
|
|
# llm_factories.json file inside the RAGFlow
|
|
|
|
|
# container.
|
|
|
|
|
llm_factories:
|
|
|
|
|
# factory_llm_infos:
|
|
|
|
|
# - name: OpenAI-API-Compatible
|
|
|
|
|
# logo: ""
|
|
|
|
|
# tags: "LLM,TEXT EMBEDDING,SPEECH2TEXT,MODERATION"
|
|
|
|
|
# status: "1"
|
|
|
|
|
# llm:
|
|
|
|
|
# - llm_name: my-custom-llm
|
|
|
|
|
# tags: "LLM,CHAT,"
|
|
|
|
|
# max_tokens: 100000
|
|
|
|
|
# model_type: chat
|
|
|
|
|
# is_tools: false
|
|
|
|
|
|
|
|
|
|
# Kubernetes configuration
|
2024-12-03 06:48:36 +00:00
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
service:
|
|
|
|
|
# Use LoadBalancer to expose the web interface externally
|
|
|
|
|
type: ClusterIP
|
2025-03-04 03:35:43 +00:00
|
|
|
api:
|
|
|
|
|
service:
|
|
|
|
|
enabled: true
|
|
|
|
|
type: ClusterIP
|
2024-12-03 06:48:36 +00:00
|
|
|
|
|
|
|
|
infinity:
|
|
|
|
|
image:
|
|
|
|
|
repository: infiniflow/infinity
|
2025-12-24 22:33:56 +08:00
|
|
|
tag: v0.6.13
|
2025-08-15 16:05:33 +08:00
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
2024-12-03 06:48:36 +00:00
|
|
|
storage:
|
|
|
|
|
className:
|
|
|
|
|
capacity: 5Gi
|
|
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
service:
|
|
|
|
|
type: ClusterIP
|
|
|
|
|
|
|
|
|
|
elasticsearch:
|
2025-08-15 16:05:33 +08:00
|
|
|
image:
|
|
|
|
|
repository: elasticsearch
|
|
|
|
|
tag: "8.11.3"
|
|
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
|
|
|
|
initContainers:
|
|
|
|
|
alpine:
|
|
|
|
|
repository: alpine
|
|
|
|
|
tag: latest
|
|
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
busybox:
|
|
|
|
|
repository: busybox
|
|
|
|
|
tag: latest
|
|
|
|
|
pullPolicy: IfNotPresent
|
2024-12-03 06:48:36 +00:00
|
|
|
storage:
|
|
|
|
|
className:
|
|
|
|
|
capacity: 20Gi
|
|
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
2025-01-15 11:57:47 +08:00
|
|
|
cpu: "4"
|
|
|
|
|
memory: "16Gi"
|
2024-12-03 06:48:36 +00:00
|
|
|
service:
|
|
|
|
|
type: ClusterIP
|
|
|
|
|
|
2025-07-18 12:26:11 +01:00
|
|
|
opensearch:
|
|
|
|
|
image:
|
|
|
|
|
repository: opensearchproject/opensearch
|
|
|
|
|
tag: 2.19.1
|
2025-08-15 16:05:33 +08:00
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
|
|
|
|
initContainers:
|
|
|
|
|
alpine:
|
|
|
|
|
repository: alpine
|
|
|
|
|
tag: latest
|
|
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
busybox:
|
|
|
|
|
repository: busybox
|
|
|
|
|
tag: latest
|
|
|
|
|
pullPolicy: IfNotPresent
|
2025-07-18 12:26:11 +01:00
|
|
|
storage:
|
|
|
|
|
className:
|
|
|
|
|
capacity: 20Gi
|
|
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
cpu: "4"
|
|
|
|
|
memory: "16Gi"
|
|
|
|
|
service:
|
|
|
|
|
type: ClusterIP
|
|
|
|
|
|
2024-12-03 06:48:36 +00:00
|
|
|
minio:
|
|
|
|
|
image:
|
|
|
|
|
repository: quay.io/minio/minio
|
|
|
|
|
tag: RELEASE.2023-12-20T01-00-02Z
|
2025-08-15 16:05:33 +08:00
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
2024-12-03 06:48:36 +00:00
|
|
|
storage:
|
|
|
|
|
className:
|
|
|
|
|
capacity: 5Gi
|
|
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
service:
|
|
|
|
|
type: ClusterIP
|
|
|
|
|
|
|
|
|
|
mysql:
|
|
|
|
|
image:
|
|
|
|
|
repository: mysql
|
|
|
|
|
tag: 8.0.39
|
2025-08-15 16:05:33 +08:00
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
2024-12-03 06:48:36 +00:00
|
|
|
storage:
|
|
|
|
|
className:
|
|
|
|
|
capacity: 5Gi
|
|
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
service:
|
|
|
|
|
type: ClusterIP
|
|
|
|
|
|
|
|
|
|
redis:
|
|
|
|
|
image:
|
|
|
|
|
repository: valkey/valkey
|
|
|
|
|
tag: 8
|
2025-08-15 16:05:33 +08:00
|
|
|
pullPolicy: IfNotPresent
|
|
|
|
|
pullSecrets: []
|
2024-12-03 06:48:36 +00:00
|
|
|
storage:
|
|
|
|
|
className:
|
|
|
|
|
capacity: 5Gi
|
2025-05-09 04:04:50 -07:00
|
|
|
persistence:
|
|
|
|
|
enabled: true
|
2025-07-30 03:35:59 +01:00
|
|
|
# Set's the retention policy for the persistent storage (only available in k8s 1.32 or later)
|
|
|
|
|
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
|
|
|
|
|
# retentionPolicy:
|
|
|
|
|
# whenDeleted: Delete
|
|
|
|
|
# whenScaled: Delete
|
2024-12-03 06:48:36 +00:00
|
|
|
deployment:
|
|
|
|
|
strategy:
|
|
|
|
|
resources:
|
|
|
|
|
service:
|
|
|
|
|
type: ClusterIP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This block is for setting up web service ingress. For more information, see:
|
|
|
|
|
# https://kubernetes.io/docs/concepts/services-networking/ingress/
|
|
|
|
|
ingress:
|
|
|
|
|
enabled: false
|
|
|
|
|
className: ""
|
|
|
|
|
annotations: {}
|
|
|
|
|
# kubernetes.io/ingress.class: nginx
|
|
|
|
|
# kubernetes.io/tls-acme: "true"
|
|
|
|
|
hosts:
|
|
|
|
|
- host: chart-example.local
|
|
|
|
|
paths:
|
|
|
|
|
- path: /
|
|
|
|
|
pathType: ImplementationSpecific
|
|
|
|
|
tls: []
|
|
|
|
|
# - secretName: chart-example-tls
|
|
|
|
|
# hosts:
|
|
|
|
|
# - chart-example.local
|