douyan3478 2015-03-12 09:23
浏览 68

如何使用gearman每秒运行50k个工作

According to Gearman website

"A 16 core Intel machine is able to process upwards of 50k jobs per second."

I have load balancer that moves traffic to 4 different machines. Each machine has 8 cores. I want to have the ability to run 13K jobs per machine, per second (it's definitely more then 50K jobs).

Each job takes between 0.02 - 0.8 MS.

How many workers do I need to open for this type of performance?

What is the steps that I need to take to open these amount of workers?

  • 写回答

1条回答 默认 最新

  • dqol6556 2015-09-07 04:34
    关注

    Depending on what kind of processing you're doing, this will require a little experimentation and load testing. Before you start, make sure you have a way to reboot the server without SSH, as you can easily peg the CPU. Follow these steps to find the optimum number of workers:

    1. Begin by adding a number of workers equal to the number of cores minus one. If you have 8 cores, start with 7 workers (hopefully leaving a core free for doing things like SSH).
    2. Run top and observe the load average. The load average should not be higher than the number of cores. For 8 cores, a load average of 7 or above would indicate you have too many workers. A lower load average means you can try adding another worker.
    3. If you added another worker in step 2, observe the load average again. Also observe the increase in RAM usage.
    4. If you repeat the above steps, eventually you will either run out of CPU or RAM.

    When doing parallel processing, keep in mind that you could run into a point of diminishing returns. Read about Amdahl's law for more information.

    评论

报告相同问题?

悬赏问题

  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染