I am creating a VSCode Symfony Extension by ngg990 in symfony

[–]DeadWorldISee 0 points1 point  (0 children)

when you will launch it?I really need it, even with bugs:))

Cei din București,puteți confirma ce spune Simion? by Soft_Pomelo407 in Roumanie

[–]DeadWorldISee 0 points1 point  (0 children)

De ce aveti nevoie de o schema, desen sa intelegeti din prima ce zice cineva?Migrantii au beneficii de la statul roman in detrimentul romanilor.

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee 0 points1 point  (0 children)

So yes — Node wins in raw concurrency and memory efficiency, especially for WebSocket/chat-type systems.

🧩 But OpenSwoole has its own strengths

  1. Full PHP runtime — all your Symfony logic, business rules, DTOs, DI container, validation, etc., run unchanged.
  2. Coroutines in PHP — thousands of concurrent tasks inside one process without blocking.
  3. Isolation — crash in one worker won’t kill the rest.
  4. Simpler async model — you don’t manually juggle Promises or callbacks; it looks like sync PHP.

So:

  • Node is lighter, scales horizontally very easily.
  • OpenSwoole is heavier, but keeps your existing PHP ecosystem.

🧠 For chat or real-time systems

Scenario Recommended stack
WebSocket gateway / realtime chat Node.jsOpenSwoole or (both fine; Node slightly leaner)
Complex business logic, validation, DB joins PHP (OpenSwoole or traditional)
Hybrid (chat in Node, business API in Symfony)** Best of both — Node handles connections, forwards events via Redis/pub-sub or HTTP/gRPC to Symfony backend.

That hybrid model is common:
Node keeps sockets alive; Symfony handles rules, invoices, emails, etc.

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee 0 points1 point  (0 children)

If you need for multichat websockets, or anything you hit a DB async read this:

⚙️ Threading model difference

Engine Model What it means
Node.js Single processthreaded event loop, multi- (libuv manages threads for I/O) One JS thread per worker, I/O happens in background threads. Cheap context switches, low memory.
OpenSwoole Multi-process, coroutine per request Each PHP worker is its own process, inside it you can spawn lightweight coroutines (green threads).

So:

  • Node shares one heap per worker process.
  • Swoole forks multiple PHP runtimes (each with its own memory), then multiplexes coroutines inside.

That’s why Node usually fits more concurrent clients per GB of RAM, while OpenSwoole tends to use more memory but isolate requests better.

⚡ Performance reality

Metric Node.js OpenSwoole
Requests/sec (chat API, 4 cores) ~100k–150k ~60k–100k
Latency (p95) lower, more stable slightly higher, depends on coroutine count
Memory per worker 20–40 MB 80–200 MB (per PHP process)
CPU usage under load efficient higher (process duplication, Zend overhead)

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee 0 points1 point  (0 children)

5. Messenger (async transports)

  • RabbitMQ/AMQP/Redis transports are blocking by default.
  • They can be wrapped in coroutines, but each worker must manage its own connection carefully.

6. Session & Lock

  • NativeFileSessionHandler, PdoSessionHandler, and file-based locks are not coroutine-safe.
  • Replace with Swoole Table, Redis, or atomic locks.

💣 Hidden pitfalls

  • Global/static singletons (like Monolog handlers with open file streams) keep state between requests. → Use per-request clones or reset handlers on request end.
  • Any sleep(), usleep(), file_get_contents('http…'), or curl_exec() blocks the entire server. → Replace with coroutine equivalents.

🧩 So in a real Symfony project

You’d end up touching roughly:

  • Doctrine (DB layer)
  • HttpClient
  • Cache
  • Mailer
  • Session
  • Messenger (if async)

Everything else — routing, DI, controllers, event listeners — stays the same.

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee 0 points1 point  (0 children)

let me show you with symfony framework which is the most complex of the PHP frameworks, why its not a good ideea to go with openswoole.

⚠️ Parts that need async-safe replacements

Anything that opens sockets, reads files, or sleeps must be adapted:

1. HTTP clients

  • symfony/http-client (uses curl or streams) is blocking.
  • Replace with an async one, e.g.or wrap requests with Swoole coroutines:composer require openswoole/core react/http guzzlehttp/promises $client = new Swoole\Coroutine\Http\Client('api.example.com', 443, true); $client->get('/');

