Skip to content

Granian + free-threaded python #22209

@mvdbeek

Description

@mvdbeek

Support for PEP 703. Information on https://py-free-threading.github.io/

PYTHON_GIL=0 PYTHONPATH=lib \
GALAXY_CONFIG_FILE=config/galaxy.yml \
GALAXY_CONFIG_OVERRIDE_DATABASE_CONNECTION="postgresql+psycopg://localhost/galaxy" \
granian --interface asginl \
--host 127.0.0.1 --port 8090 \
--workers 6 \
--runtime-threads 2 \
--factory \
'galaxy.webapps.galaxy.fast_factory:factory'

works with a little bit of dependency tweaking:

  • I stubbed out orjson, which will probably support free-threading for python 3.15
  • switch to psycopg3 (a good thing to do anyway)
  • and of course building everything that doesn't have free-threaded wheels

In theory this should allow for better CPU utilization, concurrency (to be benchmarked), without having to resort to gunicorn's --preload or over-allocating memory. I'm also interesting in seeing how well the backpressure controls work.

We should explore making (threaded) granian our (default) server for CI tests and add granian as an option to gravity.

Packages missing free-threaded builds:

Packages with problematic dependencies:

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