[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: How overlays effect performance



Herb Hrowal wrote:

I'm currently writing an overlay for our installation. All I have done
currently is a basic shell that just intercepts searches and responses
and passes them on (e.g., no processing of any kind is done). When the
overlay is enabled I see a 25% - 30% hit on performance. As I add code
to the overlay I'm sure the performance will degrade further.
Performance is a big deal for us since each slapd process handles
upwards of 15 million requests per day.

I read on this list a few months back that OpenLDAP 2.3 has
improvements in the overlay support code. Do these improvements
address performance issues at all?


This is rather surprising. I wrote up a noop overlay after reading your email and found it has no measurable impact on server performance:

#include "portable.h"

#ifdef SLAPD_OVER_DUMMY

#include <stdio.h>

#include <ac/string.h>
#include <ac/socket.h>

#include "slap.h"

/* This overlay does nothing useful, it just intercepts operations and
* passes them through unchanged.
*/

static void *foo;

static int
dummy_func( Operation *op, SlapReply *rs )
{
   slap_overinst       *on = (slap_overinst *) op->o_bd->bd_info;
   void        *oi = on->on_bi.bi_private;

   foo = oi;

   return SLAP_CB_CONTINUE;
}

static int
dummy_resp( Operation *op, SlapReply *rs )
{
   return SLAP_CB_CONTINUE;
}

/* This overlay is set up for dynamic loading via moduleload. For static
* configuration, you'll need to arrange for the slap_overinst to be
* initialized and registered by some other function inside slapd.
*/

static slap_overinst dummy;

int
dummy_init( void )
{
   memset( &dummy, 0, sizeof( slap_overinst ) );
   dummy.on_bi.bi_type = "dummy";

   dummy.on_bi.bi_op_bind = dummy_func;
   dummy.on_bi.bi_op_search = dummy_func;
   dummy.on_bi.bi_op_compare = dummy_func;
   dummy.on_bi.bi_op_modify = dummy_func;
   dummy.on_bi.bi_op_modrdn = dummy_func;
   dummy.on_bi.bi_op_add = dummy_func;
   dummy.on_bi.bi_op_delete = dummy_func;
   dummy.on_bi.bi_extended = dummy_func;
   dummy.on_bi.bi_op_unbind = dummy_func;

   dummy.on_response = dummy_resp;

   return overlay_register( &dummy );
}

#if SLAPD_OVER_DUMMY == SLAPD_MOD_DYNAMIC
int
init_module( int argc, char *argv[] )
{
   return dummy_init();
}
#endif /* SLAPD_OVER_DUMMY == SLAPD_MOD_DYNAMIC */

#endif /* defined(SLAPD_OVER_DUMMY) */

--
 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support