Cris
09/22/2025, 7:31 AMFanis Tharropoulos
09/22/2025, 8:00 AMCris
09/22/2025, 8:02 AMFanis Tharropoulos
09/22/2025, 8:03 AMCris
09/22/2025, 8:03 AMFanis Tharropoulos
09/22/2025, 8:03 AMCris
09/22/2025, 8:04 AM{
'nodes': [
{'host': f'{host_unique_key}-1.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-2.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-3.{host_domain}', 'port': '443', 'protocol': 'https'},
],
'api_key': Bootstrapper.config.typesense_api_key,
'connection_timeout_seconds': typesense_connection_timeout
}Fanis Tharropoulos
09/22/2025, 8:05 AMCris
09/22/2025, 8:05 AMCris
09/22/2025, 8:09 AMCris
09/22/2025, 8:09 AMCris
09/22/2025, 8:11 AMFanis Tharropoulos
09/22/2025, 8:12 AMFanis Tharropoulos
09/22/2025, 8:13 AMCris
09/22/2025, 8:13 AMFanis Tharropoulos
09/22/2025, 8:14 AMFanis Tharropoulos
09/22/2025, 8:15 AM/debug route. If the state key is 1, then it's the leaderFanis Tharropoulos
09/22/2025, 8:15 AMCris
09/22/2025, 8:18 AMCris
09/22/2025, 8:19 AMFanis Tharropoulos
09/22/2025, 8:20 AMCris
09/22/2025, 8:21 AMbut the point was because we only had a single worker it didn't work like that
because it round robins on dns level
but os can cache the dns response
so that works best when the typesense queries are coming from client side (e.g. browsers of users of a webshop)
that also played into removing itCris
09/22/2025, 8:24 AMtypesense_client_b_config = {
'nodes': [
{'host': f'{host_unique_key}-1.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-2.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-3.{host_domain}', 'port': '443', 'protocol': 'https'},
]
typesense_client_b_config = {
'nodes': [
{'host': f'{host_unique_key}-2.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-3.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-1.{host_domain}', 'port': '443', 'protocol': 'https'},
],
'api_key': Bootstrapper.config.typesense_api_key,
'connection_timeout_seconds': typesense_connection_timeout
}
typesense_client_b = typesense.Client(typesense_client_b_config)
typesense_client_c_config = {
'nodes': [
{'host': f'{host_unique_key}-3.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-1.{host_domain}', 'port': '443', 'protocol': 'https'},
{'host': f'{host_unique_key}-2.{host_domain}', 'port': '443', 'protocol': 'https'},
],
'api_key': Bootstrapper.config.typesense_api_key,
'connection_timeout_seconds': typesense_connection_timeout
}
typesense_client_c = typesense.Client(typesense_client_c_config)
with this, we use them linearly for each query like round robin, if first query use client_a, then next query will use client_b, to evenly distribute tasksCris
09/22/2025, 8:25 AMCris
09/22/2025, 8:25 AMFanis Tharropoulos
09/22/2025, 8:28 AMCris
09/23/2025, 2:22 AMFanis Tharropoulos
09/23/2025, 9:01 AMCris
09/23/2025, 9:25 AMCris
09/23/2025, 9:34 AMFanis Tharropoulos
09/23/2025, 9:43 AMCris
09/24/2025, 7:50 AMclient_a = {nodes: [host-1, host-2, host-3]}
client_b = {nodes: [host-2, host-3, host-1]}
client_c = {nodes: [host-3, host-1, host-2]}
Questions:
1. Since we our running typesense queries 4 at the same time on our scheduled task, if these queries are set to use client_a (where host-1 is the first one), would they all use host-1 ? or just in case on the 2rd query, host-1 becomes unhealthy, would typesense automatically route the 3rd and 4th queries on the next node?
2. if other processes are using typesense queries and we set them to use client_b (where host-2 is the first one), would they use host-2? and maybe if it's unhealthy, they will be rerouted to the next node?Fanis Tharropoulos
09/24/2025, 8:35 AMCris
09/24/2025, 9:13 AMnode 1 becomes unhealthy or reached a CPU set limit, would typesense automatically route the 3rd and 4th queries on the next node?Alan Martini
09/24/2025, 6:29 PM