You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by NicoK <gi...@git.apache.org> on 2017/03/03 12:08:12 UTC
[GitHub] flink pull request #3467: [FLINK-4545] preparations for removing the network...
GitHub user NicoK opened a pull request:
https://github.com/apache/flink/pull/3467
[FLINK-4545] preparations for removing the network buffers parameter
This PR includes some preparations for following PRs that ultimately lead to removing the network buffer parameter that was hard to tune.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/NicoK/flink flink-4545-prep
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/3467.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3467
----
commit dfea1bac97dbbf30a2e049618cc41fdca53ea6d3
Author: Nico Kruber <ni...@data-artisans.com>
Date: 2017-02-10T13:36:37Z
[FLINK-4545] remove (unused) persistent partition type
commit 11557c004450bcbbe680f1575f0e41d164424eae
Author: Nico Kruber <ni...@data-artisans.com>
Date: 2017-02-10T15:11:08Z
[docs] improve some documentation around network buffers
commit cd999061d04ae803c79473241ac1f9b39c1f2731
Author: Nico Kruber <ni...@data-artisans.com>
Date: 2017-02-10T15:12:19Z
[hotfix][network] add some assertions documenting on which locks we rely
commit 8f529bb3f42916c816c5091228569952917ad9b5
Author: Nico Kruber <ni...@data-artisans.com>
Date: 2017-03-01T13:33:44Z
[FLINK-4545] remove fixed-size BufferPool instances
These were unused except for unit tests and will be replaced with bounded
BufferPool instances.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #3467: [FLINK-4545] preparations for removing the network buffer...
Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the issue:
https://github.com/apache/flink/pull/3467
I think this is a good change, merging this...
@zhijiangW Managing the buffers changes in some followup PR, first adjusting the local pools, then the global pool. Managing buffers in a global pool can help when caching data, such as for batch jobs. But we can take suggestions followup improvements as a separate thread, after this improvement is in.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #3467: [FLINK-4545] preparations for removing the network buffer...
Posted by zhijiangW <gi...@git.apache.org>.
Github user zhijiangW commented on the issue:
https://github.com/apache/flink/pull/3467
Hi @NicoK , I am interested in this issue and I like the way of asserting hold lock in this PR.
It is really necessary to manage network buffers by framework, because it is difficult to set the exact number of buffers by users. And our current simple solution is to expand the `ResourceProfile` by adding the total number of input and output edges for `Execution`. Then the `ResourceManager` would calculate the buffer amounts based on that and overwrite the parameter value to `TaskManager` configuration.
From @StephanEwen mentioned before, I know a little for this issue. Would you share some detail designs for plans for it if have, then I can learn and track the progress in time. Thank you !
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #3467: [FLINK-4545] preparations for removing the network...
Posted by NicoK <gi...@git.apache.org>.
Github user NicoK commented on a diff in the pull request:
https://github.com/apache/flink/pull/3467#discussion_r105143643
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java ---
@@ -265,11 +281,15 @@ public String toString() {
// ------------------------------------------------------------------------
private void returnMemorySegment(MemorySegment segment) {
+ assert Thread.holdsLock(availableMemorySegments);
--- End diff --
Using synchronized again would impact performance, while assertions only do when they are enabled which is the case in our unit tests (see https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#enableAssertions).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #3467: [FLINK-4545] preparations for removing the network...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/flink/pull/3467
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #3467: [FLINK-4545] preparations for removing the network...
Posted by wenlong88 <gi...@git.apache.org>.
Github user wenlong88 commented on a diff in the pull request:
https://github.com/apache/flink/pull/3467#discussion_r105081191
--- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java ---
@@ -265,11 +281,15 @@ public String toString() {
// ------------------------------------------------------------------------
private void returnMemorySegment(MemorySegment segment) {
+ assert Thread.holdsLock(availableMemorySegments);
--- End diff --
Hi, I have a question about assert, because I found that assertion is disabled in java by default. why not use explicit `synchronized(availableMemorySegments)` which may be more common usage.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #3467: [FLINK-4545] preparations for removing the network buffer...
Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the issue:
https://github.com/apache/flink/pull/3467
@zhijiangW Yes, let's discuss this when the feature is complete.
Our thinking so far is:
- One can specify an absolute amount of network memory (similar as one can specify an absolute amount of managed memory for batch)
- If no absolute amount is specified, a relative fraction of the JVM heap will be pre-allocated as network buffers.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #3467: [FLINK-4545] preparations for removing the network buffer...
Posted by zhijiangW <gi...@git.apache.org>.
Github user zhijiangW commented on the issue:
https://github.com/apache/flink/pull/3467
@NicoK \uff0cthank you for explanation, and I already trace the code in your local branch. Wish your further change commit in global pool.
@StephanEwen , thanks for further elaboration. From my understanding, each task can decide the core number of buffers in `LocalBufferPool` based on input, output channels and configuration, the maximum number of buffers based on `ResultPartitionType`. And all the `LocalBufferPool`s make effect on the total number of buffers in `NetworkBufferPool`, may need consider maximum memory usages.
And my concern is to consider the memory usages in `NetworkBufferPool` before starts the `TaskManager`, and this part of memory should be added into the total resource of `TaskManager`.
I am willing to do that as a part of my current work in [Fine-grained Resource Configuration](https://issues.apache.org/jira/browse/FLINK-5131) after this feature completes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #3467: [FLINK-4545] preparations for removing the network buffer...
Posted by NicoK <gi...@git.apache.org>.
Github user NicoK commented on the issue:
https://github.com/apache/flink/pull/3467
Hi @zhijiangW,
actually, the solution I am working on is to replace the network buffers parameter by something like "max memory in percent" and "min MB to use". For this to not create buffer bloat in our network stack, I have started to implement limited `LocalBufferPool` instances which tune their size based on the actual number of outgoing and ingoing channels. It is actually not much more complicated than this and I already started on this in my local branch at https://github.com/NicoK/flink/tree/flink-4545 - expect a new PR within the week with more details.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---