Uncached grp and pwd calls make duplicity slow with large group and passwd maps
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned | ||
duplicity (Ubuntu) |
Fix Released
|
Medium
|
Chris J Arges | ||
Precise |
Fix Released
|
Medium
|
Chris J Arges | ||
Quantal |
Fix Released
|
Medium
|
Chris J Arges |
Bug Description
With large /etc/group and /etc/passwd files, duplicity spends the vast majority of its time mapping group and user names to gids and uids. This is with duplicity 0.6.18-0ubuntu3 on Ubuntu 12.04 and Python 2.7.3.
I have a largish group map (7MB, with many group entries having lines in the 100KB - 200KB range.) A zero change incremental backup of ~200k files takes about 23 minutes.
Profiling the duplicity run shows that 92% of the time is spent calling grp.getgrnam! Another ~2% is spent calling grp.getgrgid, pwd.getpwnam, and pwd.getpwuid.
Some simple caching of caching of this information would make a big improvement.
--
SRU Justification:
[Impact]
* This fix should be backported into Precise LTS because users of duplicity with large group/passwd files will encounter performance issues.
[Test Case]
* Using a large group/passwd file configuration, perform a backup and record the time it takes to backup. Profile this as well and determine how much time is spent in grp.getgrnam. Compare this with the patched version and ensure improvement in performance.
[Regression Potential]
* This is a backported patch, and is currently in the latest duplicity. However; because it is a new feature we will need to ensure backups work as expected with this patch.
Related branches
- Kenneth Loafman: Pending requested
-
Diff: 134 lines (+70/-9)3 files modifiedduplicity/cached_ops.py (+62/-0)
duplicity/path.py (+6/-5)
duplicity/tarfile.py (+2/-4)
Changed in duplicity: | |
status: | New → Fix Committed |
description: | updated |
Changed in duplicity (Ubuntu Precise): | |
importance: | Undecided → Medium |
status: | New → Incomplete |
status: | Incomplete → In Progress |
assignee: | nobody → Chris J Arges (christopherarges) |
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.6.21 |
Changed in duplicity (Ubuntu): | |
assignee: | nobody → Chris J Arges (christopherarges) |
status: | New → In Progress |
Changed in duplicity (Ubuntu Quantal): | |
assignee: | nobody → Chris J Arges (christopherarges) |
importance: | Undecided → Medium |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
Attached is a patch that backports this fix to precise. people. canonical. com/~arges/ lp1013446/
A 64-bit build is available here for testing: http://