Bug 1608749
Summary: | high cpu consumption by trickle thread | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Ludwig <lkrispen> | |
Component: | libdb | Assignee: | Petr Kubat <pkubat> | |
Status: | CLOSED ERRATA | QA Contact: | Vaclav Danek <vdanek> | |
Severity: | unspecified | Docs Contact: | Lenka Špačková <lkuprova> | |
Priority: | unspecified | |||
Version: | 7.4 | CC: | databases-maint, gparente, hhorak, jamills, jaredl, mmuzila, pkubat, tmihinto, vashirov, vdanek, yoliynyk | |
Target Milestone: | rc | Keywords: | Patch | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libdb-5.3.21-25.el7 | Doc Type: | Bug Fix | |
Doc Text: |
.Optimized CPU consumption by `libdb`
A previous update to the `libdb` database caused an excessive CPU consumption in the trickle thread. With this update, the CPU usage has been optimized.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1670768 (view as bug list) | Environment: | ||
Last Closed: | 2019-08-06 12:50:50 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1630906, 1630914, 1661173, 1670768 |
Description
Ludwig
2018-07-26 09:07:50 UTC
Viktor had run perf on a process showing: 25.75% libdb-5.3.so [.] __memp_purge_dead_files 24.25% libdb-5.3.so [.] __memp_stat_hash This got introduced with the fix for bug 1277887 which adds a call to `__memp_purge_dead_files` into the trickle code: diff -U 5 -r db-5.3.21.old/src/mp/mp_trickle.c db-5.3.21/src/mp/mp_trickle.c --- db-5.3.21.old/src/mp/mp_trickle.c 2012-05-12 01:57:53.000000000 +0800 +++ db-5.3.21/src/mp/mp_trickle.c 2016-10-25 17:27:57.000000000 +0800 @@ -65,10 +65,14 @@ "DB_ENV->memp_trickle: %d: percent must be between 1 and 100", "%d"), pct); return (EINVAL); } + /* First we purge all dead files and their buffers. */ + if ((ret = __memp_purge_dead_files(env)) != 0) + return (ret); + /* * Loop through the caches counting total/dirty buffers. * * XXX * Using hash_page_dirty is our only choice at the moment, but it's not So it makes sense you are seeing a downgrade in performance as the `__memp_purge_dead_files` operation is quite expensive (checks all buffers that could be possibly freed). This is then followed by a loop over all the caches counting up total/dirty buffers (using `__memp_stat_hash`) - basically the same loop `__memp_purge_dead_files` is doing so that explains why they take up a similar amount of cpu. I guess we could try to combine these two loops (should likely halve the cpu usage) but it would in any case result in some duplicate code... That said if the customer is experiencing additional cpu usage that is larger than 100% of what they were experiencing before (since the `__memp_stat_hash` loop is not new) it could be just that the trickle function is called too often... Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2121 |