[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Protocol](https://evolu.dev/docs/api-reference/common/local-first/Protocol) › ProtocolMessageMaxSize

```ts
const ProtocolMessageMaxSize: between(
  minProtocolMessageMaxSize,
  maxProtocolMessageMaxSize,
)(Int);
```

Defined in: [packages/common/src/local-first/Protocol.ts:344](https://github.com/evoluhq/evolu/blob/113517df8a8da4e4eed41363077878e657b22fca/packages/common/src/local-first/Protocol.ts#L344)

Protocol message maximum size, from 1MB to 100MB.

A message never exceeds its maximum size, inclusive. Builders measure each
write exactly and keep room to close the message (see
[ProtocolMessageBuffer.tryWrite](https://evolu.dev/docs/api-reference/common/local-first/Protocol/interfaces/ProtocolMessageBuffer#trywrite)), and sync sends what does not fit in
later rounds.

Clients send at most [defaultProtocolMessageMaxSize](https://evolu.dev/docs/api-reference/common/local-first/Protocol/variables/defaultProtocolMessageMaxSize) and enforce no
receive limit. A relay can answer with larger messages, configured with the
`totalMaxSize` option of [applyProtocolMessageAsRelay](https://evolu.dev/docs/api-reference/common/local-first/Protocol/functions/applyProtocolMessageAsRelay), to reduce
roundtrips for large syncs. Clients must not send larger messages, because
relays accept at most the default: the Node.js relay closes the connection on
a larger one, and relays up to `@evolu/nodejs` 4.0.0 crash on it.

The default cannot be smaller either. Deployed clients send messages of that
size, a change within [maxMutationSize](https://evolu.dev/docs/api-reference/common/local-first/Evolu/variables/maxMutationSize) fits one message next to the
largest ranges section, and changes saved before that limit existed, which
can be nearly as large as a message, must stay servable.