Container close directly because OpTooLarge
Describe the bug
After upgrade to "fluid-framework": "1.3.4" and "@fluidframework/azure-client": "1.0.3" in our project, our console will throw an error about 'OpTooLarge' and then the container is closed forcely.
To Reproduce
Steps to reproduce the behavior:
- Using "fluid-framework": "1.3.4" and "@fluidframework/azure-client": "1.0.3" in an angular 14 project
- Create a container that connects to the fluid relay service
- Update a change, about 850KB, to the shared map
- Then the console throw an error to indicate the 'OpTooLarge' issue because the upper limit around 750KB
Expected behavior
Previously, the large change could be handled by fluid even though it take time to sync to other clients. We are curious about the following: Is this limit introduced since the latest stable release? If yes, under what consideration to introduce it? If yes, should we add documents to elaborate about it?
Logs

I am having similar issues with the above mentioned fluid version. In my case, I am trying to upload ~160kb of data. Would appreciate if someone could thrown some light on this issue.
We are seeing similar issue in this fluid version.
I grouped a bunch of related bugs / discussions under https://github.com/microsoft/FluidFramework/issues/9023 EPIC - please take a look to learn why these issues are happening.
In short, the limit for a single message on the socket is 1Mb. It's easy to hit it because of number of reasons:
- JSON.serialize is run on strigified content, so there is a lot of overhead due to escaping.
- ops produced as part of synchronous code execution are batched together and sent as a batch, which is one message on socket. So many ops produced in one operation can trip the limit.
- Issue can show up as direct error like mentioned above, or infinite reconnects (if it does not exceed our size checks, but after socket.io overhead it's above 1Mb).
We are addressing these issues in 2.0 - main would contain already substantial improvements, more on the way:
- We implemented compression of content. All content in a batch of ops is grouped together and compressed. This is not a fix, but rather a mitigation - substantially larger payloads (up to 10-20Mb) would go through that way.
- On top of that we implement chunking. A single op (including after compression) is split into number of smaller ops and such ops are sent one by one, thus being below 1Mb limit. This almost addresses the issue. I say almost, as op envelope is large, and ordering service adds its own properties to it, thus potentially hitting 1Mb Kafka limit in service.
- On top of that, we are implementing op virtualization. 1000 ops send on synchronous stack (and thus part of the batch) will be represented as a single op in protocol, thus substantially reducing the cost of op envelopes. This work is in progress and should complete before 2.0 is released.
We are not planning to port any of this work to 1.0 builds. As a workaround, I'd suggest trying a number of things:
- Reduce op payload, if possible.
- Reduce number of ops generated on a single synchronous stack. If correctness of your application is not compromised, break the work into smaller chunks that are run async.
@andre4i , can you please add some PR references for the work that has been completed? Thanks!
Hello,
https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/src/opLifecycle/README.md has some information about how the compression and chunking mitigation works.
these are the relevant PRs which have been merged as of today:
- https://github.com/microsoft/FluidFramework/pull/14856
- https://github.com/microsoft/FluidFramework/pull/13329
- https://github.com/microsoft/FluidFramework/pull/12833
Not that these features are available by default in 2.0.0-internal.4.1.0 (upcoming) and are available (but opt-in) starting client_v2.0.0-internal.2.3.0 (instructions to enable them can be found at https://github.com/microsoft/FluidFramework/blob/release/v2int/3.2/packages/runtime/container-runtime/src/opLifecycle/README.md).