# Uneven load distribution for different value types

**URL:** <https://forums.foundationdb.org/t/uneven-load-distribution-for-different-value-types/489>\
**Category:** Using FoundationDB\
**Created:** [June 5, 2018, 12:44pm UTC](https://forums.foundationdb.org/t/uneven-load-distribution-for-different-value-types/489 "2018-06-05T12:44:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imukhin](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@imukhin](https://forums.foundationdb.org/u/imukhin)\
**Post date:** [June 5, 2018, 12:44pm UTC](https://forums.foundationdb.org/t/uneven-load-distribution-for-different-value-types/489/1 "2018-06-05T12:44:48Z")

</div>

I created a test with values of two types stored in FoundationDB with different key prefixes. Objects of first type occupy 10% of storage space but are processed (read and updated) in 90% of transactions. Objects of second type occupy 10% of storage space but are processed (read and updated) in 90% of transactions. I execute the test over the three nodes cluster with memory storage engine and double redundancy mode.

I see that load is distributed unevenly in the test, e.g. disk utilization per node is 42%, 2% and 54% (i got this from fdbcli status details command). As I understand this is due to that heavily loaded values have the same key prefix and fall to the same partition(s).

So the problem is that nodes of FoundationDB cluster get loaded unevenly if different key types (subspaces) are loaded unevenly. How to resolve this? Everything would be ok if values of different types could be stored in different key/value spaces each independently partitioned across all nodes but FoundationDB has only one such space.

---

<div class="post-metadata">

**Author:** ![Evan](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/evan/32/104_2.png) [@Evan](https://forums.foundationdb.org/u/Evan)\
**Post date:** [June 8, 2018, 7:12am UTC](https://forums.foundationdb.org/t/uneven-load-distribution-for-different-value-types/489/2 "2018-06-08T07:12:16Z")

</div>

Generally, our data distribution algorithm should be able to properly split up hot shards and distribute the evenly across the servers. The algorithm is better at balancing load for larger dataset sizes, because there are more shards to distribute to the storage servers, so if the total amount of data in your database is small that could be contributing to the problem.

You could set the following knobs which control this algorithm to make the bandwidth splitting twice as sensitive, and see if that helps.

shard\_max\_bytes\_per\_ksec=500000000  
shard\_min\_bytes\_per\_ksec=50000000  
shard\_split\_bytes\_per\_ksec=125000000
