Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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" />
4 месяцев назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. # Based on docker compose .env file
  2. # Global image pull secrets configuration
  3. imagePullSecrets: []
  4. env:
  5. # The type of doc engine to use.
  6. # Available options:
  7. # - `elasticsearch` (default)
  8. # - `infinity` (https://github.com/infiniflow/infinity)
  9. # - `opensearch` (https://github.com/opensearch-project/OpenSearch)
  10. # DOC_ENGINE: elasticsearch
  11. DOC_ENGINE: infinity
  12. # DOC_ENGINE: opensearch
  13. # The version of Elasticsearch.
  14. STACK_VERSION: "8.11.3"
  15. # The password for Elasticsearch
  16. ELASTIC_PASSWORD: infini_rag_flow_helm
  17. # The password for OpenSearch.
  18. # At least one uppercase letter, one lowercase letter, one digit, and one special character
  19. OPENSEARCH_PASSWORD: infini_rag_flow_OS_01
  20. # The password for MySQL
  21. MYSQL_PASSWORD: infini_rag_flow_helm
  22. # The database of the MySQL service to use
  23. MYSQL_DBNAME: rag_flow
  24. # The username for MinIO.
  25. MINIO_ROOT_USER: rag_flow
  26. # The password for MinIO
  27. MINIO_PASSWORD: infini_rag_flow_helm
  28. # The password for Redis
  29. REDIS_PASSWORD: infini_rag_flow_helm
  30. # The local time zone.
  31. TIMEZONE: "Asia/Shanghai"
  32. # Uncomment the following line if you have limited access to huggingface.co:
  33. # HF_ENDPOINT: https://hf-mirror.com
  34. # The maximum file size for each uploaded file, in bytes.
  35. # You can uncomment this line and update the value if you wish to change 128M file size limit
  36. # MAX_CONTENT_LENGTH: "134217728"
  37. # After making the change, ensure you update `client_max_body_size` in nginx/nginx.conf correspondingly.
  38. # The number of document chunks processed in a single batch during document parsing.
  39. DOC_BULK_SIZE: 4
  40. # The number of text chunks processed in a single batch during embedding vectorization.
  41. EMBEDDING_BATCH_SIZE: 16
  42. ragflow:
  43. image:
  44. repository: infiniflow/ragflow
  45. tag: v0.20.4-slim
  46. pullPolicy: IfNotPresent
  47. pullSecrets: []
  48. # Optional service configuration overrides
  49. # to be written to local.service_conf.yaml
  50. # inside the RAGFlow container
  51. # https://ragflow.io/docs/dev/configurations#service-configuration
  52. service_conf:
  53. # Optional yaml formatted override for the
  54. # llm_factories.json file inside the RAGFlow
  55. # container.
  56. llm_factories:
  57. # factory_llm_infos:
  58. # - name: OpenAI-API-Compatible
  59. # logo: ""
  60. # tags: "LLM,TEXT EMBEDDING,SPEECH2TEXT,MODERATION"
  61. # status: "1"
  62. # llm:
  63. # - llm_name: my-custom-llm
  64. # tags: "LLM,CHAT,"
  65. # max_tokens: 100000
  66. # model_type: chat
  67. # is_tools: false
  68. # Kubernetes configuration
  69. deployment:
  70. strategy:
  71. resources:
  72. service:
  73. # Use LoadBalancer to expose the web interface externally
  74. type: ClusterIP
  75. api:
  76. service:
  77. enabled: true
  78. type: ClusterIP
  79. infinity:
  80. image:
  81. repository: infiniflow/infinity
  82. tag: v0.6.0-dev5
  83. pullPolicy: IfNotPresent
  84. pullSecrets: []
  85. storage:
  86. className:
  87. capacity: 5Gi
  88. deployment:
  89. strategy:
  90. resources:
  91. service:
  92. type: ClusterIP
  93. elasticsearch:
  94. image:
  95. repository: elasticsearch
  96. tag: "8.11.3"
  97. pullPolicy: IfNotPresent
  98. pullSecrets: []
  99. initContainers:
  100. alpine:
  101. repository: alpine
  102. tag: latest
  103. pullPolicy: IfNotPresent
  104. busybox:
  105. repository: busybox
  106. tag: latest
  107. pullPolicy: IfNotPresent
  108. storage:
  109. className:
  110. capacity: 20Gi
  111. deployment:
  112. strategy:
  113. resources:
  114. requests:
  115. cpu: "4"
  116. memory: "16Gi"
  117. service:
  118. type: ClusterIP
  119. opensearch:
  120. image:
  121. repository: opensearchproject/opensearch
  122. tag: 2.19.1
  123. pullPolicy: IfNotPresent
  124. pullSecrets: []
  125. initContainers:
  126. alpine:
  127. repository: alpine
  128. tag: latest
  129. pullPolicy: IfNotPresent
  130. busybox:
  131. repository: busybox
  132. tag: latest
  133. pullPolicy: IfNotPresent
  134. storage:
  135. className:
  136. capacity: 20Gi
  137. deployment:
  138. strategy:
  139. resources:
  140. requests:
  141. cpu: "4"
  142. memory: "16Gi"
  143. service:
  144. type: ClusterIP
  145. minio:
  146. image:
  147. repository: quay.io/minio/minio
  148. tag: RELEASE.2023-12-20T01-00-02Z
  149. pullPolicy: IfNotPresent
  150. pullSecrets: []
  151. storage:
  152. className:
  153. capacity: 5Gi
  154. deployment:
  155. strategy:
  156. resources:
  157. service:
  158. type: ClusterIP
  159. mysql:
  160. image:
  161. repository: mysql
  162. tag: 8.0.39
  163. pullPolicy: IfNotPresent
  164. pullSecrets: []
  165. storage:
  166. className:
  167. capacity: 5Gi
  168. deployment:
  169. strategy:
  170. resources:
  171. service:
  172. type: ClusterIP
  173. redis:
  174. image:
  175. repository: valkey/valkey
  176. tag: 8
  177. pullPolicy: IfNotPresent
  178. pullSecrets: []
  179. storage:
  180. className:
  181. capacity: 5Gi
  182. persistence:
  183. enabled: true
  184. # Set's the retention policy for the persistent storage (only available in k8s 1.32 or later)
  185. # https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
  186. # retentionPolicy:
  187. # whenDeleted: Delete
  188. # whenScaled: Delete
  189. deployment:
  190. strategy:
  191. resources:
  192. service:
  193. type: ClusterIP
  194. # This block is for setting up web service ingress. For more information, see:
  195. # https://kubernetes.io/docs/concepts/services-networking/ingress/
  196. ingress:
  197. enabled: false
  198. className: ""
  199. annotations: {}
  200. # kubernetes.io/ingress.class: nginx
  201. # kubernetes.io/tls-acme: "true"
  202. hosts:
  203. - host: chart-example.local
  204. paths:
  205. - path: /
  206. pathType: ImplementationSpecific
  207. tls: []
  208. # - secretName: chart-example-tls
  209. # hosts:
  210. # - chart-example.local