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

Re: (ITS#4308) poor performance under load



This is a multi-part message in MIME format.
--------------060206050209000509010702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Try this patch and see if it behaves better.

KevinS@bmrb.co.uk wrote:
> Okay, thanks for the pointers.  now running a slapd compiled with debug
> symbols, without optimization and not stripped.
>
> Heres the backtrace from that thread when slapd is under load from
> ldapsearch...
> #0  0xff01fb74 in time () from /usr/lib/libc.so.1
> #1  0x00176eac in ldap_pvt_runqueue_resched (rq=0x2f6388,
> entry=0x9489c48,
>     defer=0) at rq.c:174
> #2  0x000494b0 in slapd_daemon_task (ptr=0x0) at daemon.c:1797
> #3  0xfef157bc in _lwp_start () from /usr/lib/libthread.so.1


-- 
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/


--------------060206050209000509010702
Content-Type: text/plain;
 name="dif.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="dif.txt"

Index: cache.c
===================================================================
RCS file: /repo/OpenLDAP/pkg/ldap/servers/slapd/back-bdb/cache.c,v
retrieving revision 1.113
diff -u -r1.113 cache.c
--- cache.c	3 Jan 2006 22:12:16 -0000	1.113
+++ cache.c	6 Jan 2006 02:09:20 -0000
@@ -643,11 +643,18 @@
 			ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
 			if ( bdb->bi_cache_task ) {
 				if ( !ldap_pvt_runqueue_isrunning( &slapd_rq,
-					bdb->bi_cache_task ))
+					bdb->bi_cache_task )) {
+					struct re_s *task = bdb->bi_cache_task;
+
+					/* We want it to start right now */
+					task->interval.tv_sec = 0;
 					ldap_pvt_runqueue_resched( &slapd_rq, bdb->bi_cache_task,
 						0 );
+					/* But don't try to reschedule it while it's running */
+					task->interval.tv_sec = 3600;
+				}
 			} else {
-				bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 0,
+				bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 3600,
 					bdb_cache_lru_purge, bdb, "bdb_cache_lru_purge",
 					bdb->bi_dbenv_home );
 			}

--------------060206050209000509010702--