[erlang-patches] Allow mod_esi:deliver/2 to handle binary data

Niclas Axelsson <>
Thu Feb 24 16:56:10 CET 2011

On 02/23/2011 05:59 AM, Bernard Duggan wrote:
> Hi all,
>     We've been using mod_esi to deliver binary files over HTTP.  In 
> testing, some particularly large files were thrown at it and we ended 
> up exhausting the VM's memory and crashing it.  The ultimate problem 
> is that mod_esi:deliver/2 is asynchronous, so there's no way to know 
> how fast or slowly to feed it data to avoid the target process' queue 
> getting too big.  That's a bit of a trickier problem than I could 
> quickly deal with (not least because it would require an interface 
> change/addition).
>     Instead, to mitigate the problem I've made a small change which 
> allows mod_esi:deliver/2 to take binary data, rather than forcing the 
> caller to convert it to a list first (and thus avoiding both the 
> conversion cost and the copy cost as the list is passed between 
> processes).
> You can grab it with
> git fetch git://github.com/bernardd/otp.git mod_esi_binary
> Cheers,
> Bernard
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
Thanks Bernard,

Your patch have been merged to 'pu'.

Niclas Axelsson, Erlang/OTP

More information about the erlang-patches mailing list