E
E
Edward2018-03-13 13:54:05
PHP
Edward, 2018-03-13 13:54:05

What is the best way to make asynchronous functionality on a ready-made site?

Hello. Now I'm building a website using yii2.
Initially, it was a simple site for convenient storage / display of information, but now there is a need to create additional functionality like a real-time chat, there is also an analogue of the lobby search as in online games, as a result, when searching, you have to hammer the site with ajax requests and each time the request is executed which finds five users (if they meet the criteria) in the lobby and all this happens every second from each participant in the lobby ( so maybe it's worth making a daemon in PHP? ) , I think that if there is a large influx of users, performance problems will begin. I'm starting to understand that php is not suitable for such moments. Therefore, in the plans: for the chat, put redis + socket.io, but with the lobby search, I don’t even know how best to do it, as an option, then rewrite the entire site completely on node.js with its asynchrony.
I suppose that it would be better to make some part of the functions on node, and link it with yii. In this regard, I would like to know your opinion, is it used or even possible somewhere.

#UPD: The issue with chat and notifications is resolved, but not with the lobby.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor, 2018-03-13
@Levhav

Look at my project of a ready-made comet server https://comet-server.com/ judging by the description, it should suit you here is an article about adding real time functions https://habrahabr.ru/post/341662/ to the finished site.

B
bezdealnick, 2018-05-13
@bezdealnick

Faced exactly the same situation. We use centrifugal and know no problems. Holds quietly 2-3k online. There have been no more.

S
Sergey, 2018-03-14
@begemot_sun

Learn Erlang.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question