DiamondLightSource / DiamondLightSource/heliotrapi

Allow proper concurrency on different CPU

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The functions currently run as async functions, but the pod has N CPU's, and N workers. The API shoudl take full advantage of the N cpu's

When a thread crashes it should also no bring down the API.

Two options, use uvicorn --workers 4 and then re-do QueueManager

Or use from concurrent.future import ProcessPoolExecutor.

There are options

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the API's QueueManager and current async worker entry points. Compare the issue's two proposed approaches—uvicorn workers or concurrent.futures.ProcessPoolExecutor—and determine how worker failures are isolated. Done means the API uses the available CPUs for concurrent jobs without a worker crash bringing down the API.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.