Confusion about multiprocess and asyncio in sanic

hi, dear. i have a confusion about multiprocess and asyncio in sanic.
below are simplified code , workers=2:

from sanic import Sanic
app = Sanic("test")

@app.get("/video_stream")
async def hello_world(request):
    response = await request.respond()
    await mjpeg(response)

async def mjpeg(response):
    ...
    # condition 2:  await asyncio.sleep(0.01)
    await response.write(...)
    
if __name__ == "__main__":
    app.run(workers=2)
  1. I try to open 4 video_stream:
    only 2 run successful respectively in (SpawnProcess-0,SpawnProcess-1) ,
    the other 2 video_stream are unreachable .

  2. I add await asyncio.sleep(0.01) in mjpeg and try to open 4 video_stream:
    all 4 video_stream will run successful , but all in one process !

how can i balance it?

That’s an OS level operation that Python does not control. Moreover, exactly how probably differs from OS to OS.

you are right , i run the same code in other computer . just come with different result