This message was deleted.
# community-help
s
This message was deleted.
j
Are you using a built-in ML model for embedding generation?
May I know your batch size as well?
s
Yes I'm using auto-embeddings,batch size is the default size of 40
j
Running ML models on CPU is computationally intensive and so writes will be slow. You would either have to slow down the pace of writes when you see a 503 (which is Typesense’s back pressure mechanism to prevent saturation CPU) or add a GPU to speed up embedding generation
s
Slow down the pace of rights,any suggestions on how can I do that
You can increase the retry interval in the client library to a high number And also reduce the frequency of writes on your side from your application
s
The link says that increasing batch size helps,can I do it like client.collections().documents().import({actioncreate,batch size1000}) Will it not effect the performance as it is written in documentation to try to use the default batch size
j
The code you have above controls server-side batch size which you typically don’t need to modify. I was talking about client-side batching: https://typesense.org/docs/guide/syncing-data-into-typesense.html#handling-rejecting-write-running-out-of-resource-type-errors
For ML models, changing client-side batching will only help to a certain extent
s
Can you please explain what do you mean by client side,do you mean the frontend the frontend or db?
j
The number of documents you send in a single import api call
s
Client.collection().documents().import(action:create,),batchsize will decide the number of documents that are being sent in a single import call?
j
No, you’re missing another parameter for the function which is an array of documents
The number of items in that array of documents is the “client-side” batch size
s
Understood,that was very helpful Jason!Thankyou!!
👍 1