twitter/twemproxy — pull request #8 by bmatheny (2012-07-31 18:43:51+00:00)
Title: item_size_max support

This patch causes object sizes to be checked before forwarding the request to the appropriate server. If the object is larger than this value (defaults to 1048576), the proxy closes the connection (which is also what memcached does). The proxy does NOT respond with a SERVER_ERROR, mostly because I couldn't determine a reasonable way to do that from the req_filter.

In a number of client libraries, compression occurs within the library and so you don't know whether a value exceeds the maximum object size until after it leaves this client. This allows you to pass 'large' items into a client method but not send the request across the wire if it would fail.