# HTTP endpoint insert size

**URL:** https://community.cratedb.com/t/http-endpoint-insert-size/2029
**Category:** CrateDB
**Created:** [May 13, 2025, 2:32pm UTC](https://community.cratedb.com/t/http-endpoint-insert-size/2029 "2025-05-13T14:32:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![djbestenergy](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@djbestenergy](https://community.cratedb.com/u/djbestenergy)
#### Post date: [May 13, 2025, 2:32pm UTC](https://community.cratedb.com/t/http-endpoint-insert-size/2029/1 "2025-05-13T14:32:53Z")

</div>

Hi  
Does anyone know when using the http endpoint, if its more efficient for a 3 node crate cluster to accept more bulk data infrequently or smaller bulk data with more frequent insertions.  
So for instance I might insert 242 rows totalling 326KB, compared to 30 rows at 3.5KB.

I just want to see if I can fine tune our ingestion, to work better with the CrateDB cluster.

Many thanks  
David

---

<div class="post-metadata">

### Author: ![karynsaz](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/karynsaz/32/611_2.png) [@karynsaz](https://community.cratedb.com/u/karynsaz)
#### Post date: [June 12, 2025, 1:59pm UTC](https://community.cratedb.com/t/http-endpoint-insert-size/2029/2 "2025-06-12T13:59:16Z")

</div>

Hi David,

In general, we would recommend testing with different batch sizes to check the performance for your specific workload. Sometimes you can even make it more flexible by using the monitoring data of your cluster to reduce/increase the batch size according to the resources available.

For your specific case, we don’t see a meaningful difference between 30 rows vs 242 rows since both are still pretty much in the same order of magnitude. In general, we would advice avoiding many small batches to prevent the repeated query parsing, planning, etc.

Depending on your use case, it is understandable to have such small batches to simulate a continues data stream by batching data that arrives in a second interval, for instance. Or even just to keep the insert computational cost low (which would be the case with both 30 or 242 rows).

Have you observed a big performance difference between the batch sizes? Feel free to share further details so we can work on a more tailored answer.

Lastly, there is a nice tip about choosing the batch size here: [DataFrame operations - SQLAlchemy Dialect](https://cratedb.com/docs/sqlalchemy-cratedb/dataframe.html#efficient-insert-operations-with-pandas)

Thank you,  
Karyn

---

<div class="post-metadata">

### Author: ![amotl](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/amotl/32/617_2.png) [@amotl](https://community.cratedb.com/u/amotl)
#### Post date: [June 12, 2025, 2:06pm UTC](https://community.cratedb.com/t/http-endpoint-insert-size/2029/3 "2025-06-12T14:06:09Z")

</div>

Hi David,

thank you for writing in. I’d like to second what Karyn said.

> [@djbestenergy](#):
>
> So for instance I might insert 242 rows totalling 326KB, compared to 30 rows at 3.5KB.

When reading those particular numbers, I think you should experiment with much larger batch sizes, of course also depending on the “width” of the records in your dataset.

Citing a particular spot from the document referenced by Karyn conveys the very gist in this regard:

> [@amotl](#):
>
> It is a good idea to start your explorations with a chunk size of 5\_000, and then see if performance improves when you increase or decrease that figure. People are reporting that 10\_000-20\_000 is their optimal setting, but if you process, for example, just three “small” columns, you may also experiment with [leveling up to 200\_000](https://acepor.github.io/2017/08/03/using-chunksize/), because [the chunksize should not be too small](https://acepor.github.io/2017/08/03/using-chunksize/). If it is too small, the I/O cost will be too high to overcome the benefit of batching.

I think using either 30 or otherwise 242 records per batch is a too small number to make any significant difference.

With kind regards,  
Andreas.
