Skip to content

Conversation

pranoyk
Copy link
Contributor

@pranoyk pranoyk commented Mar 9, 2023

Description

Keep a track of number of pods in specialization and make check the capacity is more then requested else fail the function

Terminology

  • Capacity - (specialized pod + pods in specialization state) * rpp - (total active requests + functions awaiting svc)
  • svcWaiting - number of functions waiting for a svc

Approach

  • During getSvcValue if svc does not exist increase svcWaiting counter and check if capacity is greater then 1 (In the case of first request capacity would be less then 1)
  • If capacity is greater then 1 then push req into the queue and await specialization to finish
  • once specialization is done check if req are awaiting in queue for this function svc. If yes then allocate the svc to functions upto its requests per pod limit
  • keep repeating the process until the limit is reached.

Fixes #1939

Test scenarios

RPP Concurrency Requests Expected Actual
60 5 300 Specialized Pods - 5 Requests Success - 300 Requests Fail - 0 Specialized Pods - 5 Requests Success - 300 Requests Fail - 0
60 5 300 concurrent requests for 60 sec Specialized Pods - 5 Requests Success - ~18000 Requests Fail - 0 Specialized Pods - 5 Requests Success - 14464 Requests Fail - 0 No of requests made can vary due to the test tool used (ab in this case)
1 10 10 Specialized Pods - 10 Requests Success - 10 Requests Fail - 0 Specialized Pods - 10 Requests Success - 10 Requests Fail - 0
5 5 25 Specialized Pods - 5 Requests Success - 25 Requests Fail - 0 Specialized Pods - 5 Requests Success - 25 Requests Fail - 0
5 1 5 Specialized Pods - 1 Requests Success - 5 Requests Fail - 0 Specialized Pods - 1 Requests Success - 5 Requests Fail - 0
5 1 6 Specialized Pods - 1 Requests Success - 5 Requests Fail - 1 Specialized Pods - 1 Requests Success - 5 Requests Fail - ~1 (requests gets timed out) In case the time taken to run the function is not very long then all 6 requests may be success
1 5 6 Specialized Pods - 5 Requests Success - 5 Requests Fail - 1 Specialized Pods - 5 Requests Success - 5 Requests Fail - 1 (requests gets timed out) In case the time taken to run the function is not very long then all 6 requests may be success
5 5 10 Specialized Pods -  =<5 Requests Success - 10 Requests Fail - 0 Specialized Pods - =<5 Requests Success - 10 Requests Fail - 0
10 1 20 Specialized Pods - 1 Requests Success - 10 Requests Fail - 10 Specialized Pods - 1 Requests Success - 10 Requests Fail - 10

@pranoyk pranoyk requested a review from sanketsudake March 9, 2023 10:48
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #2737 (df6998b) into main (b622f13) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2737   +/-   ##
=======================================
  Coverage   20.53%   20.53%           
=======================================
  Files          65       65           
  Lines        7191     7191           
=======================================
  Hits         1477     1477           
  Misses       5602     5602           
  Partials      112      112           
Flag Coverage Δ
unittests 20.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pranoyk pranoyk force-pushed the feature/optimize-pool-manager-strategy branch from 988a801 to 1632f09 Compare March 28, 2023 12:17
@pranoyk pranoyk marked this pull request as ready for review March 28, 2023 14:13
@pranoyk pranoyk force-pushed the feature/optimize-pool-manager-strategy branch from 29308c6 to a5b3a5c Compare March 30, 2023 12:28
@LyKos4
Copy link

LyKos4 commented May 19, 2024

When I set concurrency 1 or rpp 1 and try to run a function more than 1 pods are created for that run, why does this happen?
Same for yolo true

Doesn't yolo true of rpp 1 mean that a function run should be done by a new single pod, meaning 1 pod per function run?

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

Successfully merging this pull request may close these issues.

Relaxed concurrency in poolmanager strategy
3 participants