1

I setup a distributed openwhisk installation on a few vitual machines as described here https://github.com/apache/incubator-openwhisk/blob/master/ansible/README_DISTRIBUTED.md (had to also install some dependencies on VMs manually because they were expected but not installed by default).

My host file looks like this:

; 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

Everything seems to be running fine in general, I can create actions, invoke them etc.

On the two VMs which host invokers and controllers I turned on htop to check the CPU usage and tried running a python script invoking the same action (prime number calculation which takes time for a large enough input) multiple times in parallel.

The result seems to be that the first invoker works on 100% CPU while the calculation is happening, while the second one is still idling on 5-7% CPU. I also tried different ways of distributing components across multiple VMs, e.g. setting invokers on two machines and one controller separately on another machine, but the result is the same.

What could be the reason for this? And what could be the proper use case to make Openwhisk get the second invoker involved?

Green Fireman
  • 617
  • 1
  • 11
  • 27

1 Answers1

2

In a small deployment, there is a fraction of the invoker pool allocated strictly for docker actions. This is called the blackbox fraction which is 10% by default (with a minimum of 1 invoker, which is why you see one loaded invoker and one idle).

This recent pull request allows all the invokers to be used for small numbers of invokers (up to the reciprocal of the blackbox fraction): https://github.com/apache/incubator-openwhisk/pull/3751

user6062970
  • 831
  • 4
  • 5
  • Thanks for your response! So do I understand correctly, that if I have let's say 4 invokers instead of 2, then 1 would be still allocated for docker actions and I would see the other 3 being actually involved into processing the user actions? – Green Fireman Jun 14 '18 at 08:47
  • 1
    That's correct. Up to 10 invokers (for a 10% fraction) will hold back 1 for docker actions. The PR referenced above restricts docker actions to run on a single invoker, but will allow all N invokers < 10 to be utilized for all actions. – user6062970 Jun 14 '18 at 14:27