[ejabberd] strange stanza size problem w/ "max_stanza_size, infinity"

Badlop badlop at gmail.com
Mon Aug 3 20:18:09 MSD 2009

2009/8/3 Gabriel Rossetti <gabriel.rossetti at arimaz.com>:
> I tried to set "max_stanza_size" to something smaller than 10179 and
> then send a msg that has a size greater than that limit but smaller than
> 10179 and it works, if I the msg is greater than 10179 then it doesn't
> work, is "max_stanza_size" broken?

Not broken. The stanza size calculation is implemented to be efficient
(primary objective) and precise (secondary goal). As it isn't 100%
precise, max_stanza_size is not guaranteed to get the exact size of
each stanza, only an approximation.

The ejabberd Guide 2.0.5 says:

> {max_stanza_size, Size}
> This option specifies an approximate maximum size in bytes of XML stanzas.
> Approximate, because it is calculated with the precision of one block of readed data.

Related links:


max_stanza_size not working in mod_http_bind?

Change direction of rounding when calculating size in xml_stream


More information about the ejabberd mailing list