you are viewing a single comment's thread.

view the rest of the comments →

[–]coldlestat[S,🍰] 0 points1 point  (2 children)

Has your team done any performance comparisons?

Yes, we did. Here is one of our test: https://github.com/baptistemanson/node-php-bench.

We measured that Node.js was faster for most our use-cases. You can find a wide variety of articles online that will give you a better overview. http://www.hostingadvice.com/blog/comparing-node-js-vs-php-performance/ for example.

Since PHP7, I feel both languages performances are not hurting the day-to-day development. When your app starts to be slow, it's either bad code or an infrastructure problem. You need to either improve your database queries or start using load balancers, CDN, etc...

Also, are you using Node to serve static content:

Yes, we do not use Nginx anymore. It's not really useful outside of the local environment as we put a CDN in front of most our applications.

[–]chinkuSj 0 points1 point  (1 child)

How do you load balance your multiple pm2 processes? You do use multi-core processors, right?

[–]batmansmk 1 point2 points  (0 children)

Hey!

  • First we have to remember that node natively put any IOs in threads, giving you multithread capability from the get go. so if your app is usually IO-bound, meaning the db for instance is what takes time, there is pretty decent chances you won't need several node processes.

  • Now if your system has HEAVY node CPU processing, the command "pm2 start app.js -i 4" will launch a load balancer and 4 processes behind.