Hello everyone Not a problem in a concrete Flink ...
# troubleshooting
r
Hello everyone Not a problem in a concrete Flink job, but I was wondering what people do when they need a very simple job with no state and not a lot of messages. Spinning up an entire Flink job would include the JVM overhead which can end up being a lot if you have say 50 of these small jobs. Do you use some other framework? Do you write a small job yourself in your language of choice where you make sure to obey the necessary delivery guarantees? So say you have a Kafka source and you want at-least-once delivery, you would need to only commit the Kafka offset after making sure the entire pipeline has finished for the message or if you want exactly-once delivery, you would need to mess with the transaction stuff in Kafka. Do you add many of the small jobs into one big Flink job? Do you ignore the JVM overhead and use a Flink job anyway? What is the general approach to this?
r
For running Flink on a kubernetes cluster, the documentation states that it is recommended to run jobs in application mode for production https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/resource-providers/native_kubernetes/#deployment-modes
We have some other concerns regarding session mode such as "[session mode] This has the advantage that you do not pay the resource overhead of spinning up a full cluster for every submitted job. But, if one of the jobs misbehaves or brings down a TaskManager, then all jobs running on that TaskManager will be affected by the failure." To keep jobs separated so they don't crash each other, we would have to spin up a new taskmanager every time we want to submit another job, which, if i recall correctly, we found out wasn't trivial, and we are also unsure about the scaling of having a single jobmanager in case you want 100 or 1000 jobs on just that one jobmanager
d
I wonder if it would be helpful to use something like HPA (Horizontal Pod Autoscaler) that will increase the number of jobs based on CPU or memory usage?
The other thing that might affect the isolation level is using Stateful Sets for the flink jobs
r
Wouldnt HPA be per taskmanager? Which i dont think solves any of our worries
im not exactly sure what you mean by stateful sets. the kind of jobs im talking about would be without any state, something simple like a filter or a map
d
“StatefulSets can be used to ensure that the pods running a Flink job are created and deleted in a specific order, and that each pod has a unique identity”. but not sure this helps for multiple jobs. It might if they are grouped in some particular way.
HPA can be per job
r
well a job would be run by a taskmanager (unless you want more parallelisation), but i dont see which issue that addresses
just to be on the same page, are we talking about how to fix our worries about session mode?
d
now session mode I also would like to see feedback on that as well whether its the best option in production for this or not. I also hope to see feedback on that.
r
but your main idea would be to run in session mode?
d
I think its something to experiment with yes
r
alright, i will try to continue with that. i would love to hear what others have to say and if anyone has some recommended lighweight alternatives for the small jobs. i will put a question in the troubleshooting channel about the session mode and production recommendations that i mentioned earlier 🙂
o
Maybe the flink operator for kubernetes might be a better experience? You apply a simple flink deployment yaml to k8s. Sure you still get a full cluster for each job but you can manage everything about it via that single deployment file.
r
that is what we are doing, the concern is having a full JVM running for each job which is a lot of overhead if we have say 200 really small jobs