Hello Everyone, I am trying to implement autoscali...
# troubleshooting
a
Hello Everyone, I am trying to implement autoscaling with Flink version 1.17.1 and Operator Verison 1.6.1 so it seems to not able to collect required metrics
Copy code
Warning  AutoscalerError             13m                  Operator              java.lang.RuntimeException: Could not find required metric BUSY_TIME_PER_SEC for cbc357ccb763df2852fee8c4fc7d55f2
I am using below configurations in .yaml file.
Copy code
kubernetes.operator.job.autoscaler.enabled: "true"
kubernetes.operator.job.autoscaler.scaling.enabled: "true"
kubernetes.operator.job.autoscaler.stabilization.interval: 1m
kubernetes.operator.job.autoscaler.metrics.window: 5m
kubernetes.operator.job.autoscaler.target.utilization: "0.6"
kubernetes.operator.job.autoscaler.target.utilization.boundary: "0.2"
kubernetes.operator.job.autoscaler.restart.time: 2m
kubernetes.operator.job.autoscaler.catch-up.duration: 5m
Do we need to integrate Prometheus or any external monitoring system for it to work? Is it must?
m
Which connector are you using?
a
I didn't get the meaning of connector?
m
To which system are you connecting?
And you've pinged someone else: please don't @ anyone
😅 1
a
So we are using Hudi as sink
m
And as source?
a
kafka
m
I think Kafka supports autoscaling, but I doubt that the Hudi connector is using the right interfaces (They need to use the Source and Sink interfaces of Flink, and I'm suspecting they're on SourceFunction and SinkFunction).
But that's a question for the Hudi community
a
Oh ok let me check with Hudi community
So use of Prometheus or any other monitoring tool is not needed for implementing autoscale?
if we neglect Hudi as sink?
g
Hudi and Prometheus shouldn’t matter as long as you use the Kafka source
❤️ 1
You should upgrade to the latest operator version where we have fixed a few corner cases around metric collection
For sinks the autoscaler doesn’t require any specific metrics other than busy time
a
Ok will try with upgrading the flink operator version instead of Prometheus.
p
@Gyula Fóra @Jared Martin can you please share the standard configurations for elastic scaling with latest flink kubernetes operator currently we're using this configuration
Copy code
kubernetes.operator.job.autoscaler.enabled: "true"
kubernetes.operator.job.autoscaler.scaling.enabled: "true"
kubernetes.operator.job.autoscaler.stabilization.interval: 1m
kubernetes.operator.job.autoscaler.metrics.window: 5m
kubernetes.operator.job.autoscaler.target.utilization: "0.6"
kubernetes.operator.job.autoscaler.target.utilization.boundary: "0.2"
kubernetes.operator.job.autoscaler.restart.time: 2m
kubernetes.operator.job.autoscaler.catch-up.duration: 5m
a
hii @Gyula Fóra we tried with latest flink operator version and it seems working. We used following configurations for testing.
Copy code
kubernetes.operator.job.autoscaler.enabled: "true"
kubernetes.operator.job.autoscaler.scaling.enabled: "true"
kubernetes.operator.job.autoscaler.stabilization.interval: 1m
kubernetes.operator.job.autoscaler.metrics.window: 5m
kubernetes.operator.job.autoscaler.target.utilization: "0.3"
kubernetes.operator.job.autoscaler.target.utilization.boundary: "0.1"
kubernetes.operator.job.autoscaler.restart.time: 2m
kubernetes.operator.job.autoscaler.catch-up.duration: 5m
pipeline.max-parallelism: "720"
Observations => Intial Job start =>Intially 1 TaskManeger started
Copy code
Type    Reason            Age                 From                  Message
  ----    ------            ----                ----                  -------
  Normal  JobStatusChanged  9m25s               Job                   Job status changed from RECONCILING to INITIALIZING
  Normal  JobStatusChanged  8m50s               Job                   Job status changed from INITIALIZING to CREATED
  Normal  JobStatusChanged  6m49s               Job                   Job status changed from CREATED to RUNNING
  Normal  SpecChanged       107s                JobManagerDeployment  SCALE change(s) detected (Diff: FlinkDeploymentSpec[flinkConfiguration.pipeline.jobvertex-parallelism-overrides : null -> 3d0541f893625ddc6af273a6ad29e71d:2,7508cf930ff0ca2a00b3aa33c346d502:2,3239d1a541dd6971d99412f88facdc58:1,cbc357ccb763df2852fee8c4fc7d55f2:5]), starting reconciliation.
  Normal  Suspended         107s                JobManagerDeployment  Suspending existing deployment.
  Normal  ScalingReport     107s                Operator              Scaling vertices: Vertex ID 3d0541f893625ddc6af273a6ad29e71d | Parallelism 5 -> 2 | Processing capacity Infinity -> Infinity | Target data rate 0.00 Vertex ID 7508cf930ff0ca2a00b3aa33c346d502 | Parallelism 5 -> 2 | Processing capacity Infinity -> Infinity | Target data rate 0.00
  Normal  Submit            101s (x2 over 11m)  JobManagerDeployment  Starting deployment
