apache / apache/openwhisk-deploy-kube

How to correctly configure the concurrency of a single function in K8s deploy?

Open
#763 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
309
Forks
231
PR merge metrics
No merged PRs in 30d

Description

@dgrove-oss Hello boss, I am currently facing the problem of configuring the concurrency of Action. I set up the NodeJS runtime environment and configured it in value.yaml according to the concurrency configuration given in the OpenWhisk project documentation, but the result is still very unsatisfactory.
My hardware environment is 3 nodes with 32GB, two of which are configured with Invoker stains, I configure the container pool to be 48GB, and the scheduler, Invoker, and controller are all configured with 4GB JVM.
Still, the concurrency I'm currently achieving is poor. I created a simple nodejs:16 Action that reads the redis cluster, configured memory usage as 64MB, and preheated 100 containers. I only have one invoke, controller, and scheduler. I used the K6 stress testing tool to test web Actions, and the results showed that when the concurrency was configured as 128 and 64, the concurrency of 64 achieved better results, and a maximum of 200 actions were executed per second, which seemed to be concurrent Action does not bring stronger TPS indicators.

values.yaml config:
![image](https://github.com/apache/openwhisk-deploy-kube/assets/54056797/b033fca4-4082-41f0-a380-c87454099c65)
![image](https://github.com/apache/openwhisk-deploy-kube/assets/54056797/236b1e1d-8ce0-4c01-9c15-6c277e30956d)
![image](https://github.com/apache/openwhisk-deploy-kube/assets/54056797/369a703a-4433-4c42-88e1-8bd1d4f31d47)

My nodejs Action code and config:
```js
const Redis = require('ioredis');
const redis = new Redis.Cluster([
{
host: '192.168.1.21',
port: 6001
},
{
host: '192.168.1.22',
port: 6001
},
{
host: '192.168.1.23',
port: 6001
}
]);

function readfunc(params) {
key = params.key;
// redis.set('key', key);
for(var i = 1 ; i <= 100; ++i){
redis.get(key, (err, value) => {
if (err) throw err;
console.log(value);
});
}

return {msg: 'ok'}
}

exports.main = readfunc;
```
```bash
wsk -i action update wsk-read wsk-read.zip --kind nodejs:16 --web true -c 32
```
We can share you ours test result:
![image](https://github.com/apache/openwhisk-deploy-kube/assets/54056797/0543b2f8-c382-46c8-a744-9a28793ba9bd)

Could you give ours some suggestion to improve function concurrency?
Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.