3 ms·
Isnt the php concurrency story distinctly good, with every request spawning its own process?
by letmeinhere 4y ago
Isnt the php concurrency story distinctly good, with every request spawning its own process?
- colonwqbang 4y agoAnyone can do "concurrency" by starting from scratch with a fresh process each time. That isn't "having a concurrency story" it's rather the opposite I think. It's very wasteful of system resources, energy, etc.
- stevewatson301 4y agoPHPs model would be okay if they used green threads/goroutines. That way, you can have a far larger number of workers, as most of them are blocked on database connections or HTTP requests to other services.
- heurisko 4y agoPHP's model is different, not a mistake. It has proved successful so far. The shared-nothing, short-lived process avoids classes of issues such as with slow memory leaks, accidentally blocking event loops, and shared memory threading issues. Most PHP sites will utilise php-fpm, so it isn't really true that each request will spawn another PHP process. The language historically hasn't been that great, but its shared-nothing architecture has always been the good part.
- weatherlite 4y agoOn the other hand its simple and works for many many people and apps. I wouldn't just discount it. The fact that "Anyone can do" it is a pro.
- dtech 4y agoOnly in the same way that "off" is an excellent TV channel
- tyingq 4y agoThat's not how most typical default php setups work, for quite some time. They do get their own interpreter, but not every request is a fork.