Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
QWQyyy opened this issue May 11, 2023 · 0 comments

Comments

@QWQyyy
Copy link

QWQyyy commented May 11, 2023

@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
image
image

My nodejs Action code and config:

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;
wsk -i action update wsk-read wsk-read.zip --kind nodejs:16 --web true -c 32

We can share you ours test result:
image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant