Bug 190220 - (libumemSolaris) Link DS with libumem on Solaris 9 and later
Link DS with libumem on Solaris 9 and later
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
1.0
sparc Linux
high Severity high
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 152373 240316 FDS1.1.0
  Show dependency treegraph
 
Reported: 2006-04-28 17:32 EDT by Rich Megginson
Modified: 2015-12-07 12:04 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 12:04:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rich Megginson 2006-04-28 17:32:22 EDT
The latest updates of Solaris 9 are supposed to include libumem.  Solaris 10
includes it.  This will greatly speed up malloc performance in SMP systems -
essentially, a replacement for SmartHeap.
Comment 1 Rich Megginson 2006-04-28 17:33:57 EDT
http://blogs.sun.com/roller/page/DirectoryManager?entry=little_known_performance_enhancements_2

"By default, the Directory Server will use the mtmalloc memory manager, which
was intended to help provide better memory allocation performance than the
standard single-threaded malloc. Unfortunately, it doesn't quite live up to its
intended purpose. However, Solaris 10 introduces the new libumem memory manager,
and it has been backported to most versions of Solaris 9 (I believe update 3 or
later). It is far better than mtmalloc in virtually every respect, and it will
generally allow the server to go faster and consume less memory. To configure
the server to use libumem rather than mtmalloc, edit the start-slapd script to
add the following:

   |# Use the libumem memory manager.|
   |LD_PRELOAD=/usr/lib/libumem.so|
   |LD_PRELOAD_64=/usr/lib/64/libumem.so|
   |export LD_PRELOAD LD_PRELOAD_64|


Note that you can do this with Solaris on SPARC-based systems as well, but in
general this is not necessary because on that platform we use a third-party
allocator that accomplishes the same thing. " 
Comment 2 Rich Megginson 2007-10-09 13:32:14 EDT
-10-05 15:38:46.000000000 -0600
--- initconfig.in	2007-10-09 11:32:01.000000000 -0600
***************
*** 20,22 ****
--- 20,30 ----
  # KRB5_KTNAME=@instconfigdir@/slapd-instance/keytab ; export KRB5_KTNAME
  
  # other environment settings can be added here too
+ OS=`uname -s`
+ if [ "$OS" = "SunOS" ] ; then
+     # use the new mt slab memory allocator on Solaris
+     # this requires Solaris 9 update 3 or later
+     LD_PRELOAD=/usr/lib/libumem.so
+     LD_PRELOAD_64=/usr/lib/64/libumem.so
+     export LD_PRELOAD LD_PRELOAD_64
+ fi
Comment 3 Rich Megginson 2007-10-09 13:35:48 EDT
Better patch.
*** initconfig.in.~1.1.~	2007-10-05 15:38:46.000000000 -0600
--- initconfig.in	2007-10-09 11:35:03.000000000 -0600
***************
*** 20,22 ****
--- 20,33 ----
  # KRB5_KTNAME=@instconfigdir@/slapd-instance/keytab ; export KRB5_KTNAME
  
  # other environment settings can be added here too
+ OS=`uname -s`
+ # use the new mt slab memory allocator on Solaris
+ # this requires Solaris 9 update 3 or later
+ if [ "$OS" = "SunOS" -a -f /usr/lib/libumem.so ] ; then
+     LD_PRELOAD=/usr/lib/libumem.so
+     export LD_PRELOAD
+ fi
+ if [ "$OS" = "SunOS" -a -f /usr/lib/64/libumem.so ] ; then
+     LD_PRELOAD_64=/usr/lib/64/libumem.so
+     export LD_PRELOAD_64
+ fi
Comment 4 Rich Megginson 2007-10-09 13:50:10 EDT
Checking in initconfig.in;
/cvs/dirsec/ldapserver/ldap/admin/src/initconfig.in,v  <--  initconfig.in
new revision: 1.2; previous revision: 1.1
done

Reviewed by: nkinder (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: See if libumem.so exists, and set the appropriate LD_PRELOAD
env. var. if so.
Platforms tested: Solaris 9 64-bit
Flag Day: no
Doc impact: no 

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