Improving Search Response Time in Typesense
TLDR Ed expressed concerns about higher search response times. Jason identified the high max facet value and average record size factors contributing to the issue. They also discussed options to enhance performance, such as limiting facet values display and upgrading the CPU.
1
Aug 02, 2023 (2 months ago)
Ed
08:18 PM<https://airbnb-geosearch.typesense.org/>
and the search response time looks pretty good with millions of records. I have 1800 records and my search_ms is 223, I wonder if I am doing something wrong hereJason
08:18 PMEd
08:19 PMcurl '' \
-H 'authority: ' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cache-control: no-cache' \
-H 'content-type: text/plain' \
-H 'dnt: 1' \
-H 'origin: xxxx \
-H 'pragma: no-cache' \
-H 'referer:xxx/' \
-H 'sec-ch-ua: "Chromium";v="115", "Not/A)Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: cross-site' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36' \
--data-raw '{"searches":[{"collection":"tkag_en","q":"*","query_by":"data.title,content","drop_tokens_threshold":0,"filter_by":"data.jobField:=[`Engineering & Science`]","sort_by":"_text_match:desc,data.postingDate_timestamp:desc","page":1,"per_page":50,"facet_by":"data.businessUnit,data.category,data.company,data.contract,data.employmentType,data.entryLevel,data.jobField,data.language,data.remote,data.locations.cityState,data.locations.state,data.locations.country","max_facet_values":500,"include_fields":"data,_geoloc"},{"collection":"tkag_en","q":"*","query_by":"data.title,content","drop_tokens_threshold":0,"filter_by":"","sort_by":"_text_match:desc,data.postingDate_timestamp:desc","page":1,"per_page":0,"facet_by":"data.jobField","max_facet_values":500,"include_fields":""}]}' \
--compressed
Jason
08:38 PM1. The geo search demo is running a non-burst CPU type, whereas your cluster has burst CPU type where performance can be a little unpredictable.
2.
"max_facet_values":500
is what’s causing most of the slow-downs. If you’re able to remove that and leave it as the default, that will speed things up3. Your average record size seems pretty high as well (at least a few KB), whereas the geosearch demo dataset record size is probably under 0.5kb
Ed
08:39 PMEd
08:40 PMJason
08:40 PMEd
08:40 PMEd
09:32 PMmax_facet_values
?Ed
09:32 PMJason
09:33 PMEd
10:07 PMEd
10:08 PMJason
10:08 PMJason
10:09 PMEd
10:09 PMJason
10:10 PMEd
10:10 PMJason
10:10 PMEd
10:11 PMEd
10:11 PMJason
10:11 PMIt sounds like you might be fetching way more than the UI displays then
Ed
10:12 PM1
Ed
10:12 PMEd
10:21 PMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
Optimizing Bulk Indexing and Reducing RAM Usage in Typesense
Timon experienced issues with Typesense becoming unresponsive during bulk indexing and sought advice. Jason recommended larger import requests and adjusting the client-side timeout allowance, revealing a need to increase RAM allocation for Docker. Kishore Nallan undertook to find ways to optimize memory usage, particularly for geopoint indexing.
Quick Retrieval of Min, Max, and Median Values from Search Query
Prajjval sought a more efficient way to find the min, max, and median values from a search query result. Jason suggested faceting. However, Prajjval clarified that faceting prolonged document upload due to a data type error, which was later resolved.
Improving System Performance and Typesense Query Efficiency
SamHendley was experiencing performance issues with Typesense's large-scale system testing and proposed several improvements. Both Jason and Kishore Nallan addressed the suggestions and corrected some misconceptions. They provided further clarification and recommended upgrades for better performance.
Discussing Server Side Cache Limit for Optimising CPU Usage.
Aljosa expressed difficulty benefiting from their server's cache due to varied queries, and suggested a cache limit increase. Kishore Nallan provided potential solutions and agreed to make the cache limit configurable. After adjusting queries, Aljosa saw improved CPU usage.
Discussing Typesense Search Request Performance
Al experienced longer-than-reported times for Typesense search requests, sparking a detailed examination of json parsing, response times and data transfer. Jason and Kishore Nallan helped solve the issue.