diff --git a/de/15.9/config/llm-ollama.rst b/de/15.9/config/llm-ollama.rst index 9fe129f1..6a45cc77 100644 --- a/de/15.9/config/llm-ollama.rst +++ b/de/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ Alle verfügbaren Einstellungselemente für den Ollama-Client. Alle Einstellunge - Zu verwendendes Modell (muss in Ollama heruntergeladen sein) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - Anfrage-Timeout (Millisekunden) + - Antwort-Timeout (Lese-Timeout, Millisekunden). Eine Anfrage, die in dieses Timeout läuft, wird nicht wiederholt (siehe „Wiederholungsversuche") - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - Intervall der Verfügbarkeitsprüfung (Sekunden). Bei einem Wert von ``0`` oder kleiner wird die regelmäßige Verfügbarkeitsprüfung deaktiviert @@ -194,7 +194,7 @@ Alle verfügbaren Einstellungselemente für den Ollama-Client. Alle Einstellunge - TCP-Verbindungs-Timeout (Millisekunden). Kann unabhängig von ``rag.llm.ollama.timeout`` angegeben werden - ``5000`` * - ``rag.llm.ollama.retry.max`` - - Maximale Anzahl von HTTP-Wiederholungsversuchen (bei ``429``- und ``5xx``-Fehlern) + - Maximale Anzahl der Versuche pro Anfrage an Ollama, einschließlich des ersten (siehe „Wiederholungsversuche") - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - Basisverzögerung des exponentiellen Backoffs (Millisekunden) @@ -238,6 +238,35 @@ Mit ``rag.llm.ollama.max.concurrent.requests`` kann die Anzahl gleichzeitiger An Der Standardwert ist 5. Passen Sie diesen Wert entsprechend den Ressourcen des Ollama-Servers an. Bei zu vielen gleichzeitigen Anfragen kann der Ollama-Server überlastet werden und die Antwortgeschwindigkeit sinken. +Wiederholungsversuche +--------------------- + +Jede Anfrage an Ollama wird höchstens ``rag.llm.ollama.retry.max``-mal versucht, der erste Versuch eingeschlossen (``1`` deaktiviert Wiederholungen). Die Anfrage wird erneut versucht, wenn: + +- Ollama HTTP ``429``, ``500``, ``502``, ``503`` oder ``504`` zurückgibt +- die Anfrage fehlschlägt, bevor eine Antwort eintrifft, zum Beispiel weil die Verbindung abgelehnt oder zurückgesetzt wird, der Server die Verbindung ohne Antwort schließt oder innerhalb von ``rag.llm.ollama.connect.timeout`` keine Verbindung zustande kommt + +Vor dem zweiten Versuch wartet der Client ``rag.llm.ollama.retry.base.delay.ms``, und die Wartezeit verdoppelt sich mit jedem weiteren Versuch. Dazu kommt ein zufälliger Jitter von bis zu ±20 % der Basisverzögerung; eine einzelne Wartezeit beträgt nie mehr als 60 Sekunden. + +Folgende Fehler werden nicht wiederholt: + +- Ein Antwort-Timeout: Ollama hat die Anfrage angenommen, aber nicht innerhalb von ``rag.llm.ollama.timeout`` geantwortet. Ein weiterer Versuch würde nur erneut das volle Timeout abwarten +- Jeder andere HTTP-Fehlerstatus, etwa ``400`` oder ``404`` +- Ein Fehler, den Ollama innerhalb einer gestreamten Antwort meldet + +Mit den Standardwerten (``retry.max`` ``3``, ``retry.base.delay.ms`` ``2000``, ``connect.timeout`` ``5000``, ``timeout`` ``60000``) betragen die Wartezeiten zwischen den Versuchen etwa 2 und 4 Sekunden. Eine Anfrage, die immer wieder fehlschlägt, wird daher abgebrochen nach: + +- etwa 6 Sekunden, wenn die Verbindung abgelehnt wird (3 Versuche) +- etwa 21 Sekunden, wenn jeder Verbindungsaufbau in das Timeout läuft (3 × 5 Sekunden plus Wartezeiten) +- etwa 6 Sekunden plus der Zeit, die Ollama für jede Fehlerantwort braucht, bei einem wiederholbaren HTTP-Status (3 Versuche) +- 60 Sekunden bei einem Antwort-Timeout (1 Versuch) + +Diese Grenzen gelten für jede einzelne Anfrage an Ollama. Eine Frage im AI-Suchmodus sendet mehrere Anfragen, etwa zur Absichtserkennung und zur Antwortgenerierung, und jede hat eigene Versuche und ein eigenes Timeout. + +Antwortet ein Modell langsam, etwa weil es für die erste Anfrage noch geladen wird, erhöhen Sie ``rag.llm.ollama.timeout`` wie in „Empfohlene Konfiguration (Produktionsumgebung)". Ein höheres ``rag.llm.ollama.retry.max`` hilft nicht, da ein Antwort-Timeout nicht wiederholt wird. + +Der Ollama-Embedding-Client der semantischen Suche (``content_chunker.embedding.name=ollama``) wiederholt Anfragen auf dieselbe Weise. Seine Einstellungen sind ``content_chunker.embedding.ollama.timeout``, ``content_chunker.embedding.ollama.retry.max`` und ``content_chunker.embedding.ollama.retry.base.delay.ms`` in ``system.properties``, mit denselben Standardwerten (siehe :doc:`search-semantic`). + Prompttypspezifische Einstellungen =================================== diff --git a/en/15.9/config/llm-ollama.rst b/en/15.9/config/llm-ollama.rst index 5ae7f503..43ea8bd6 100644 --- a/en/15.9/config/llm-ollama.rst +++ b/en/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ All configuration options available for the Ollama client. All settings except ` - Model name to use (must be already downloaded to Ollama) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - Request timeout (in milliseconds) + - Response (read) timeout (in milliseconds). A request that runs into it is not retried (see "Retries") - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - Availability check interval (in seconds). Setting a value of ``0`` or lower disables periodic availability checks @@ -194,7 +194,7 @@ All configuration options available for the Ollama client. All settings except ` - TCP connect timeout (in milliseconds). Configurable separately from ``rag.llm.ollama.timeout`` - ``5000`` * - ``rag.llm.ollama.retry.max`` - - Maximum number of HTTP retry attempts (on ``429`` and ``5xx`` errors) + - Maximum number of attempts per request to Ollama, including the first (see "Retries") - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - Base delay for exponential backoff (in milliseconds) @@ -238,6 +238,35 @@ Use ``rag.llm.ollama.max.concurrent.requests`` to control the number of concurre The default is 5. Adjust according to the resources of your Ollama server. Too many concurrent requests may overload the Ollama server and degrade response speed. +Retries +------- + +Each request to Ollama is attempted at most ``rag.llm.ollama.retry.max`` times, including the first attempt (``1`` disables retries). The request is attempted again when: + +- Ollama returns HTTP ``429``, ``500``, ``502``, ``503`` or ``504`` +- The request fails before a response arrives, for example because the connection is refused or reset, the server closes the connection without answering, or no connection is established within ``rag.llm.ollama.connect.timeout`` + +Before the second attempt the client waits ``rag.llm.ollama.retry.base.delay.ms``, and the wait doubles for each further attempt. A random jitter of up to ±20% of the base delay is added, and a single wait never exceeds 60 seconds. + +The following failures are not retried: + +- A response timeout: Ollama accepted the request but did not answer within ``rag.llm.ollama.timeout``. Another attempt would only wait the full timeout again +- Any other HTTP error status, such as ``400`` or ``404`` +- An error that Ollama reports inside a streamed response + +With the defaults (``retry.max`` ``3``, ``retry.base.delay.ms`` ``2000``, ``connect.timeout`` ``5000``, ``timeout`` ``60000``), the waits between attempts are about 2 and 4 seconds, so a request that keeps failing gives up after: + +- About 6 seconds when the connection is refused (3 attempts) +- About 21 seconds when every connection attempt times out (3 × 5 seconds plus the waits) +- About 6 seconds plus the time Ollama takes to return each error, for a retryable HTTP status (3 attempts) +- 60 seconds for a response timeout (1 attempt) + +These limits apply to each request to Ollama. One question in AI search mode sends several requests, for example for intent detection and for answer generation, and each has its own attempts and timeout. + +If a model answers slowly, for example while it is still being loaded for its first request, raise ``rag.llm.ollama.timeout`` as in "Recommended Configuration (Production)". Raising ``rag.llm.ollama.retry.max`` does not help, because a response timeout is not retried. + +The Ollama embedding client for semantic search (``content_chunker.embedding.name=ollama``) retries the same way. Its settings are ``content_chunker.embedding.ollama.timeout``, ``content_chunker.embedding.ollama.retry.max`` and ``content_chunker.embedding.ollama.retry.base.delay.ms`` in ``system.properties``, with the same defaults (see :doc:`search-semantic`). + Per-Prompt-Type Settings ======================== diff --git a/es/15.9/config/llm-ollama.rst b/es/15.9/config/llm-ollama.rst index b4eefb0c..c1612fb0 100644 --- a/es/15.9/config/llm-ollama.rst +++ b/es/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ Todos los elementos de configuración disponibles para el cliente de Ollama. Tod - Nombre del modelo a usar (modelo descargado en Ollama) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - Timeout de solicitud (milisegundos) + - Timeout de respuesta (lectura) (milisegundos). Una solicitud que agota este timeout no se reintenta (consulte "Reintentos") - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - Intervalo de verificación de disponibilidad (segundos). Si se especifica ``0`` o un valor menor, se deshabilita la verificación periódica de disponibilidad @@ -194,7 +194,7 @@ Todos los elementos de configuración disponibles para el cliente de Ollama. Tod - Timeout de conexión TCP (milisegundos). Se puede especificar de forma independiente a ``rag.llm.ollama.timeout`` - ``5000`` * - ``rag.llm.ollama.retry.max`` - - Número máximo de reintentos HTTP (en errores ``429`` y de la familia ``5xx``) + - Número máximo de intentos por solicitud a Ollama, incluido el primero (consulte "Reintentos") - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - Retardo base del backoff exponencial (milisegundos) @@ -238,6 +238,35 @@ Usando ``rag.llm.ollama.max.concurrent.requests``, puede controlar el número de El valor predeterminado es 5. Ajústelo según los recursos del servidor Ollama. Si el número de solicitudes simultáneas es demasiado alto, puede sobrecargar el servidor Ollama y reducir la velocidad de respuesta. +Reintentos +---------- + +Cada solicitud a Ollama se intenta como máximo ``rag.llm.ollama.retry.max`` veces, incluido el primer intento (``1`` desactiva los reintentos). La solicitud se vuelve a intentar cuando: + +- Ollama devuelve HTTP ``429``, ``500``, ``502``, ``503`` o ``504`` +- La solicitud falla antes de recibir una respuesta, por ejemplo porque la conexión se rechaza o se restablece, el servidor cierra la conexión sin responder, o no se establece la conexión dentro de ``rag.llm.ollama.connect.timeout`` + +Antes del segundo intento, el cliente espera ``rag.llm.ollama.retry.base.delay.ms``, y la espera se duplica en cada intento posterior. Se añade una variación aleatoria (jitter) de hasta ±20 % del retardo base, y una sola espera nunca supera los 60 segundos. + +Los siguientes fallos no se reintentan: + +- Un timeout de respuesta: Ollama aceptó la solicitud pero no respondió dentro de ``rag.llm.ollama.timeout``. Otro intento solo volvería a esperar el timeout completo +- Cualquier otro código de estado de error HTTP, como ``400`` o ``404`` +- Un error que Ollama notifica dentro de una respuesta en streaming + +Con los valores predeterminados (``retry.max`` ``3``, ``retry.base.delay.ms`` ``2000``, ``connect.timeout`` ``5000``, ``timeout`` ``60000``), las esperas entre intentos son de unos 2 y 4 segundos, por lo que una solicitud que sigue fallando se abandona tras: + +- Unos 6 segundos cuando se rechaza la conexión (3 intentos) +- Unos 21 segundos cuando todos los intentos de conexión agotan el timeout (3 × 5 segundos más las esperas) +- Unos 6 segundos más el tiempo que Ollama tarda en devolver cada error, con un código de estado HTTP reintentable (3 intentos) +- 60 segundos con un timeout de respuesta (1 intento) + +Estos límites se aplican a cada solicitud a Ollama. Una pregunta en el modo de búsqueda IA envía varias solicitudes, por ejemplo para la determinación de intención y para la generación de la respuesta, y cada una tiene sus propios intentos y su propio timeout. + +Si un modelo responde lentamente, por ejemplo mientras todavía se está cargando para su primera solicitud, aumente ``rag.llm.ollama.timeout`` como en "Configuración recomendada (entorno de producción)". Aumentar ``rag.llm.ollama.retry.max`` no ayuda, porque un timeout de respuesta no se reintenta. + +El cliente de embeddings de Ollama para la búsqueda semántica (``content_chunker.embedding.name=ollama``) reintenta de la misma manera. Su configuración es ``content_chunker.embedding.ollama.timeout``, ``content_chunker.embedding.ollama.retry.max`` y ``content_chunker.embedding.ollama.retry.base.delay.ms`` en ``system.properties``, con los mismos valores predeterminados (consulte :doc:`search-semantic`). + Configuración por tipo de prompt ================================= diff --git a/fr/15.9/config/llm-ollama.rst b/fr/15.9/config/llm-ollama.rst index 0abd85c6..60d9f0d7 100644 --- a/fr/15.9/config/llm-ollama.rst +++ b/fr/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ Tous les éléments de configuration disponibles pour le client Ollama. Tous, sa - Nom du modèle à utiliser (modèle déjà téléchargé dans Ollama) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - Délai d'expiration des requêtes (millisecondes) + - Délai d'expiration de la réponse (lecture, millisecondes). Une requête qui atteint ce délai n'est pas retentée (voir « Nouvelles tentatives ») - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - Intervalle de vérification de disponibilité (secondes). Une valeur inférieure ou égale à ``0`` désactive la vérification périodique de disponibilité @@ -194,7 +194,7 @@ Tous les éléments de configuration disponibles pour le client Ollama. Tous, sa - Délai d'expiration de la connexion TCP (millisecondes). Peut être spécifié séparément de ``rag.llm.ollama.timeout`` - ``5000`` * - ``rag.llm.ollama.retry.max`` - - Nombre maximal de tentatives HTTP (en cas d'erreur ``429`` ou de la série ``5xx``) + - Nombre maximal de tentatives par requête vers Ollama, première tentative comprise (voir « Nouvelles tentatives ») - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - Délai de base du backoff exponentiel (millisecondes) @@ -238,6 +238,35 @@ Contrôle de la concurrence La valeur par défaut est 5. Ajustez-la en fonction des ressources du serveur Ollama. Un nombre trop élevé de requêtes simultanées peut surcharger le serveur Ollama et réduire la vitesse de réponse. +Nouvelles tentatives +-------------------- + +Chaque requête vers Ollama est tentée au plus ``rag.llm.ollama.retry.max`` fois, première tentative comprise (``1`` désactive les nouvelles tentatives). La requête est tentée à nouveau lorsque : + +- Ollama renvoie HTTP ``429``, ``500``, ``502``, ``503`` ou ``504`` +- La requête échoue avant qu'une réponse n'arrive, par exemple parce que la connexion est refusée ou réinitialisée, que le serveur ferme la connexion sans répondre, ou que la connexion n'est pas établie dans le délai ``rag.llm.ollama.connect.timeout`` + +Avant la deuxième tentative, le client attend ``rag.llm.ollama.retry.base.delay.ms``, et l'attente double à chaque tentative suivante. Une variation aléatoire (jitter) allant jusqu'à ±20 % du délai de base s'y ajoute, et une attente ne dépasse jamais 60 secondes. + +Les échecs suivants ne sont pas retentés : + +- Un délai d'expiration de la réponse : Ollama a accepté la requête mais n'a pas répondu dans le délai ``rag.llm.ollama.timeout``. Une nouvelle tentative ne ferait qu'attendre à nouveau tout le délai +- Tout autre code d'erreur HTTP, par exemple ``400`` ou ``404`` +- Une erreur signalée par Ollama à l'intérieur d'une réponse en streaming + +Avec les valeurs par défaut (``retry.max`` ``3``, ``retry.base.delay.ms`` ``2000``, ``connect.timeout`` ``5000``, ``timeout`` ``60000``), les attentes entre les tentatives sont d'environ 2 et 4 secondes ; une requête qui continue d'échouer est donc abandonnée après : + +- Environ 6 secondes lorsque la connexion est refusée (3 tentatives) +- Environ 21 secondes lorsque chaque tentative de connexion expire (3 × 5 secondes plus les attentes) +- Environ 6 secondes plus le temps que met Ollama à renvoyer chaque erreur, pour un code HTTP retenté (3 tentatives) +- 60 secondes pour un délai d'expiration de la réponse (1 tentative) + +Ces limites s'appliquent à chaque requête vers Ollama. Une question en mode de recherche IA envoie plusieurs requêtes, par exemple pour la détermination de l'intention et pour la génération de la réponse, chacune avec ses propres tentatives et son propre délai d'expiration. + +Si un modèle répond lentement, par exemple parce qu'il est encore en cours de chargement pour sa première requête, augmentez ``rag.llm.ollama.timeout`` comme dans « Configuration recommandée (environnement de production) ». Augmenter ``rag.llm.ollama.retry.max`` n'aide pas, car un délai d'expiration de la réponse n'est pas retenté. + +Le client d'embeddings Ollama de la recherche sémantique (``content_chunker.embedding.name=ollama``) procède de la même manière. Ses paramètres sont ``content_chunker.embedding.ollama.timeout``, ``content_chunker.embedding.ollama.retry.max`` et ``content_chunker.embedding.ollama.retry.base.delay.ms`` dans ``system.properties``, avec les mêmes valeurs par défaut (voir :doc:`search-semantic`). + Configuration par type de prompt ==================================== diff --git a/ja/15.9/config/llm-ollama.rst b/ja/15.9/config/llm-ollama.rst index 6eaac2fc..bac0e4b7 100644 --- a/ja/15.9/config/llm-ollama.rst +++ b/ja/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ Ollamaクライアントで使用可能なすべての設定項目です。 ``ra - 使用するモデル名(Ollamaにダウンロード済みのモデル) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - リクエストのタイムアウト時間(ミリ秒) + - 応答(読み取り)のタイムアウト時間(ミリ秒)。このタイムアウトに達したリクエストは再試行されません(「リトライ」を参照) - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - 可用性チェック間隔(秒)。 ``0`` 以下を指定すると定期的な可用性チェックを無効化します @@ -194,7 +194,7 @@ Ollamaクライアントで使用可能なすべての設定項目です。 ``ra - TCP接続タイムアウト(ミリ秒)。 ``rag.llm.ollama.timeout`` とは別に指定可能 - ``5000`` * - ``rag.llm.ollama.retry.max`` - - HTTPリトライの最大試行回数( ``429`` および ``5xx`` 系エラー時) + - Ollamaへの1リクエストあたりの最大試行回数(初回を含む。「リトライ」を参照) - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - 指数バックオフの基準遅延時間(ミリ秒) @@ -238,6 +238,35 @@ Ollamaクライアントで使用可能なすべての設定項目です。 ``ra デフォルトは5です。Ollamaサーバーのリソースに応じて調整してください。 同時リクエスト数が多すぎるとOllamaサーバーに負荷がかかり、応答速度が低下する場合があります。 +リトライ +-------- + +Ollamaへの各リクエストは、初回を含めて最大 ``rag.llm.ollama.retry.max`` 回試行されます( ``1`` を指定するとリトライしません)。次の場合にリクエストを再試行します。 + +- OllamaがHTTP ``429`` 、 ``500`` 、 ``502`` 、 ``503`` 、 ``504`` を返した場合 +- 応答を受け取る前にリクエストが失敗した場合(接続が拒否またはリセットされた、サーバーが応答せずに接続を閉じた、 ``rag.llm.ollama.connect.timeout`` 以内に接続できなかった、など) + +2回目の試行の前に ``rag.llm.ollama.retry.base.delay.ms`` だけ待機し、以降は試行ごとに待機時間が2倍になります。待機時間には基準遅延時間の最大±20%のランダムな揺らぎ(ジッター)が加わり、1回の待機が60秒を超えることはありません。 + +次の失敗は再試行されません。 + +- 応答タイムアウト: Ollamaがリクエストを受け付けたものの、 ``rag.llm.ollama.timeout`` 以内に応答しなかった場合。再試行しても、再びタイムアウト時間いっぱいまで待つだけです +- 上記以外のHTTPエラーステータス( ``400`` 、 ``404`` など) +- ストリーミング応答の中でOllamaが返したエラー + +デフォルト値( ``retry.max`` が ``3`` 、 ``retry.base.delay.ms`` が ``2000`` 、 ``connect.timeout`` が ``5000`` 、 ``timeout`` が ``60000`` )では試行間の待機は約2秒と約4秒で、失敗し続けるリクエストは次の時間で打ち切られます。 + +- 接続が拒否される場合: 約6秒(3回試行) +- 毎回接続タイムアウトになる場合: 約21秒(5秒×3回と待機時間) +- 再試行対象のHTTPステータスが返る場合: 約6秒とOllamaが各エラーを返すまでの時間の合計(3回試行) +- 応答タイムアウトの場合: 60秒(1回試行) + +これらの上限はOllamaへのリクエストごとに適用されます。AI検索モードでの1回の質問では、意図判定や回答生成などのために複数のリクエストが送られ、それぞれに試行回数とタイムアウトが適用されます。 + +モデルの応答が遅い場合(最初のリクエストでモデルを読み込んでいる場合など)は、「推奨構成(本番環境)」のように ``rag.llm.ollama.timeout`` を増やしてください。応答タイムアウトは再試行されないため、 ``rag.llm.ollama.retry.max`` を増やしても効果はありません。 + +セマンティック検索で使用するOllamaの埋め込みクライアント( ``content_chunker.embedding.name=ollama`` )も同じ方法で再試行します。設定は ``system.properties`` の ``content_chunker.embedding.ollama.timeout`` 、 ``content_chunker.embedding.ollama.retry.max`` 、 ``content_chunker.embedding.ollama.retry.base.delay.ms`` で、デフォルト値は上記と同じです( :doc:`search-semantic` を参照)。 + プロンプトタイプ別設定 ====================== diff --git a/ko/15.9/config/llm-ollama.rst b/ko/15.9/config/llm-ollama.rst index c00f22e4..d4628aa6 100644 --- a/ko/15.9/config/llm-ollama.rst +++ b/ko/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ Ollama 클라이언트에서 사용 가능한 모든 설정 항목입니다. ``r - 사용할 모델명(Ollama에 다운로드된 모델) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - 요청 타임아웃 시간(밀리초) + - 응답(읽기) 타임아웃 시간(밀리초). 이 타임아웃에 도달한 요청은 재시도하지 않습니다(「재시도」 참조) - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - 가용성 체크 간격(초). ``0`` 이하를 지정하면 정기적인 가용성 체크를 비활성화합니다 @@ -194,7 +194,7 @@ Ollama 클라이언트에서 사용 가능한 모든 설정 항목입니다. ``r - TCP 연결 타임아웃(밀리초). ``rag.llm.ollama.timeout`` 과는 별도로 지정 가능 - ``5000`` * - ``rag.llm.ollama.retry.max`` - - HTTP 재시도의 최대 시도 횟수( ``429`` 및 ``5xx`` 계열 오류 시) + - Ollama로의 요청 1건당 최대 시도 횟수(첫 시도 포함. 「재시도」 참조) - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - 지수 백오프의 기준 지연 시간(밀리초) @@ -238,6 +238,35 @@ Ollama 클라이언트에서 사용 가능한 모든 설정 항목입니다. ``r 기본값은 5입니다. Ollama 서버의 리소스에 따라 조정하세요. 동시 요청 수가 너무 많으면 Ollama 서버에 부하가 걸려 응답 속도가 저하될 수 있습니다. +재시도 +------ + +Ollama로의 각 요청은 첫 시도를 포함하여 최대 ``rag.llm.ollama.retry.max`` 회 시도됩니다( ``1`` 을 지정하면 재시도하지 않습니다). 다음의 경우 요청을 다시 시도합니다. + +- Ollama가 HTTP ``429``, ``500``, ``502``, ``503``, ``504`` 를 반환한 경우 +- 응답을 받기 전에 요청이 실패한 경우(연결이 거부 또는 리셋됨, 서버가 응답 없이 연결을 닫음, ``rag.llm.ollama.connect.timeout`` 이내에 연결되지 않음 등) + +두 번째 시도 전에 ``rag.llm.ollama.retry.base.delay.ms`` 만큼 대기하며, 이후 시도할 때마다 대기 시간이 2배가 됩니다. 대기 시간에는 기준 지연 시간의 최대 ±20%의 무작위 편차(지터)가 더해지며, 한 번의 대기는 60초를 넘지 않습니다. + +다음 실패는 재시도하지 않습니다. + +- 응답 타임아웃: Ollama가 요청을 받아들였지만 ``rag.llm.ollama.timeout`` 이내에 응답하지 않은 경우. 다시 시도해도 타임아웃 시간만큼 다시 기다릴 뿐입니다 +- 그 밖의 HTTP 오류 상태(예: ``400``, ``404``) +- 스트리밍 응답 안에서 Ollama가 보고한 오류 + +기본값( ``retry.max`` 가 ``3``, ``retry.base.delay.ms`` 가 ``2000``, ``connect.timeout`` 이 ``5000``, ``timeout`` 이 ``60000`` )에서는 시도 간 대기가 약 2초와 약 4초이므로, 계속 실패하는 요청은 다음 시간 후에 중단됩니다. + +- 연결이 거부되는 경우: 약 6초(3회 시도) +- 매번 연결 타임아웃이 발생하는 경우: 약 21초(5초×3회와 대기 시간) +- 재시도 대상 HTTP 상태가 반환되는 경우: 약 6초와 Ollama가 각 오류를 반환하는 데 걸리는 시간의 합(3회 시도) +- 응답 타임아웃의 경우: 60초(1회 시도) + +이 한도는 Ollama로의 요청마다 적용됩니다. AI 검색 모드에서 질문 한 번에 의도 판정이나 답변 생성 등을 위해 여러 요청이 전송되며, 각 요청에 시도 횟수와 타임아웃이 따로 적용됩니다. + +모델의 응답이 느린 경우(첫 요청에서 모델을 로드하는 중인 경우 등)에는 「권장 구성(프로덕션 환경)」과 같이 ``rag.llm.ollama.timeout`` 을 늘리세요. 응답 타임아웃은 재시도되지 않으므로 ``rag.llm.ollama.retry.max`` 를 늘려도 효과가 없습니다. + +시맨틱 검색에서 사용하는 Ollama 임베딩 클라이언트( ``content_chunker.embedding.name=ollama`` )도 같은 방식으로 재시도합니다. 설정은 ``system.properties`` 의 ``content_chunker.embedding.ollama.timeout``, ``content_chunker.embedding.ollama.retry.max``, ``content_chunker.embedding.ollama.retry.base.delay.ms`` 이며, 기본값은 위와 같습니다( :doc:`search-semantic` 참조). + 프롬프트 타입별 설정 ====================== diff --git a/zh-cn/15.9/config/llm-ollama.rst b/zh-cn/15.9/config/llm-ollama.rst index 5cbd633a..c9a5bfc8 100644 --- a/zh-cn/15.9/config/llm-ollama.rst +++ b/zh-cn/15.9/config/llm-ollama.rst @@ -176,7 +176,7 @@ Ollama客户端可用的所有配置项。 ``rag.llm.name`` 以外的所有配 - 使用的模型名称(已下载到Ollama的模型) - ``gemma4:e4b`` * - ``rag.llm.ollama.timeout`` - - 请求超时时间(毫秒) + - 响应(读取)超时时间(毫秒)。达到该超时的请求不会重试(详见"重试") - ``60000`` * - ``rag.llm.ollama.availability.check.interval`` - 可用性检查间隔(秒)。指定 ``0`` 或以下时禁用定期可用性检查 @@ -194,7 +194,7 @@ Ollama客户端可用的所有配置项。 ``rag.llm.name`` 以外的所有配 - TCP连接超时(毫秒)。可独立于 ``rag.llm.ollama.timeout`` 单独指定 - ``5000`` * - ``rag.llm.ollama.retry.max`` - - HTTP重试的最大尝试次数( ``429`` 及 ``5xx`` 系错误时) + - 对Ollama的每个请求的最大尝试次数(含首次。详见"重试") - ``3`` * - ``rag.llm.ollama.retry.base.delay.ms`` - 指数退避的基准延迟时间(毫秒) @@ -238,6 +238,35 @@ Ollama客户端可用的所有配置项。 ``rag.llm.name`` 以外的所有配 默认值为5。请根据Ollama服务器的资源进行调整。 并发请求数过多时,会给Ollama服务器增加负担,导致响应速度下降。 +重试 +---- + +对Ollama的每个请求最多尝试 ``rag.llm.ollama.retry.max`` 次,包含首次尝试(指定 ``1`` 时不重试)。在以下情况下会再次尝试请求: + +- Ollama返回HTTP ``429`` 、 ``500`` 、 ``502`` 、 ``503`` 或 ``504`` +- 在收到响应之前请求失败,例如连接被拒绝或重置、服务器未响应就关闭了连接,或者在 ``rag.llm.ollama.connect.timeout`` 内未能建立连接 + +第二次尝试前等待 ``rag.llm.ollama.retry.base.delay.ms`` ,之后每次尝试的等待时间翻倍。等待时间会加上最多为基准延迟时间±20%的随机抖动,单次等待不会超过60秒。 + +以下失败不会重试: + +- 响应超时:Ollama已接受请求,但未在 ``rag.llm.ollama.timeout`` 内响应。再次尝试也只会再等待完整的超时时间 +- 其他HTTP错误状态,例如 ``400`` 或 ``404`` +- Ollama在流式响应中报告的错误 + +使用默认值( ``retry.max`` 为 ``3`` , ``retry.base.delay.ms`` 为 ``2000`` , ``connect.timeout`` 为 ``5000`` , ``timeout`` 为 ``60000`` )时,尝试之间的等待约为2秒和4秒,因此持续失败的请求会在以下时间后放弃: + +- 连接被拒绝时:约6秒(尝试3次) +- 每次连接都超时时:约21秒(5秒×3次加上等待时间) +- 返回可重试的HTTP状态时:约6秒加上Ollama每次返回错误所需的时间(尝试3次) +- 响应超时时:60秒(尝试1次) + +这些限制适用于对Ollama的每个请求。AI搜索模式下的一次提问会发送多个请求(例如用于意图判定和回答生成),每个请求都有各自的尝试次数和超时。 + +如果模型响应较慢(例如首次请求时模型仍在加载),请参照"推荐配置(生产环境)"增大 ``rag.llm.ollama.timeout`` 。由于响应超时不会重试,增大 ``rag.llm.ollama.retry.max`` 并无帮助。 + +语义搜索使用的Ollama嵌入客户端( ``content_chunker.embedding.name=ollama`` )也以相同方式重试。其设置为 ``system.properties`` 中的 ``content_chunker.embedding.ollama.timeout`` 、 ``content_chunker.embedding.ollama.retry.max`` 和 ``content_chunker.embedding.ollama.retry.base.delay.ms`` ,默认值与上述相同(参见 :doc:`search-semantic` )。 + 按提示词类型配置 ================