strapi-plugin-meilisearch icon indicating copy to clipboard operation
strapi-plugin-meilisearch copied to clipboard

Add a debounce/throttle on document addition

Open bidoubiwa opened this issue 2 years ago • 0 comments

Description Strapi has not a lot of ways to add documents in batches. Most ways to achieve entry addition is one by one. While it is not a problem with a small number of document addition, if a user add's thousands of document at the time the web-server starts to reject new webserver calls, or abort new additions to its own database.

Error: aborted
262: aborted
Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

Another issue is that Meilisearch does not like at all to have small batches. Meilisearch is more performant with one addition of 100Mo of document than it is with 10000 additions of 1 document.

To avoid this, we should create a debounce system or a throttle system that avoid an overload of calls to meilisearch.

bidoubiwa avatar Apr 28 '22 16:04 bidoubiwa