Using php + gearman + node.js

I am considering creating a site using php, but there are several aspects of it that will work much better if they are made in node.js. At the same time, a significant part of the site should remain in PHP. This is due to the fact that many features have already been developed in PHP, and reprofiling, testing, etc. It would be too big, and frankly, these parts of the site work fine in PHP.

I am considering rebuilding partitions in node.js that will benefit from running most of it in node.js, and then PHP will pass the node.js request using Gearman. This way I scan the scale by running more workers and the gear handler will handle the load balancing.

Our site is receiving a lot of traffic, and it bothers me if the gearman can handle this load. I do not want this question to be productive, so let me focus mainly on the following address points:

  • Can a gearman handle all our expected load, assuming we have memory (maybe about 3000+ jobs in the queue for a while, with several thousand being processed per second)?
  • Would this work better if I just passed node.js requests using CURL, and if so, then node.js provides any way to distribute the load across multiple instances of this script?
  • Is it possible to adjust the gearbox so that there is no single point of failure?
  • What are some of the problems you guys see as arising both in terms of development and scaling?

, , , , .

, , , - .

: , gearman, - - , - .

+5
2

Gearman:

gearman , , (, 3000+ , )?

:

Long: . , . Gearman . , , Gearman, .

, ?

Gearman //, MySQL . , Gearman , , . , .

+4

Node , n . .

nodejs-land , http, , http proxy . , . , , " ", , , . , , , . !

Edit: remember that crunch number blocks the node event loop! This is somewhat obvious if you think about it, but there is definitely something to keep in mind.

+1
source

All Articles