Skip to content

Commit

Permalink
fix: reduce gunicorn concurrency to at most 4 * maximum available cor…
Browse files Browse the repository at this point in the history
…e count
  • Loading branch information
garethgeorge committed Jul 10, 2023
1 parent a8db1c0 commit 9857089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions_framework/_http/gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# limitations under the License.

import gunicorn.app.base

import os

class GunicornApplication(gunicorn.app.base.BaseApplication):
def __init__(self, app, host, port, debug, **options):
self.options = {
"bind": "%s:%s" % (host, port),
"workers": 1,
"threads": 64,
"threads": (os.cpu_count() or 1) * 4,
"timeout": 0,
"loglevel": "error",
"limit_request_line": 0,
Expand Down

0 comments on commit 9857089

Please sign in to comment.