PHP: Use Golang to Handle Website Connections

I have a fairly large build of web applications with SproutCore and PHP as the backend. Now I want to use websockets to update my client application in real time. From what I know, PHP does a really poor job of persistent connections. Therefore, I thought that I could use Go to process connections to web connections and call my PHP scripts every time a request is received (this package seems to allow).

So my first question is: do you guys think this is a good idea (and a viable idea, I couldn't find such people), or should I stick with PHP?

If I use Go to handle web socket connections, I also thought that I could gradually move away from PHP to use Go (since it is much faster than PHP). If I do this, I will need to call some Go package from PHP. Can this be done using a PHP function exec? Is there a better way? And again, is this a good idea?

+5
source share
2 answers

Go is a natural fit for websocket servers. I created websocket servers in Go and was very pleased with how it all worked out. I have one service that processes 300 thousand users per month on the Go web server server, and it barely uses a 1% Amazon AWS micro-instance processor. Could not be happier.

Websockets , , Go Node.js. -, PHP, , , .

- Go PHP, API. exec .

+9

, ...

php, , - websockets. Ratchet. node.js( ) , php , , . - .

, Ratchet:

-1

All Articles