You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/07/17 00:41:39 UTC
[1/2] mesos git commit: Improved performance of cgroups::read by
verifying after failure.
Repository: mesos
Updated Branches:
refs/heads/1.4.x 5f6d4cdc7 -> 163dd77ef
Improved performance of cgroups::read by verifying after failure.
It turns out that cgroups::verify is expensive and leads to a severe
performance issue on the agent during container metrics collection
if there are a lot of containers on the agent. See MESOS-8418.
Since cgroups::verify serves to provide a helpful error message,
this patch preserves the error message, but only if the read fails.
Longer term, there probably needs to be some re-structuring of the
code to make verification caller-controlled, or perhaps the verify
code can occur consistently post-operation (as done in this patch),
or perhaps verify can be optimized substantially.
Review: https://reviews.apache.org/r/67923/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4fc17599
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4fc17599
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4fc17599
Branch: refs/heads/1.4.x
Commit: 4fc1759965b8a4ae00f70a05406a3b93e52150dc
Parents: 5f6d4cd
Author: Benjamin Mahler <bm...@apache.org>
Authored: Mon Jul 16 17:22:45 2018 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Mon Jul 16 17:36:08 2018 -0700
----------------------------------------------------------------------
src/linux/cgroups.cpp | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4fc17599/src/linux/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp
index 0a7bb89..ab594e0 100644
--- a/src/linux/cgroups.cpp
+++ b/src/linux/cgroups.cpp
@@ -946,12 +946,25 @@ Try<string> read(
const string& cgroup,
const string& control)
{
- Option<Error> error = verify(hierarchy, cgroup, control);
- if (error.isSome()) {
- return error.get();
+ Try<string> read = internal::read(hierarchy, cgroup, control);
+
+ // It turns out that `verify()` is expensive, so rather than
+ // verifying *prior* to the read, as is currently done for other
+ // cgroup helpers, we only verify if the read fails. This ensures
+ // we still provide a good error message. See: MESOS-8418.
+ //
+ // TODO(bmahler): Longer term, verification should be done
+ // explicitly by the caller, or its performance should be
+ // improved, or verification could be done consistently
+ // post-failure, as done here.
+ if (read.isError()) {
+ Option<Error> error = verify(hierarchy, cgroup, control);
+ if (error.isSome()) {
+ return error.get();
+ }
}
- return internal::read(hierarchy, cgroup, control);
+ return read;
}
[2/2] mesos git commit: Add MESOS-8418 to the 1.4.2 CHANGELOG.
Posted by bm...@apache.org.
Add MESOS-8418 to the 1.4.2 CHANGELOG.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/163dd77e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/163dd77e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/163dd77e
Branch: refs/heads/1.4.x
Commit: 163dd77ef8702fce4d6bcadfbcee2f2aeeb0c5f5
Parents: 4fc1759
Author: Benjamin Mahler <bm...@apache.org>
Authored: Mon Jul 16 17:40:27 2018 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Mon Jul 16 17:40:45 2018 -0700
----------------------------------------------------------------------
CHANGELOG | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/163dd77e/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 22872ad..4396f39 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,7 @@ Release Notes - Mesos - Version 1.4.2 (WIP)
* [MESOS-8352] - Resources may get over allocated to some roles while fail to meet the quota of other roles.
* [MESOS-8356] - Persistent volume ownership is set to root despite of sandbox owner (frameworkInfo.user) when docker executor is used.
* [MESOS-8411] - Killing a queued task can lead to the command executor never terminating.
+ * [MESOS-8418] - mesos-agent high cpu usage because of numerous /proc/mounts reads.
* [MESOS-8480] - Mesos returns high resource usage when killing a Docker task.
* [MESOS-8488] - Docker bug can cause unkillable tasks.
* [MESOS-8550] - Bug in `Master::detected()` leads to coredump in `MasterZooKeeperTest.MasterInfoAddress`.