nodejs - 群集中的最佳工作者数量

时间:2017-05-27 07:46:27

标签: javascript node.js performance worker

在多核处理器上集群nodej时I usually see examples saying -

    <form id='fileupload' action='/test/so_upload_image_target.php' method='post' enctype='multipart/form-data'>
        <h1>Upload an image - test</h1>
        <input type='file' name='fileToUpload' />
        <input type='text' name='imageRename' value='boobies' />
        <input type='submit' />
    </form>

我的问题是 -

  1. 如果一个多核处理器正在运行一个带有反向代理的Web应用程序终止ssl(cpu密集型),gzipping(cpu密集型)和做其他的东西+还有其他服务器在做主节点服务器的CPU密集工作,生成与cpu核心数量一样多的工作者(主节点服务器)是否仍然明智?

  2. 应该运行哪些测试来找到最佳工人数?

1 个答案:

答案 0 :(得分:-2)

  1. 您可以set an affinity for the process to a set of cores

  2. 每个核心可用核心应该有一个工作者。可用核心是指其他流程不会大量使用的核心。

  3. 为确保一切正常,您的(CPU load / number of cores)应低于1。

    尝试使用极少数不同的服务/流程来配置您的计算机。这一开始可能看起来很浪费,但它可以通过限制级联故障的影响来帮助MMTD和MMTR处理事故。

    注意:这个问题通常最好在另一个Stack Exchange站点Server Fault询问。