You should use the main buffer_size declared in the storage lib instead of hardcoding a new one: https://github.com/dotcloud/docker-registry/blob/master/lib/storage/__init__.py#L23