You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2021/10/23 03:29:47 UTC

[GitHub] [openwhisk] style95 commented on pull request #5118: [New Scheduler] Manage memory queues in scheduler

style95 commented on pull request #5118:
URL: https://github.com/apache/openwhisk/pull/5118#issuecomment-950049648


   @JesseStutler 
   Yes, DecisionMaker is the most complex and important module in the new scheduler.
   
   There are two cases checking `staleActivationNum` in the `Running` state.
   ```
             case (Running, None) if staleActivationNum > 0 =>
   
             case (Running, Some(duration)) if staleActivationNum > 0 =>
   ```
    
   Since there is no duration in the first case, it means, the target action has never been executed.
   So it's not possible to calculate the accurate number of containers to create.
   Also considering the fact that action can run for a very short time such as 10ms or a very very long time such as 5 mins, we need to provision more containers if there are stale activations.
   The stale activations here mean some activations are waiting in the queue for more than the given threshold(100ms).
   
   Since the initial container is created by the following case, this case is for the situation where the first container is being created, but it takes more than 100ms so no activation is handled yet.
   
   ```
   case (Running, None) if totalContainers == 0 && !initialized =>
   ```
   
   If the action is designed to run for 5 mins, and there are multiple activations waiting in the queue, then the initial container is not enough. So when there are 5 stale activations, we need to provision 4 more containers to handle 5mins-running activations.
   
   On the other hand, if the action runs for only 10 ms, if we provision 4 more containers, then the initial container will handle all 5 activations because 4 container provisioning will take some time. So this is the over-provisioning case.
   
   
   The second case implies there are not enough containers.
   
   ```
             case (Running, Some(duration)) if staleActivationNum > 0 =>
   ```
   
   Since the duration is available, some activations are already invoked.
   So there are already some containers and they actively handle incoming requests, but some activations have waited in the queue for more than the threshold(100ms). It means existing containers could not effectively handle all incoming requests so this is another point we need to provision more containers.
   
   The threshold is configurable and we are using 100ms as our threshold.
   It means there should be no activations waiting for more than 100ms in the queue.
   
   
   


-- 
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: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org