Skip to content

Support using inotify with --reload #1368

Closed

Description

@mark-adams

--reload is a very useful option when debugging and working on an application. However, in some situations (such as running gunicorn inside of a VM or a Docker container on Mac with host mounted directories), the current file polling method can cause high CPU load due to the overhead of dealing with a virtualized filesystem.

Many of these filesystems now have support for the kernel's inotify API which allows applications to monitor for filesytem events instead of polling. This is much less resource intensive and can improve CPU usage of the Reloader in many situations. It would be nice to either have gunicorn support inotify by default (on supporting platforms) or via an extra argument.

Activity

  1. added 4 commits that reference this issue on Oct 14, 2016
    6f9fd94
    8f072bc
    b7b242f
    fb361f5
  2. benoitc commented on Oct 16, 2016

    @benoitc
    Owner

    good idea :)

    Can you send us a PR? Looking at your patch I would prefer to set it by augmenting the current setting: --reload=inotify . So we don't introduce another setting.

  3. added 2 commits that reference this issue on Oct 18, 2016
    261eb65
    64b26ef
  4. elliotbay22 commented on Nov 4, 2016

    @elliotbay22

    Hey, I just happened upon this as something I'd like for my development flow too. When should I expect this will be available on pip?

  5. mark-adams commented on Dec 8, 2016

    @mark-adams
    ContributorAuthor

    Just wanted to follow-up @benoitc, do you have an estimate on when the next gunicorn release will happen that will include these changes?

  6. benoitc commented on Dec 10, 2016

    @benoitc
    Owner

    @mark-adams there is 1-2 patch to add to this release but there is no reason it can't be done next week.

  7. elliotbay22 commented on Jan 13, 2017

    @elliotbay22

    Ping! I keep finding that this would be useful to me, but I'd rather not cut myself off from pip to patch the implementation myself.

  8. mark-adams commented on Jan 19, 2017

    @mark-adams
    ContributorAuthor

    @benoitc I hope I'm not being a bother, but I wanted to follow-up on a release containing this version. Is there any way that I can get my hands dirty and help move us towards a release?

  9. berkerpeksag commented on Jan 19, 2017

    @berkerpeksag
    Collaborator

    @mark-adams I think #1422 is the only blocker for a new release at the moment. You could help us to review #1430 :)

  10. mark-adams commented on Jan 19, 2017

    @mark-adams
    ContributorAuthor

    Just left a comment. Thanks @berkerpeksag

  11. added a commit that references this issue on Mar 16, 2018
    7157005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions