You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何提升Kubernetes集群部署的OpenWhisk函数最大内存限制

Absolutely! You can totally tweak that memory limit to whatever value you need—this restriction is controlled by a configuration setting in OpenWhisk's controller component. Let me break down exactly how to make this change:

1. Understand the Configuration Property

The memory threshold you're hitting is set by the actions.container.maxMemory property in OpenWhisk's controller config. The default value is 512MB (which equals 536870912 bytes, matching the error message you saw). You can update this to any value that makes sense for your use case.

2. Update the Controller's ConfigMap (Kubernetes Manifests)

If you deployed OpenWhisk using raw Kubernetes manifests or a standard setup, the controller's config lives in a ConfigMap:

  • First, find the relevant ConfigMap in your OpenWhisk namespace (replace <your-openwhisk-namespace> with your actual namespace):
    kubectl get configmaps -n <your-openwhisk-namespace>
    
    Look for a ConfigMap named something like owdev-controller-config (the exact name depends on your deployment's prefix).
  • Edit the ConfigMap to update the memory limit:
    kubectl edit configmap <controller-config-map-name> -n <your-openwhisk-namespace>
    
  • In the whisk.properties section of the ConfigMap, add or modify the line:
    actions.container.maxMemory=<your-desired-value-in-bytes>
    
    For example, to set a 1GB limit, use 1073741824 (102410241024). Some versions support human-readable suffixes like 1g, but using raw bytes is the most reliable approach across all OpenWhisk versions.

3. Restart the Controller Pods

The controller needs to pick up the new config, so you'll need to restart its pods:

  • Find the controller pods:
    kubectl get pods -n <your-openwhisk-namespace> | grep controller
    
  • Either delete the existing pods (the deployment will automatically spin up new ones with the updated config):
    kubectl delete pod <controller-pod-name> -n <your-openwhisk-namespace>
    
    Or trigger a deployment rollout for a cleaner restart:
    kubectl rollout restart deployment <controller-deployment-name> -n <your-openwhisk-namespace>
    

4. Verify the Change

Test creating an action with your new memory limit to confirm it works:

wsk action create testAction test.js --memory 1024

This should now succeed without hitting the threshold error.

If You Used Helm to Deploy

If you deployed OpenWhisk via Helm, you can set this value directly in your values.yaml file:

controller:
  env:
    whisk:
      actions:
        container:
          maxMemory: 1073741824

Then apply the change by upgrading your Helm release:

helm upgrade <your-helm-release-name> openwhisk/openwhisk -n <your-openwhisk-namespace> -f values.yaml

A quick heads-up: Make sure your Kubernetes cluster has enough available memory across its nodes to support the higher limits you set—otherwise, your function pods might fail to schedule.

内容的提问来源于stack exchange,提问作者pulasthi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:41:23