2 nd Restart => here parallelism for some vertex was reduced from 2 -> 1 (1 Taskmanager)
Copy code
Normal  SpecChanged       10m                  JobManagerDeployment  SCALE change(s) detected (Diff: FlinkDeploymentSpec[flinkConfiguration.pipeline.jobvertex-parallelism-overrides : null -> 3d0541f893625ddc6af273a6ad29e71d:2,7508cf930ff0ca2a00b3aa33c346d502:2,3239d1a541dd6971d99412f88facdc58:1,cbc357ccb763df2852fee8c4fc7d55f2:5]), starting reconciliation.
  Normal  JobStatusChanged  8m38s (x2 over 18m)  Job                   Job status changed from RECONCILING to INITIALIZING
  Normal  JobStatusChanged  8m2s (x2 over 17m)   Job                   Job status changed from INITIALIZING to CREATED
  Normal  JobStatusChanged  6m17s (x2 over 15m)  Job                   Job status changed from CREATED to RUNNING
  Normal  Suspended         74s (x2 over 10m)    JobManagerDeployment  Suspending existing deployment.
  Normal  ScalingReport     74s (x2 over 10m)    Operator              Scaling vertices: Vertex ID 3d0541f893625ddc6af273a6ad29e71d | Parallelism 2 -> 1 | Processing capacity Infinity -> Infinity | Target data rate 0.00 Vertex ID 7508cf930ff0ca2a00b3aa33c346d502 | Parallelism 2 -> 1 | Processing capacity Infinity -> Infinity | Target data rate 0.00
  Normal  Submit            68s (x3 over 19m)    JobManagerDeployment  Starting deployment
3rd Restart => here Autoscaler threw error (1 Taskmanager)
Copy code
Normal   ScalingReport     11m (x2 over 20m)    Operator              Scaling vertices: Vertex ID 3d0541f893625ddc6af273a6ad29e71d | Parallelism 2 -> 1 | Processing capacity Infinity -> Infinity | Target data rate 0.00 Vertex ID 7508cf930ff0ca2a00b3aa33c346d502 | Parallelism 2 -> 1 | Processing capacity Infinity -> Infinity | Target data rate 0.00
    Normal   Submit            11m (x3 over 30m)    JobManagerDeployment  Starting deployment
    Normal   JobStatusChanged  9m30s (x3 over 28m)  Job                   Job status changed from RECONCILING to INITIALIZING
    Normal   JobStatusChanged  8m55s (x3 over 27m)  Job                   Job status changed from INITIALIZING to CREATED
    Normal   JobStatusChanged  7m10s (x3 over 25m)  Job                   Job status changed from CREATED to RUNNING
    Warning  AutoscalerError   7m9s                 Operator              Could not find required metric BACKPRESSURE_TIME_PER_SEC for cbc357ccb763df2852fee8c4fc7d55f2
