#community-help

Typesense Server Import Batching Issues

TLDR Alex had issues with import batching in production Typesense server, with failed syncs for batch sizes over 100. Kishore Nallan suggested an upgrade to version 0.22.1 and offered to check logs.

Powered by Struct AI

1

Dec 16, 2021 (23 months ago)
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
03:30 PM
Hi there! I have some issues related to import batching. We are using a script to populate/sync data to our Typesense server. We are using Typesense Cloud. We are using the javascript libary and the client.collections('collentionName').documents().import(batchOfItems) function. Our test/staging typesense server can handle batch sizes of 400 easily, but our production typesense fails (sometimes silently and sometimes with timeout error) if the batch sizes is above 100 - even though the timeout is set to 20 seconds. Do you guys have any idea why our Test server (which has minimal cpu and memory) can handle much more? It is pretty annoying as we have 2 millions of items to sync ๐Ÿ˜„ Thanks in advance
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
03:48 PM
๐Ÿ‘‹ do you get any error response from the API when this happens?
03:49
Kishore Nallan
03:49 PM
Also can you please tell me the version of Typesense on production?
Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
03:50 PM
Hi Kishore! version 0.21
03:51
Alex
03:51 PM
No, or my script just dies without throwing an error, but i am not sure if it is something with my code or notโ€ฆ
Right now i can make it work, by using 30s timeout and a batch size of 40. But that will take 110 hours to sync all data.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
03:52 PM
My first recommendation is to upgrade 0.22.1 because we've made some significant improvements to update performance.

However, in general Typesense tries to give preference to searching vs compared to indexing because latencies in search is far worse than some delay in indexing. Again in 0.22.1 is better on this front and will explicitly return a "lagging" message if you try to write too fast. In which case, you can handle that by backing off.
03:52
Kishore Nallan
03:52 PM
Can you DM me the cluster ID? I can check the logs quickly.

1

Alex
Photo of md5-faf0fdba0b6739a6706f05c15b6738c6
Alex
03:52 PM
It might be the CPU throttling in typesense, but i am still wondering why our Test server could handle a lot more