Repository navigation
Description
In what area(s)?
/area autoscale
What version of Knative?
HEAD as of 6/20
Issue
Using this script:
$ cat doit
#!/bin/bash
set -e
PAUSE=${1:-10}
echo "Erasing old service"
kn service delete echo > /dev/null 2>&1 && sleep 5
URL=`kn service create echo --image duglin/echo --concurrency-limit=1 | tail -1`
echo "Service: $URL"
echo "Pause: $PAUSE"
for i in `seq 1 20` ; do
echo -n "$i : Running 50... "
(time (
for i in `seq 1 50` ; do
curl -s ${URL}?sleep=10 > /dev/null &
done
wait )
) 2>&1 | grep real | tr '\n' '\0'
echo -n " # pods: "
kubectl get pods | grep echo.*Running | wc -l
sleep $PAUSE
done
kn service delete echo
It'll create a ksvc that just echos "hi", but will sleep based on a 'sleep' query param.
It'll then curl the service 50 times concurrently, telling it to sleep for 10 seconds, and print the # of pods and amount of time it took to run all 50. Ideally it should level out at 50 pods and around 10 seconds total for each set of 50 (20 sets are run).
I expect the first set, or two, of 50 to be a bit odd as it tries to get into a steady state, but after that it should remain fairly constant. When I run it with a pause of 0 seconds between each set of 50 I see this:
$ ./a 0
Erasing old service
Service: http://echo-default.kndev.us-south.containers.appdomain.cloud
Pause: 0
1 : Running 50... real 0m57.675s # pods: 33
2 : Running 50... real 0m20.185s # pods: 72
3 : Running 50... real 0m10.251s # pods: 72
4 : Running 50... real 0m10.203s # pods: 72
5 : Running 50... real 0m10.220s # pods: 72
6 : Running 50... real 0m10.239s # pods: 72
7 : Running 50... real 0m10.198s # pods: 72
8 : Running 50... real 0m10.184s # pods: 64
9 : Running 50... real 0m10.193s # pods: 64
10 : Running 50... real 0m10.225s # pods: 64
11 : Running 50... real 0m10.197s # pods: 64
12 : Running 50... real 0m10.179s # pods: 64
13 : Running 50... real 0m10.201s # pods: 68
14 : Running 50... real 0m10.205s # pods: 67
15 : Running 50... real 0m10.189s # pods: 68
16 : Running 50... real 0m10.197s # pods: 67
17 : Running 50... real 0m10.217s # pods: 67
18 : Running 50... real 0m10.213s # pods: 67
19 : Running 50... real 0m10.192s # pods: 67
20 : Running 50... real 0m10.175s # pods: 68
Service 'echo' successfully deleted in namespace 'default'.
which isn't too bad. ~65 pods seems a bit much, but at least I get a consistent 10 seconds per curl.
However, running with a delay of 10 seconds between each set of 50 I get this:
$ ./a
Erasing old service
Service: http://echo-default.kndev.us-south.containers.appdomain.cloud
Pause: 10
1 : Running 50... real 0m50.530s # pods: 58
2 : Running 50... real 0m10.208s # pods: 58
3 : Running 50... real 0m10.275s # pods: 58
4 : Running 50... real 0m10.252s # pods: 29
5 : Running 50... real 0m24.549s # pods: 29
6 : Running 50... real 0m20.214s # pods: 64
7 : Running 50... real 0m10.256s # pods: 64
8 : Running 50... real 0m10.275s # pods: 64
9 : Running 50... real 0m10.490s # pods: 29
10 : Running 50... real 0m20.353s # pods: 34
11 : Running 50... real 0m20.163s # pods: 56
12 : Running 50... real 0m11.501s # pods: 56
13 : Running 50... real 0m10.225s # pods: 56
14 : Running 50... real 0m25.116s # pods: 32
15 : Running 50... real 0m21.884s # pods: 46
16 : Running 50... real 0m12.542s # pods: 58
17 : Running 50... real 0m12.209s # pods: 59
18 : Running 50... real 0m20.200s # pods: 26
19 : Running 50... real 0m20.148s # pods: 32
20 : Running 50... real 0m20.151s # pods: 57
Service 'echo' successfully deleted in namespace 'default'.
It's weird that it drops down below 50 pods, ever. And because it does the timing I see for the curls doubles due to it queuing the requests.
I'm using default values for all auto-scaler options.
Activity
duglin commentedon Jun 20, 2020
TBC=-1
vagababov commentedon Jun 21, 2020
Depending on cold start variations the numbers change a bit.
duglin commentedon Jun 21, 2020
I'm not sure if you're saying this is correct behavior or if there's something to be worked on.
It appears as though pods are killed, in my env, after being idle for ~60 seconds. So, that would seem to indicate that if I send 50 requests (with CC=1) before that timeout then I should continually have (at least) 50 pods running. I understand the algorithm might not work that way today, but I suspect that might be the expectations people will have - I certainly did.
mattmoor commentedon Aug 17, 2020
/assign @vagababov @markusthoemmes
The discussion seems to be stalled after Doug's last question. If we're not going to fix, can we close this?
vagababov commentedon Aug 17, 2020
/assign @julz
I think the latest we all kind of agreed to is to add mode that uses
maxratheravgas a scaling decision point.vagababov commentedon Aug 18, 2020
/close
In favor #8610
knative-prow-robot commentedon Aug 18, 2020
@vagababov: Closing this issue.
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
duglin commentedon Aug 18, 2020
@vagababov can you elaborate on why you think this is the same as #8610 ?
vagababov commentedon Aug 18, 2020
Since you see the behavior due to holes (no traffic). Which seems to correlate with that issue.
But @julz filed another one, which is more precise.