bdoyle0182 commented on code in PR #5229: URL: https://github.com/apache/openwhisk/pull/5229#discussion_r868850566
########## proposals/POEM-3-action-limit-for-namespace.md: ########## @@ -0,0 +1,132 @@ +<!-- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +--> + +# Title +Providing action limits for each namespace + +## Status +* Current state: In-progress +* Author(s): @upgle + +## Summary and Motivation + +This POEM proposes a new feature that allows administrators to set action limits (memory, timeout, log, and concurrency) for each namespace. + +Sometimes some users want to make an action with more memory and longer duration. But, Openwhisk only has a system limit for action, which is shared by all namespaces. +There is no way to loosen the action limit for just a few users, and changing the action limit setting will affect all users. + +## Proposed changes + +### 3 types of action limits + +There are 3 types of action limits: + +- (1) system limits: This limits can never be exceeded. +- (2) namespace default limits: This limit can be used if a limit has not been set for the namespace. +- (3) namespace limits: This limit can be set by the system administrator for namespace and cannot exceed the range of the system limit. + + +#### namespace default limit +Namespaces without additional namespace limits can create actions with memory ranging from 512MB to 1024MB. + +<img src="https://user-images.githubusercontent.com/5635513/166409786-bb6759f8-e860-4f1e-8524-a91cc8ddd2f9.png" width="600"> + +#### namespace limit (for `foo` namespace) +The `foo` namespace with a maximum memory limit of 2048MB can create actions that have between 512MB and 2048MB of memory. + +<img src="https://user-images.githubusercontent.com/5635513/166409938-66a257e5-e9a5-4031-9f3a-a0001a9c5c93.png" width="600"> + +### Limit document for CouchDB + +You can set namespace limits with `{namespace}/limits` document just like any other existing setting. +The config keys related to the action limit start with the string `action` and end with `Min`, and `Max`. + +```json +{ + "concurrentInvocations": 100, + "invocationsPerMinute": 100, + "firesPerMinute": 100, + "actionMemoryMax": 1024, + "actionMemoryMin": 128, + "actionConcurrencyMax": 400, + "actionConcurrencyMin": 1, + "actionLogsMax": 128, + "actionLogsMin": 0 +} +``` + +#### namespace limit configs Review Comment: How does a user update their set limits? It seems like there's two concepts of limits here. Action memory and action duration should allow the user of the namespace to create actions anywhere in the range of the min and the max. Whereas action concurrency still needs to have a set limit for the namespace within the min and max because the concurrency limit is by namespace, not set when creating an action. And how will a user update their concurrency for their namespace? Currently the only way to update a namespace's concurrency is by accessing the db not through the controller api which isn't safe to hand over to the user. The limits api should be updated to support puts if the namespace user can now update this config. I still think it makes more sense for there to be a single concurrency limit for each namespace set by the operator of the system, then when uploading the action a user can include provisioned concurrency that is reserved to the action. Say the namespace concurrency limit is 30 and they upload an action with concurrency limit of 5. The free pool of concurrency to take from is now 25 and the action is guaranteed to be allowed to have up to 5 concurrency, but it can also take from the shared pool of 25 to go over 5 if needed and the namespace has spare capacity. This is how aws lambda works. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