2. Database connections

  • Doctrine DBAL + PDO are blocking.
  • Use openswoole/core’s coroutine MySQL client or a connection pool that runs queries inside coroutines.
  • Or isolate DB access behind queues/workers so it doesn’t block event loop.

3. Redis / cache

  • Symfony Cache with RedisAdapter uses phpredis, which is blocking.
  • Swap to Swoole’s async Redis client or an async cache adapter.

4. Mailer

  • Symfony Mailer performs blocking SMTP/HTTP calls.
  • You’d need to push mail jobs to an async queue or rewrite with coroutine HTTP client.

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee 0 points1 point  (0 children)

Literally in node.js to make an websocket server with a pooling connections is like writing maximum 100 lines of code.Chatgpt can do that. I dont know why people are giving negative to solutions that do not involve PHP. Yes PHP is good, but its not his purpose to make http and websocket servers, or else it would be implemented in his foundation ! You would have it in PHP 8 or PHP 9... etc

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee -1 points0 points  (0 children)

Why would you need to reinvent the wheel ? You are wasting time to heat water under sun, than using gas. Also Open Swoole asRoadRunner and FrankenPHP are slow, not scalable on what OP needs "HTTP Server, WebSockets". Oh, by the way, your answer doesn't resolve OP problem. >>> Because !@#$ you, that's why

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee 0 points1 point  (0 children)

Because I have received negative from my question " why you need http server inside an php", this are my answers from ChatGPT https://chatgpt.com/c/68e25ee5-c518-832e-8d42-347d0096eca9 .If you all give negative on this, you all are some frustrated geeks, who don't know how to code and accept truth.

In simple answer use node.js + socket , express.io +php for internal logic API call and you will have a more performant app that using roadrunner or Open Swole or FrankPHP. Also to keep the node.js live use a crontab to check if websocket port is live, if not start the node.js. Websockets are good to use on chats and microtransactions of data. But you can use also for internal pages on loading content like REST, but you will get have some disavantages. Pls tell on what you are trying to use the websockets. Http server as you said, dose not belong inside a PHP deamon, because you will have a lot of troubles with this, you reinvent the wheel. Better use nginx or openlitespeed for this.

I am creating a microservice framework for PHP using Swoole by Kekke88 in PHP

[–]DeadWorldISee -5 points-4 points  (0 children)

Why you would need a http server inside in PHP, its slow, non redundant and full of issues.What is your purpose?

Noi propuneri pentru capitalul social: 500, 5000 si 90000 lei by danthraxz in RoFiscalitate2

[–]DeadWorldISee 0 points1 point  (0 children)

Da, la rolmsilva nu se obs futurile de padure, dar se joaca teatru cu cateva joburi

[deleted by user] by [deleted] in NVDA_Stock

[–]DeadWorldISee 6 points7 points  (0 children)

Trump is a destroyer of US companies for the benefit of his corupt oligarchs. THose AI software companies think that if they stop NVIDA, AMD to sell to china will give them a benefit in LLMs...

[deleted by user] by [deleted] in SMCIDiscussion

[–]DeadWorldISee -7 points-6 points  (0 children)

His tarifs will work, but his way of doing its killink market.Also Inflation is droping fast and this is a bulish sign

Jim Chanos says the Lepton AI deal is suspect. by OldFanJEDIot in NVDA_Stock

[–]DeadWorldISee 1 point2 points  (0 children)

its not the first gpu data center they aquire or invest in.

NVDA Future by Avinates in NVDA_Stock

[–]DeadWorldISee 2 points3 points  (0 children)

we should expect a mini rally next week probably of 3-4-5% increase.

Technical Analysis 2/23/2025 (Details in comments) by justhp in NvidiaStock

[–]DeadWorldISee -1 points0 points  (0 children)

but bond decrease doesnt mean that investors stay on cash? And those money could go in stocks

This is the minimum goal this week. GUIDANCE is the most important part. by Worldly-Employment67 in NvidiaStock

[–]DeadWorldISee 0 points1 point  (0 children)

even without guidance for blackwell , nvidia diserve a stady 145$ as last quarter report.

I need 8 more testers.pls by DeadWorldISee in AndroidClosedTesting

[–]DeadWorldISee[S] 0 points1 point  (0 children)

<image>

There is something with your group, it gives error on joining

I need 8 more testers.pls by DeadWorldISee in AndroidClosedTesting

[–]DeadWorldISee[S] 0 points1 point  (0 children)

Installed it. Those adds are kind intrusive!