Skip to content

Scaling with blocking io #919

@frede1995-cpu

Description

@frede1995-cpu

Hi!

I wanted to open up a discussion about concurrency. I really want to stay purely in the laravel ecosystem, even for ai. But this topic makes it feel impossible for a mid-large scale production application.
So the core of the question is how does one handle scaling prism with php being blocking io.
I mean even with quite powerful servers just a few handful of concurrent users would mean all threads would be blocked by long running llm calls?
Am i missing something fundamental in my php understanding here or is everyone just accepting this?

Things i can come up to mitigate is:

  1. High num of workers per physical thread and keep mem available for each thread low.
  2. Queue stuff, but then we just end up with a ton of "inefficient" jobs since when they run they will mostly wait.
  3. Does sse handling with yield open up some sort of non-blocking behavior?

Does any old php Yodas have any tricks up their sleeve to make this cpu bound instead of thread count bound?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions