[sheepdog] [PATCH RFC 0/5] sockfd shrinking mechanism for handling EMFILE

Liu Yuan namei.unix at gmail.com
Sun Jul 14 07:43:52 CEST 2013


On Fri, Jul 12, 2013 at 10:54:21AM +0900, Hitoshi Mitake wrote:
> This patchset implements a mechanism for shrinking cached fds in
> sockfd subsystem for handling EMFILE gracefully. With this mechanism,
> sheep can retry creating a new fd after it faces EMFILE. In this
> patchset, some invocations of retrying are inserted into various
> operations which can create new fds.
>

I think we should try to shrink at the time sockfd_cache_put() is called too.
This is indirect shrink and shink at the time of EMFILE is direct shrink. I
think indirect shrink should be implemented first. This will reduce the long
connections for idle sheep.

Thanks
Yuan

> 
> Clearly, there is a big room for discussion. We can implement a
> smarter algorithm for shrinking and there would be a better policy for
> retrying. I'd like to hear your comments.
> 
> Hitoshi Mitake (5):
>   sheep: add nid_to_str() for formatting node id from sockfd subsystem
>   sockfd: implement shrinking mechanism for handling EMFILE
>   tests/dynamorio: add a new DR based tester for EMFILE handling
>   sheep: replace open() with retry_open()
>   sheep: retry when connect() or accept() fails with EMFILE
> 
>  include/sheep.h                       |   11 ++--
>  sheep/md.c                            |    2 +-
>  sheep/object_cache.c                  |    8 +--
>  sheep/plain_store.c                   |    6 +--
>  sheep/request.c                       |    7 +++
>  sheep/sheep_priv.h                    |    2 +
>  sheep/sockfd_cache.c                  |   90 +++++++++++++++++++++++++++++++++
>  sheep/store.c                         |    2 +-
>  tests/dynamorio/emfile/01.sh          |   24 +++++++++
>  tests/dynamorio/emfile/CMakeLists.txt |    9 ++++
>  tests/dynamorio/emfile/emfile.c       |   46 +++++++++++++++++
>  11 files changed, 195 insertions(+), 12 deletions(-)
>  create mode 100755 tests/dynamorio/emfile/01.sh
>  create mode 100644 tests/dynamorio/emfile/CMakeLists.txt
>  create mode 100644 tests/dynamorio/emfile/emfile.c
> 
> -- 
> 1.7.10.4
> 
> -- 
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog



More information about the sheepdog mailing list