From 4dc4e4b770fc5fa1aeebc41223ede9195ede4965 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sat, 4 Aug 2012 12:21:42 +0530 Subject: syncop: Added scaling down logic RCA: Whenever the self-heald tests are done with more than 16 replicates The number of sync procs goes to > 2. These threads never die. Fix: Added scaling down logic in syncops so that the threads terminate themselves whenever the extra thread is idle for ~10 minutes. Minimum number of threads is still 2. Tests: Added logs for launching and terminating procs, made timeout to 6 seconds and ran volume-heal in a while loop. After logs say max number of procs are launched, attached process to gdb and verified that the number of syncop threads are 16. Stopped volume-heal and observed the logs for terminating the procs. Attached gdb to process again to check that the syncop threads are just 2. Did this 5 times. Things worked fine. Which procs were terminated was random. No proc structure was erroneously re-used. Procs never exceeded 16 and were never < 2. Change-Id: I61dd9c25cc478ac8cbda190bee841a995b93c55c BUG: 814074 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/3195 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/syncop.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libglusterfs/src/syncop.h') diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 619fe7119..3aa3c1d01 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -23,6 +23,7 @@ #define SYNCENV_PROC_MAX 16 #define SYNCENV_PROC_MIN 2 +#define SYNCPROC_IDLE_TIME 600 struct synctask; struct syncproc; -- cgit