[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Router directory scanning policy



Doing some testing of zmailer, I poured a whole load of mail into it
and its whilst its doing more or less as I wanted, I've built up a
fair backlog in the router.

The problem is that the router code scans the directory every 10s, so
if your directory gets huge it takes an age. I was going to change the
code so that so that if it has more than MAXROUTERCHILDS worth of
outstanding work it doesn't bother to scan the directories (or rather
it abandons the scan) - something like this (this is untested):

Index: daemonsub.c
===================================================================
RCS file: /cvsroot/upstream/zmailer/router/daemonsub.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 daemonsub.c
--- daemonsub.c 9 Jun 2003 14:08:46 -0000       1.1.1.1
+++ daemonsub.c 4 Sep 2003 16:36:40 -0000
@@ -1576,11 +1576,16 @@
  
            time(&now);
            if (now > nextdirscan) {
+             int wrkcount = 0;
              nextdirscan = now + 10;
  
              for (i = 0; i < ROUTERDIR_CNT; ++i) {
-               if (routerdirs2[i])
+               if (routerdirs2[i]) {
+                 wrkcount += dirq[i]->wrkcount;
+                 if (wrkcount >= MAXROUTERCHILDS)
+                   break;
                  dirqueuescan(routerdirs2[i], dirq[i], 1);
+               }
              }
            }
  

Good plan/bad plan?

-- 
Alex Kiernan, Principal Engineer, Development, THUS plc
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi