I agree this is a good change, but may require operators to update their 
configured userMemory and/or their prewarm configs to avoid unexpected 
problems. It might be good to add some log statements to indicate userMemory 
available AFTER initial prewarm config is applied, to give some hints that 
userMemory seen at invoker is now lower than before with the same configs?

Thanks
Tyson

On 5/24/20, 11:35 PM, "甯尤刚" <[email protected]> wrote:

    Hi, guys,

          Due to this pr (Adjust prewarm container dynamically): 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fopenwhisk%2Fpull%2F4871&amp;data=02%7C01%7Ctnorris%40adobe.com%7C31683d4623b34a5f4d4d08d80075cc1c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637259853220792009&amp;sdata=NFD8P3scFb1vUvK2qNEQicbViBHwTl4j%2BuusM1liUkw%3D&amp;reserved=0
 is merged
    I think it is a good chance to add this feature: take prewarmed container's 
memory as used memory: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fopenwhisk%2Fpull%2F4911&amp;data=02%7C01%7Ctnorris%40adobe.com%7C31683d4623b34a5f4d4d08d80075cc1c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637259853220792009&amp;sdata=%2F%2FUk4HGeYJAyt7QdI9u7%2FD%2B3uRPe%2FcUa6Jxw5E%2FO3Z0%3D&amp;reserved=0

    for master branch,  if invoker has `16GB` physical memory, currently, if we 
configure 12GB user memory and 5GB prewarm pool, invokers will try to create 
containers up to 17GB memory and it may will end up with OOM.

    After apply this feature, user just configure invoker memory to a precise 
value:  `16GB` , when  `used memory` reaches `16GB`, it will not create 
container any more, which mean, `16GB` is the max memory usuage for containers, 
this can avoid `OOM`

    This has another benefit that make user must calculate the prewarmed 
container's memory carefully, and configure the invoker memory more accurately
    ```
    "CONFIG_whisk_containerPool_userMemory": "{{ 
hostvars[groups['invokers'][invoker_index | int]].user_memory | 
default(invoker.userMemory) }}"
    ```

    Have any idea or suggestion for this pr: take prewarmed container's memory 
as used memory: 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fopenwhisk%2Fpull%2F4911&amp;data=02%7C01%7Ctnorris%40adobe.com%7C31683d4623b34a5f4d4d08d80075cc1c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637259853220792009&amp;sdata=%2F%2FUk4HGeYJAyt7QdI9u7%2FD%2B3uRPe%2FcUa6Jxw5E%2FO3Z0%3D&amp;reserved=0
 ?

Reply via email to