after some more restarts we increse the load and it incresed Taskmanager to more than 1 and parallelism also from 4 -> 10
Copy code
Normal   Suspended                   2m46s (x5 over 61m)  JobManagerDeployment  Suspending existing deployment.
  Normal   ScalingReport               2m46s (x5 over 61m)  Operator              Scaling vertices: Vertex ID 7508cf930ff0ca2a00b3aa33c346d502 | Parallelism 4 -> 10 | Processing capacity 192.73 -> 478.00 | Target data rate 128.15
  Warning  ClusterDeploymentException  2m39s (x2 over 12m)  JobManagerDeployment  Could not create Kubernetes cluster "cdp-customer-list-job".
  Normal   Submit                      2m39s (x8 over 71m)  JobManagerDeployment  Starting deployment
  Normal   JobStatusChanged            63s (x5 over 69m)    Job                   Job status changed from RECONCILING to INITIALIZING
  Normal   JobStatusChanged            28s (x5 over 68m)    Job                   Job status changed from INITIALIZING to CREATED
so It seems working, But the Job was restarting after every five minutes after collecting metrics and after 3rd or 4th restart again Autoscaler was giving error for metric collection. 1. So is that expected behaviour that job will restart after each metrics collection process? 2. Is my understading of autoscaler from above observations is correct? 3. and also in this we case we are able to increase Replica so Can we also achieve vertical scaling by increasing job managers memory also?
g
If The job restarts every five minutes then the job probably has some problem
The autoscaler never restarts the job only during scaling
🙌 1
a
Oh ok then I will check the job by removing scaling configs sometime. and What about vertical scaling is it possible?
g
You can just disable scaling and keep the other configs . Neither the operator nor the autoscaler should restart running jobs
Only when there is an upgrade like a scale up is when restart happens by the operator but you see that also in the operator logs
a
yes will check job first and then enable scaling again
g
Maybe your job runs out of memory or something
Vertical scaling is on the roadmap but not supported yet
a
oh ok
so as I have shared my observations above so apart from restarting of job my understanding about increasing parallelism for operator is correct right?
yeah the job restarted when there was scale up happening??
g
I can’t really look at the logs in detail as I only have my phone
a
Oh ok😅
g
But it looks like the restart happens during scale up
✅ 1
a
you mean like restart should never happen in both in scale up and scale down??
g
You see the event order, the autoscaler changes the parallelism config and the operator upgrades the job (this involves a restart )
a
yes
g
There is restart during scaling
There is restart on every job upgrade , and scaling is just that
a
whenever it restarted the parallelism has increased for some operator.
g
Ok so the job is fine then
a
yess
g
You can play around with the metric windows
To get more stability
Increase the metric window to 15 mins
a
just need to tune in the values to make it efficient
Ok
g
Experiment with it, you will get the hang of it :)
🙌 1
a
yes because right now the window is 5 mins....it was having data in backlog and until it gets stable the new restart used to happen so yeah will check..
g
It’s normal to have a few scale ups during catchup (backlog) but afterwards it will scale down
a
Ok...but one issue I found is between some restarts it was throwing Autoscaler error as it was not able to collect some metrics..then again after 5 mins window it was able to calculate metrics.
g
That’s normal, ignore those errors after restart
a
Ok ok
g
We have fixed this recently but it’s not released yet
Flink doesn’t report all metrics from the start correctly
a
Ok..
g
Doesn’t affect the behavior
🙌 1
a
Ok..and vertical scaling is not supported in 1.18 also? as of now we are using 1.17.1
g
Vertical scaling needs to be implemented on the autoscaler / operator. As of 1.7.0 it’s not supported . It will also not be part of the next release , maybe in a few months :) it’s a very difficult feature to implement
a
Oh ok....
Thanks a lot. Will share my update by playing with some configs... but thanks again🙌 Happy new Year
🎉 1
🙏 1