Bug 190220 (libumemSolaris) - Link DS with libumem on Solaris 9 and later
Summary: Link DS with libumem on Solaris 9 and later
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: libumemSolaris
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.0
Hardware: sparc
OS: Linux
high
high
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 152373 240316 FDS1.1.0
TreeView+ depends on / blocked
 
Reported: 2006-04-28 21:32 UTC by Rich Megginson
Modified: 2015-12-07 17:04 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:04:14 UTC
Embargoed:


Attachments (Terms of Use)

Description Rich Megginson 2006-04-28 21:32:22 UTC
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 21:33:57 UTC
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 17:32:14 UTC
-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 17:35:48 UTC
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 17:50:10 UTC
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.