# Throughput of StreamingMode.WANT\_ALL vs. ITERATOR on large payloads

**URL:** <https://forums.foundationdb.org/t/throughput-of-streamingmode-want-all-vs-iterator-on-large-payloads/5158>\
**Category:** Development\
**Tags:** performance\
**Created:** [December 31, 2025, 10:43am UTC](https://forums.foundationdb.org/t/throughput-of-streamingmode-want-all-vs-iterator-on-large-payloads/5158 "2025-12-31T10:43:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexey](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@alexey](https://forums.foundationdb.org/u/alexey)\
**Post date:** [December 31, 2025, 10:43am UTC](https://forums.foundationdb.org/t/throughput-of-streamingmode-want-all-vs-iterator-on-large-payloads/5158/1 "2025-12-31T10:43:18Z")

</div>

Hello,

I’m looking at the implementation of two streaming modes in [fdb\_c.cpp](https://github.com/apple/foundationdb/blob/main/bindings/c/fdb_c.cpp#L592): `WANT_ALL` and `ITERATOR`. While `WANT_ALL` is generally recommended by the documentation for complete extraction of the desired range at maximum throughput, practically it is less performant than `ITERATOR` on payloads ~ \>= 1.6MiB.

Unless I understand it wrong, in the following code the last “state” of iteration\_progress is 1.5 times bigger than what `WANT_ALL` is configured with (120000 \> 80000). Which means that after a series of iterations an accumulated throughput of the `ITERATOR` will exceed the one provided by `WANT_ALL`. In theory this should happen when the total extracted payload exceeds 1.6 MiB mark. This behavior was introduced by [4416](https://github.com/apple/foundationdb/pull/4416).

**My question is** : if I understand it right, shouldn’t target\_bytes for `WANT_ALL` be assigned 120k as well?

```cpp
	/* _ITERATOR mode maps to one of the known streaming modes
	   depending on iteration */
	const int mode_bytes_array[] = { GetRangeLimits::BYTE_LIMIT_UNLIMITED, 256, 1000, 4096, 80000 };

	/* The progression used for FDB_STREAMING_MODE_ITERATOR.
	   Goes 1.5 * previous. */
	static const int iteration_progression[] = { 4096, 6144, 9216, 13824, 20736, 31104, 46656, 69984, 80000, 120000 };

```

---

<div class="post-metadata">

**Author:** ![Semisol](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/semisol/32/1960_2.png) [@Semisol](https://forums.foundationdb.org/u/Semisol)\
**Post date:** [December 31, 2025, 10:58am UTC](https://forums.foundationdb.org/t/throughput-of-streamingmode-want-all-vs-iterator-on-large-payloads/5158/2 "2025-12-31T10:58:38Z")

</div>

I believe your understanding is correct and that is an oversight.

But, if you know your workload, I would strongly recommend that you use EXACT with a custom byte or row limit that can be tuned to your application.

---

<div class="post-metadata">

**Author:** ![alexey](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@alexey](https://forums.foundationdb.org/u/alexey)\
**Post date:** [January 5, 2026, 11:07am UTC](https://forums.foundationdb.org/t/throughput-of-streamingmode-want-all-vs-iterator-on-large-payloads/5158/3 "2026-01-05T11:07:25Z")

</div>

Created [12616](https://github.com/apple/foundationdb/pull/12616).
