search

Home  >  Q&A  >  body text

node.js - node开多个进程,但是脚本都是监听一个端口,如何解决

因为想充分发挥多核CPU的优势

PHPzPHPz2876 days ago673

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:57:04

    Use pm2, it can help you start multiple service threads, utilize the server's CPU as much as possible, and ensure that the process is always alive and reloaded in 0 seconds.
    For specific usage, you can google it yourself.
    Official website address: http://pm2.keymetrics.io

    reply
    0
  • PHPz

    PHPz2017-04-17 15:57:04

    To take full advantage of multi-core CPU, please use go

    reply
    0
  • PHPz

    PHPz2017-04-17 15:57:04

    The native cluster module has already solved this problem for you.
    Reference: https://cnodejs.org/topic/56e...

    reply
    0
  • Cancelreply