Change in vdsm[master]: scale: limit cpu usage using cpu-affinity
nsoffer at redhat.com
nsoffer at redhat.com
Wed Sep 9 16:26:57 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: scale: limit cpu usage using cpu-affinity
......................................................................
Patch Set 9:
(7 comments)
Generally look good but you seem to missed a comment from an older version.
https://gerrit.ovirt.org/#/c/45738/9//COMMIT_MSG
Commit Message:
Line 9: To reduce the impact of the GIL, we want to pin
Line 10: VDSM threads to few cores, maybe just one.
Line 11:
Line 12: Initial results using taskset manually provided very
Line 13: interesting results (more details in rhbz#1247075):
We have too many ways to refer to bugs (bug 123, BZ123, rhbz#123, #123). We need one way that can work for any bug. I think the best way is using links like this [1]
[1] https://bugzilla.redhat.com/123
Line 14:
Line 15: VDSM was tested while running ~100 idle VMs, pinning
Line 16: the daemon to less and less core, down to just one.
Line 17: The load changed in an impressive way, started from
Line 12: Initial results using taskset manually provided very
Line 13: interesting results (more details in rhbz#1247075):
Line 14:
Line 15: VDSM was tested while running ~100 idle VMs, pinning
Line 16: the daemon to less and less core, down to just one.
s/daemon/vdsmd/
s/core/cores/
Line 17: The load changed in an impressive way, started from
Line 18: fluctuating around 1000-2500% (no pinning) down to
Line 19: average around 30%, rarely peaks close to 100% (pinned
Line 20: to one core).
https://gerrit.ovirt.org/#/c/45738/9/configure.ac
File configure.ac:
Line 312: AC_PATH_PROG([SU_PATH], [su], [/bin/su])
Line 313: AC_PATH_PROG([SYSCTL_PATH], [sysctl], [/sbin/sysctl])
Line 314: AC_PATH_PROG([SYSTEMD_RUN_PATH], [systemd-run], [/usr/bin/systemd-run])
Line 315: AC_PATH_PROG([TAR_PATH], [tar], [/bin/tar])
Line 316: AC_PATH_PROG([TASKSET_PATH], [taskset], [/usr/bin/taskset])
Lets keep this instead of CommandPath for now, since we have a circular dependency if we use CommandPath.
To use CommadPath we will have to move all instances to one module so we can import it to any code.
Line 317: AC_PATH_PROG([TC_PATH], [tc], [/sbin/tc])
Line 318: AC_PATH_PROG([TEE_PATH], [tee], [/usr/bin/tee])
Line 319: AC_PATH_PROG([TOUCH_PATH], [touch], [/bin/touch])
Line 320: AC_PATH_PROG([TUNE2FS_PATH], [tune2fs], [/sbin/tune2fs])
https://gerrit.ovirt.org/#/c/45738/9/lib/vdsm/cmdutils.py
File lib/vdsm/cmdutils.py:
Line 66: command.extend(cmd)
Line 67: return command
Line 68:
Line 69:
Line 70: def taskset(cmd, cpu_list, all_tasks=False):
We don't need all_tasks here, since we start a new process. See my comment in older version.
Line 71: command = [constants.EXT_TASKSET]
Line 72: if all_tasks:
Line 73: command.append("--all-tasks")
Line 74: command.extend(("--cpu-list", ",".join(cpu_list)))
https://gerrit.ovirt.org/#/c/45738/9/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 642: finish, the new subprocess would die immediately.
Line 643: """
Line 644:
Line 645: if resetCpuAffinity and config.get('vars', 'cpu_affinity'):
Line 646: # only the main VDSM process whould be bound
# Only vdsm itself should be bound?
Line 647: command = cmdutils.taskset(command, _ANY_CPU, all_tasks=True)
Line 648:
Line 649: if ioclass is not None:
Line 650: command = cmdutils.ionice(command, ioclass=ioclass,
Line 643: """
Line 644:
Line 645: if resetCpuAffinity and config.get('vars', 'cpu_affinity'):
Line 646: # only the main VDSM process whould be bound
Line 647: command = cmdutils.taskset(command, _ANY_CPU, all_tasks=True)
all_taks not needed and should be removed form cmdutils.taskset
Line 648:
Line 649: if ioclass is not None:
Line 650: command = cmdutils.ionice(command, ioclass=ioclass,
Line 651: ioclassdata=ioclassdata)
https://gerrit.ovirt.org/#/c/45738/9/tests/utilsTests.py
File tests/utilsTests.py:
Line 75: self.assertEquals(counter[0], limit)
Line 76:
Line 77:
Line 78: @expandPermutations
Line 79: class PidStatTests(TestCaseBase):
> this fails, and this means that utils.pgrep(), which uses comm attribute, m
Can you explain this failure?
Line 80:
Line 81: @permutations([[True], [False]])
Line 82: @MonkeyPatch(utils, 'config',
Line 83: make_config([('vars', 'cpu_affinity', '1')]))
--
To view, visit https://gerrit.ovirt.org/45738
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3f7f68d65eddb5a21afbc3809ea79cd1dee67984
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list