new_in_town
03/12/2026, 11:19 AMundefined: Request failed with HTTP code 400 | Server said: API timeout.
i changed configuration of browser-based-typesense-client :
const TS_CONNECTION_OPTS_DEFAULT = {
...
'sendApiKeyAsQueryParam': false,
'numRetries': 5,
'retryIntervalSeconds': 2,
'connectionTimeoutSeconds': 20,
'timeoutSeconds': 20,
'cacheSearchResultsForSeconds': 5 * 60,
'useServerSideSearchCache': true, // this send "use_cache: true", https://typesense.org/docs/30.1/api/search.html#caching-parameters
'healthcheckIntervalSeconds': 10,
...
1. How bad is this?
(in my case: new documents added/updated to server every 12 hours, so I could, probably cache even more, what are the correct settings for this?)
2. It would be great to have some chapter in documentation describing:
- timeouts settings
- client cache vs server cache, how to tune/optimize it
- client retry settings
- what to do in case of bad/unreliable internet connections
thanks in advance!Fanis Tharropoulos
03/12/2026, 11:31 AMnew_in_town
03/12/2026, 11:45 AMcacheSearchResultsForSeconds - 30 min, 1 hour... I want to reduce server load, and server documents get updated every 12 hours ANYWAY.
> If this is interactive search in the browser,
No, this is NOT "search as you type", this is "select 3-6 criteria, type something, press search button"
Another thing is WHY timeout happens. The error is: undefined: Request failed with HTTP code 400 | Server said: API timeout. so this look like timeoud INSIDE server process - it responds with HTTP 400.
In the past there was no such problems, no timeouts, everything was extremely fast.
Some time ago I did this on the server side:
{
"name": "embedding",
"type": "float[]",
"num_dim" : 4096,
"embed": {
"from": [
"title",
"content",
"tags1",
"tags2",
"organization",
],
"model_config": {
"query_prefix": "query:Given a search query, retrieve relevant passages that answer the query",
"model_name": "openai/Qwen/Qwen3-Embedding-8B",
"api_key": ...
"url": "https://api.studio.nebius.ai/v1/embeddings"
}
}
}
... as far as I understand - every time I do hybrid search my typesense-server talks to api.studio.nebius.ai/v1/embeddings and... all this might cause these timeouts (they happens during HYBRID search).
1. How to diagnose this on the server side?
2. Any server-side settings to tweak ?
UPDATE: on the server side I did (in /etc/typesense/typesense-server.ini):
log-dir = /var/log/typesense
enable-search-logging = true
enable-access-logging = true
log-slow-requests-time-ms = 2000
now where do I find these slow requests, which log file?new_in_town
03/12/2026, 12:26 PMgrep event= /var/log/typesense/typesense.log but now I can not reproduce these slow requests...Fanis Tharropoulos
03/12/2026, 1:48 PMnew_in_town
03/12/2026, 1:48 PMevent=slow_request, time=3175 ms , good... how to dig deeper? How do I know - is it related to external embedder?Fanis Tharropoulos
03/12/2026, 1:51 PMnew_in_town
03/12/2026, 1:57 PM