Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-777

Specify max_requests in gunicorn configuration

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • quay
    • None
    • Quay
    • Red5 [Quay 185]
    • 0

      Gunicorn offers a configuration variable `max_requests` which affectively kills a given worker after a certain number of requests. Implementing this should allow us to ensure that resources and locks are periodically cleaned up and no particular process is running for longer than necessary.

      Documentation:
      https://docs.gunicorn.org/en/stable/settings.html?highlight=bind#max-requests

      Any value greater than zero will limit the number of requests a worker will process before automatically restarting. This is a simple method to help limit the damage of memory leaks.

      While the documentation specifically calls out memory (which I have seen in another large project when dealing with memory fragmentation in cPython) – my hope is that this will help to better release database connections periodically in case there are bugs which may affect our database connection pooling.

      Since we do not know how many requests should reasonably be served before restarting, and we do not know how often is a reasonable amount of time between worker restarts, this value should be configurable. A sane default would also be useful to determine.

            kmullins@redhat.com Kurtis Mullins (Inactive)
            kmullins@redhat.com Kurtis Mullins (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: