Bug 1301224 - [RFE] Alternate memory allocator support (tcmalloc)
Summary: [RFE] Alternate memory allocator support (tcmalloc)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: Directory Server
Version: 10.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: DS10.1
: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
Petr Bokoc
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-22 22:12 UTC by Nathan Kinder
Modified: 2016-11-07 15:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-07 15:39:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
tcmalloc_vs_glibc_add_srch_mod_del.png (41.25 KB, image/png)
2016-10-18 14:11 UTC, Viktor Ashirov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2665 0 normal SHIPPED_LIVE Red Hat Directory Server bug fix and enhancement update 2016-11-07 20:38:00 UTC

Description Nathan Kinder 2016-01-22 22:12:32 UTC
Jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.

Using the jemalloc library for memory allocation has significantly reduced the memory usage for  389 DS, with no perceptible downside in performance.

We should support using jemalloc for memory allocation as a non-default configuration.

Design Document: http://www.port389.org/docs/389ds/FAQ/jemalloc-testing.html

Comment 1 Viktor Ashirov 2016-07-21 15:26:59 UTC
tail -n 5 /etc/sysconfig/dirsrv
# jemalloc is a general purpose malloc implementation that emphasizes
# fragmentation avoidance and scalable concurrency support.  jemalloc
# has been shown to have a significant positive impact on the Directory
# Server's process size/growth.
#LD_PRELOAD=/usr/lib64/dirsrv/libjemalloc.so.1 ; export LD_PRELOAD

This should be changed to tcmalloc.

Comment 5 Amita Sharma 2016-08-25 14:34:51 UTC
For verification ::

1. yum install gperftools-libs
2. In /etc/sysconfig/dirsrv uncomment LD_PRELOAD=@libdir@/libtcmalloc.so.4  
3. and restart the server
4. Now check :: 

# ps -aef | grep slapd
dirsrv   23745     1  7 19:07 ?        00:00:00 /usr/sbin/ns-slapd -D /etc/dirsrv

# pldd 23745 | grep tcmalloc
/usr/lib64/libtcmalloc.so.4

Also, http://www.port389.org/docs/389ds/FAQ/jemalloc-testing.html can be used for testing.

Comment 6 Viktor Ashirov 2016-10-18 14:11:16 UTC
Created attachment 1211761 [details]
tcmalloc_vs_glibc_add_srch_mod_del.png

Test results with tcmalloc vs glibc malloc:

Memory consumption with tcmalloc was 18-30% lower than using glibc malloc (see attachment)

There is a slight improvement in performance:

[1] Adding 10k entries
glibc:
Average rate:  752.00/thr  ( 752.00/sec), total:   7520

tcmalloc:
Average rate:  803.90/thr  ( 803.90/sec), total:   8039

[2] Modifying 10k entries
glibc:
Average rate: 1272.10/thr  (1272.10/sec), total:  12721

tcmalloc:
Average rate: 1382.00/thr  (1382.00/sec), total:  13820

[3] Searching 10k entries
glibc:
Average rate: 6851.40/thr  (6851.40/sec), total:  68514

tcmalloc:
Average rate: 6924.20/thr  (6924.20/sec), total:  69242

[4] Deleting 10k entries
glibc:
Average rate:  712.90/thr  ( 712.90/sec), total:   7129

tcmalloc:
Average rate:  717.60/thr  ( 717.60/sec), total:   7176

Comment 8 errata-xmlrpc 2016-11-07 15:39:28 UTC
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://rhn.redhat.com/errata/RHBA-2016-2665.html


Note You need to log in before you can comment on or make changes to this bug.