Hi Yuxin,
Thanks for the proposal.

"Insufficient number of network buffers" exceptions also bother us. It's
too hard for users to figure out
how much network buffer they really need. It relates to partitioner type,
parallelism, slots per taskmanager.

Since streaming jobs are our primary scenario, I have some questions about
streaming jobs.

1. In this FLIP, all read buffers will use floating buffers when the total
buffer is more than
'taskmanager.memory.network.read-required-buffer.max'. Competition in
buffer allocation led to preference regression.
How about reducing ExclusiveBuffersPerChannel to 1 first when the total
buffer is not enough?
Will this reduce performance regression in streaming?

2. Changing taskmanager.memory.network.max will affect user migration from
the lower version.
IMO, network buffer size should not increase with total memory, especially
for streaming jobs with application mode.
For example, some ETL jobs with rescale partitioner only require a few
network buffers.
And we already have 'taskmanager.memory.network.read-required-buffer.max'
to control maximum read network buffer usage.
Do we really need to change the default value of
'taskmanager.memory.network.max'?

Best,
Weihua


On Mon, Dec 26, 2022 at 6:26 PM Yuxin Tan <tanyuxinw...@gmail.com> wrote:

> Hi, all
> Thanks for the reply and feedback for everyone!
>
>
> After combining everyone's comments, the main concerns, and corresponding
> adjustments are as follows.
>
>
> @Guowei Ma, Thanks for your feedback.
> > should we introduce a _new_ non-orthogonal
> option(`taskmanager.memory.network.required-buffer-per-gate.max`). That is
> to say, the option will affect both streaming and batch shuffle behavior at
> the
> same time.
>
> 1. Because the default option can meet most requirements no matter in
> Streaming
> or Batch scenarios. We do not want users to adjust this default config
> option by
> design. This configuration option is added only to preserve the possibility
> of
> modification options for users.
> 2. In a few cases, if you really want to adjust this option, users may not
> expect to
> adjust the option according to Streaming or Batch, for example, according
> to the
> parallelism of the job.
> 3. Regarding the performance of streaming shuffle, the same problem of
> insufficient memory also exists for Streaming jobs. We introduced this
> configuration
> to enable users to decouple memory and parallelism, but it will affect some
> performance. By default, the feature is disabled and does not affect
> performance.
> However, the added configuration enables users to choose to decouple memory
> usage and parallelism for Streaming jobs.
>
> > It's better not to expose more implementation-related concepts to users.
>
> Thanks for you suggestion. I will modify the option name to avoid exposing
> implementation-related concepts. I have changed it to
> `taskmanager.memory.network.read-required-buffer.max` in the FLIP.
>
>
>
> @Dong Lin, Thanks for your reply.
> >  it might be helpful to add a dedicated public interface section to
> describe
> the config key and config semantics.
>
> Thanks for your suggestion. I have added public interface section to
> describe
> the config key and config semantics clearly.
>
> > This FLIP seems to add more configs without removing any config from
> Flink.
>
> This Flip is to reduce the number of options to be adjusted when using
> Flink.
> After the Flip, the default option can meet the requirements in most
> sceneries
> rather than modifying any config
> options(`taskmanager.network.memory.buffers-per-channel`
> and `taskmanager.network.memory.floating-buffers-per-gate`), which is
> helpful
> to improve the out-of-box usability. In the long run, these two parameters
> `taskmanager.network.memory.buffers-per-channel` and
> `taskmanager.network.memory.floating-buffers-per-gate` may indeed be
> deprecated
> to reduce user parameters, but from the perspective of compatibility, we
> need to
> pay attention to users' feedback before deciding to deprecate the options.
>
>
>
> @Yanfei Lei,Thanks for your feedback.
> 1. Through the option is cluster level, the default value is different
> according to the
> job type. In other words, by default, for Batch jobs, the config value is
> enabled, 1000.
> And for Streaming jobs, the config value is not enabled by default.
>
> 2. I think this is a good point. The total floating buffers will not change
> with
> ExclusiveBuffersPerChannel(taskmanager.network.memory.buffers-per-channel)
> because this is the maximum memory threshold. But if the user explicitly
> specified
> the ExclusiveBuffersPerChannel, the calculated result of
> ExclusiveBuffersPerChannel * numChannels will change with it.
>
>
> Thanks again for all feedback!
>
>
> Best,
> Yuxin
>
>
> Zhu Zhu <reed...@gmail.com> 于2022年12月26日周一 17:18写道:
>
> > Hi Yuxin,
> >
> > Thanks for creating this FLIP.
> >
> > It's good if Flink does not require users to set a very large network
> > memory, or tune the advanced(hard-to-understand) per-channel/per-gate
> > buffer configs, to avoid "Insufficient number of network buffers"
> > exceptions
> > which can easily happen for large scale jobs.
> >
> > Regarding the new config
> > "taskmanager.memory.network.read-required-buffer.max",
> > I think it's still an advanced config which users may feel hard to tune.
> > However, given that in most cases users will not need to set it, I
> > think it's acceptable.
> >
> > So +1 for this FLIP.
> >
> > In the future, I think Flink should adaptively select to use exclusive
> > buffers
> > or not according to whether there are sufficient network buffers at
> > runtime.
> > Users then no longer need to understand the above configuration. This may
> > require supporting transitions between exclusive buffers and floating
> > buffers.
> > A problem of all buffer floating is that too few network buffers can
> result
> > in task slowness which is hard to identify by users. So it's also needed
> to
> > do improvements on metrics and web UI to expose such issues.
> >
> > Thanks,
> > Zhu
> >
> > Yanfei Lei <fredia...@gmail.com> 于2022年12月26日周一 11:13写道:
> > >
> > > Hi Yuxin,
> > >
> > > Thanks for the proposal!
> > >
> > > After reading the FLIP, I have some questions about the default value.
> > > This FLIP seems to introduce a *new* config
> > > option(taskmanager.memory.network.required-buffer-per-gate.max) to
> > control
> > > the network memory usage.
> > > 1. Is this configuration at the job level or cluster level? As the FLIP
> > > described, the default values of the Batch job and Stream job are
> > > different, If an explicit value is set for cluster level, will it
> affect
> > > all Batch jobs and Stream jobs on the cluster?
> > >
> > > 2. The default value of Batch Job depends on the value of
> > >
> >
> ExclusiveBuffersPerChannel(taskmanager.network.memory.buffers-per-channel),
> > > if the value of ExclusiveBuffersPerChannel changed, does
> > > "taskmanager.memory.network.required-buffer-per-gate.max" need to
> change
> > > with it?
> > >
> > >
> > > Best,
> > > Yanfei
> > >
> > > Dong Lin <lindon...@gmail.com> 于2022年12月25日周日 08:58写道:
> > >
> > > > Hi Yuxin,
> > > >
> > > > Thanks for proposing the FLIP!
> > > >
> > > > The motivation section makes sense. But it seems that the proposed
> > change
> > > > section mixes the proposed config with the evaluation results. It is
> a
> > bit
> > > > hard to understand what configs are proposed and how to describe
> these
> > > > configs to users. Given that the configuration setting is part of
> > public
> > > > interfaces, it might be helpful to add a dedicated public interface
> > section
> > > > to describe the config key and config semantics, as suggested in the
> > FLIP
> > > > template here
> > > > <
> > > >
> >
> https://cwiki.apache.org/confluence/display/FLINK/Flink+Improvement+Proposals
> > > > >
> > > > .
> > > >
> > > > This FLIP seems to add more configs without removing any config from
> > Flink.
> > > > Intuitively this can make the Flink configuration harder rather than
> > > > simpler. Maybe we can get a better idea after we add a public
> interface
> > > > section to clarify those configs.
> > > >
> > > > Thanks,
> > > > Dong
> > > >
> > > >
> > > > On Mon, Dec 19, 2022 at 3:36 PM Yuxin Tan <tanyuxinw...@gmail.com>
> > wrote:
> > > >
> > > > > Hi, devs,
> > > > >
> > > > > I'd like to start a discussion about FLIP-266: Simplify network
> > memory
> > > > > configurations for TaskManager[1].
> > > > >
> > > > > When using Flink, users may encounter the following issues that
> > affect
> > > > > usability.
> > > > > 1. The job may fail with an "Insufficient number of network
> buffers"
> > > > > exception.
> > > > > 2. Flink network memory size adjustment is complex.
> > > > > When encountering these issues, users can solve some problems by
> > adding
> > > > or
> > > > > adjusting parameters. However, multiple memory config options
> should
> > be
> > > > > changed. The config option adjustment requires understanding the
> > detailed
> > > > > internal implementation, which is impractical for most users.
> > > > >
> > > > > To simplify network memory configurations for TaskManager and
> improve
> > > > Flink
> > > > > usability, this FLIP proposed some optimization solutions for the
> > issues.
> > > > >
> > > > > Looking forward to your feedback.
> > > > >
> > > > > [1]
> > > > >
> > > > >
> > > >
> >
> https://cwiki.apache.org/confluence/display/FLINK/FLIP-266%3A+Simplify+network+memory+configurations+for+TaskManager
> > > > >
> > > > > Best regards,
> > > > > Yuxin
> > > > >
> > > >
> >
>

Reply via email to