1

我在一些虚拟机器上设置了分布式 openwhisk 安装,如此处所述https://github.com/apache/incubator-openwhisk/blob/master/ansible/README_DISTRIBUTED.md(还必须手动安装一些对 VM 的依赖项,因为它们是预期但默认未安装)。

我的主机文件如下所示:

; the first parameter in a host is the inventory_hostname

; used for local actions only
ansible ansible_connection=local

[registry]
xxx.xx.xx.173              ansible_host=xxx.xx.xx.173

[edge]
xxx.xx.xx.176              ansible_host=xxx.xx.xx.176

[apigateway:children]
edge

[redis:children]
edge

[controllers]
xxx.xx.xx.174              ansible_host=xxx.xx.xx.174
xxx.xx.xx.175              ansible_host=xxx.xx.xx.175

[kafkas]
xxx.xx.xx.176              ansible_host=xxx.xx.xx.176

[zookeepers:children]
kafkas

[invokers]
xxx.xx.xx.174              ansible_host=xxx.xx.xx.174
xxx.xx.xx.175              ansible_host=xxx.xx.xx.175

[db]
xxx.xx.xx.176               ansible_host=xxx.xx.xx.176

总的来说,一切似乎都运行良好,我可以创建动作、调用它们等。

在托管调用程序和控制器的两个 VM 上,我打开 htop 以检查 CPU 使用情况,并尝试并行运行多次调用相同操作(素数计算需要时间来获得足够大的输入)的 python 脚本。

结果似乎是第一个调用程序在计算发生时在 100% CPU 上工作,而第二个调用程序仍在 5-7% CPU 上空闲。我还尝试了在多个 VM 之间分配组件的不同方法,例如在两台机器上设置调用程序,在另一台机器上分别设置一个控制器,但结果是相同的。

这可能是什么原因?什么是让 Openwhisk 让第二个调用者参与其中的正确用例?

4

1 回答 1

2

在小型部署中,调用程序池的一部分严格分配给 docker 操作。这称为黑盒分数,默认为 10%(最少有 1 个调用程序,这就是为什么您会看到一个加载的调用程序和一个空闲的调用程序)。

这个最近的拉取请求允许所有调用程序用于少量调用程序(最多黑盒分数的倒数):https ://github.com/apache/incubator-openwhisk/pull/3751

于 2018-06-13T20:39:33.780 回答