Skip to content

Commit

Permalink
Add uvloop as the the Gunicorn worker eventloop
Browse files Browse the repository at this point in the history
closes pulp#6021
  • Loading branch information
pedro-psb committed Nov 19, 2024
1 parent 378373a commit 3aa2307
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pulpcore/content/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class PulpcoreContentApplication(PulpcoreGunicornApplication):
def load_app_specific_config(self):
self.set_option("default_proc_name", "pulpcore-content", enforced=True)
self.set_option("worker_class", "aiohttp.GunicornWebWorker", enforced=True)
self.set_option("worker_class", "aiohttp.GunicornUVLoopWebWorker", enforced=True)

def load(self):
import pulpcore.content
Expand All @@ -15,6 +15,11 @@ def load(self):

@click.option("--bind", "-b", default="[::]:24816")
@click.option("--workers", "-w", type=int)
@click.option(
"--worker-class",
"-k",
type=click.Choice(["aiohttp.GunicornWebWorker", "aiohttp.GunicornUVLoopWebWorker"]),
)
# @click.option("--threads", "-w", type=int) # We don't use a threaded worker...
@click.option("--name", "-n", "proc_name")
@click.option("--timeout", "-t", type=int)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dependencies = [
"tablib<3.6.0",
"url-normalize>=1.4.3,<=1.4.3",
"uuid6>=2023.5.2,<=2024.7.10",
"uvloop>=0.21.0,<0.22",
"whitenoise>=5.0,<6.9.0",
"yarl>=1.8,<1.17.3",
]
Expand Down

0 comments on commit 3aa2307

Please sign in to comment.