# Limits on Mender Inventory Size

**URL:** <https://hub.mender.io/t/limits-on-mender-inventory-size/7382>\
**Category:** General Discussions\
**Tags:** mender-client, inventory\
**Created:** [December 12, 2024, 2:56am UTC](https://hub.mender.io/t/limits-on-mender-inventory-size/7382 "2024-12-12T02:56:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nomtor0204](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/nomtor0204/32/2355_2.png) [@nomtor0204](https://hub.mender.io/u/nomtor0204)\
**Post date:** [December 12, 2024, 2:56am UTC](https://hub.mender.io/t/limits-on-mender-inventory-size/7382/1 "2024-12-12T02:56:23Z")

</div>

Hello,

Are there any limits on the size of inventories that can be sent to the Mender server?

On one particular device, I encountered an issue where an inventory with tens of thousands of characters could not be sent. For example:

```auto
key_name=AAAAAAAAAA...AAA (tens of thousands of characters)

```

I would like to confirm if there are any specifications regarding inventory size.

I reviewed [the Inventory document](https://docs.mender.io/client-installation/inventory), but we did not find any information about inventory size limits.

Any guidance on this matter would be greatly appreciated. Thank you very much.

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 12, 2024, 2:56pm UTC](https://hub.mender.io/t/limits-on-mender-inventory-size/7382/2 "2024-12-12T14:56:03Z")

</div>

Hi @nomtor0204,

The scope of a key-value pair is currently limited to 1024 characters. Is there a specific use case that you want to tackle?

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![nomtor0204](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/nomtor0204/32/2355_2.png) [@nomtor0204](https://hub.mender.io/u/nomtor0204)\
**Post date:** [December 17, 2024, 6:27am UTC](https://hub.mender.io/t/limits-on-mender-inventory-size/7382/3 "2024-12-17T06:27:16Z")

</div>

Hi @TheYoctoJester ,

Upon investigation, it appears that in Mender-client 3, the buffer size used for parsing inventories is set to 64KB, effectively limiting the size of inventory data that can be sent to 64KB.

The following source code shows that the buffer created by `bufio.NewScanner` is 64KB:

> <https://github.com/mendersoftware/mender/blob/0e326002fc2d013cd7f44650b99068cbddf83540/utils/kvparser.go#L37>

When calling the Mender API’s Assign Attributes directly or using Mender-client 4, it was possible to send inventories larger than 64KB. This suggests that the 64KB restriction applies only to Mender-client 3.

In our case, we needed to send inventories exceeding 64KB using Mender-client 3. We addressed this by patching the Mender-client to increase the allowable inventory size.

Just wanted to let you know as a quick update.

Best Regards,  
Ryo
