* more testing
authorMichal Voců <michal@ruk.cuni.cz>
Thu, 8 Jun 2006 14:37:15 +0000 (14:37 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Thu, 8 Jun 2006 14:37:15 +0000 (14:37 +0000)
* very eager IL when testing performance (does not sleep, does not rest)
* when connection to bkserver goes down, try to reconnect immediately
  and sleep only after that fails

org.glite.lb.logger/src/input_queue_socket.c
org.glite.lb.logger/src/perftest_il.sh
org.glite.lb.logger/src/queue_thread.c

index dec64aa..bf3c7a2 100644 (file)
@@ -241,14 +241,15 @@ read_event(int sock, long *offset, il_octet_string_t *msg)
  * Returns: -1 on error, 0 if no message available, message length otherwise
  *
  */
-#if 0 && defined(PERF_EVENTS_INLINE)
+#ifdef PERF_EVENTS_INLINE
 int
 input_queue_get(il_octet_string *buffer, long *offset, int timeout)
 {
        static long o = 0;
        int len;
+       char *jobid;
 
-       len = glite_wll_perftest_produceEventString(&buffer->data);
+       len = glite_wll_perftest_produceEventString(&buffer->data, &jobid);
        buffer->len = len;
        if(len) {
                o += len;
index 32dbaf6..fbae3db 100644 (file)
@@ -14,6 +14,7 @@ DEBUG=${DEBUG:-0}
 
 check_test_files || exit 1
 
+COMM_ARGS="-s /tmp/interlogger.perftest --file-prefix=/tmp/perftest.log"
 
 echo "-------------------------------------------"
 echo "Logging test:"
@@ -25,17 +26,18 @@ echo -e "\tsmall_job \t big_job \t small_dag \t big_dag"
 
 
 PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-interlogd-perf-empty
-CONSUMER_ARGS="-d"
+CONSUMER_ARGS="-d $COMM_ARGS"
 
-LOGJOBS_ARGS="--nofile"
+LOGJOBS_ARGS="--nofile $COMM_ARGS"
 echo "Only IPC"
 run_test il $numjobs
 print_result
-LOGJOBS_ARGS=""
+LOGJOBS_ARGS=" $COMM_ARGS"
 echo "IPC & files"
 run_test il $numjobs
 print_result
-rm -f /tmp/dglogd.log.*
+rm -f /tmp/perftest.log.*
+
 
 echo "--------------------------------"
 echo "Interlogger test:"
@@ -45,24 +47,24 @@ echo "--------------------------------"
 echo -e "\tsmall_job \t big_job \t small_dag \t big_dag"
 
 PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-interlogd-perf
-LOGJOBS_ARGS="--nofile"
+LOGJOBS_ARGS="--nofile $COMM_ARGS"
 
-CONSUMER_ARGS="-d --nosend --noparse"
+CONSUMER_ARGS="-d --nosend --noparse $COMM_ARGS"
 echo "No event parsing"
 run_test il $numjobs
 print_result
 
-CONSUMER_ARGS="-d --nosend --nosync"
+CONSUMER_ARGS="-d --nosend --nosync $COMM_ARGS"
 echo "No checking of event files"
 run_test il $numjobs
 print_result
 
-CONSUMER_ARGS="-d --nosend --norecover"
+CONSUMER_ARGS="-d --nosend --norecover $COMM_ARGS"
 echo "No recovery thread"
 run_test il $numjobs
 print_result
 
-CONSUMER_ARGS="-d --nosend"
+CONSUMER_ARGS="-d --nosend $COMM_ARGS"
 echo "Normal operation:"
 run_test il $numjobs
 print_result
@@ -75,29 +77,104 @@ echo "-----------------------------------"
 echo -e "\tsmall_job \t big_job \t small_dag \t big_dag"
 
 PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-interlogd-perf
-LOGJOBS_ARGS=""
+LOGJOBS_ARGS=" $COMM_ARGS"
+
+CONSUMER_ARGS="-d --nosend --noparse $COMM_ARGS"
+echo "No event parsing"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
+CONSUMER_ARGS="-d --nosend --nosync $COMM_ARGS"
+echo "No checking of event files"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
+CONSUMER_ARGS="-d --nosend --norecover $COMM_ARGS"
+echo "No recovery thread"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
+CONSUMER_ARGS="-d --nosend $COMM_ARGS"
+echo "Normal operation:"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
 
-CONSUMER_ARGS="-d --nosend --noparse"
+echo "-------------------------------"
+echo "Interlogger test:"
+echo "  - events sent through IPC"
+echo "  - events consumed by empty BS"
+echo "-------------------------------"
+
+PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-bkserverd
+CONSUMER_ARGS="-d --perf-sink=1"
+PERFTEST_COMPONENT=$STAGEDIR/bin/glite-lb-interlogd-perf
+LOGJOBS_ARGS="--nofile $COMM_ARGS"
+
+
+COMPONENT_ARGS="-d  --noparse $COMM_ARGS"
 echo "No event parsing"
 run_test il $numjobs
 print_result
-rm -f /tmp/dglogd.log.*
+rm -f /tmp/perftest.log.*
 
-CONSUMER_ARGS="-d --nosend --nosync"
+COMPONENT_ARGS="-d  --nosync $COMM_ARGS"
 echo "No checking of event files"
 run_test il $numjobs
 print_result
-rm -f /tmp/dglogd.log.*
+rm -f /tmp/perftest.log.*
 
-CONSUMER_ARGS="-d --nosend --norecover"
+COMPONENT_ARGS="-d  --norecover $COMM_ARGS"
 echo "No recovery thread"
 run_test il $numjobs
 print_result
-rm -f /tmp/dglogd.log.*
+rm -f /tmp/perftest.log.*
 
-CONSUMER_ARGS="-d --nosend"
+COMPONENT_ARGS="-d $COMM_ARGS"
 echo "Normal operation:"
 run_test il $numjobs
 print_result
-rm -f /tmp/dglogd.log.*
+rm -f /tmp/perftest.log.*
+
+
+echo "-----------------------------------"
+echo "Interlogger test:"
+echo "  - events sent through IPC & files"
+echo "  - events consumed by empty BS"
+echo "-----------------------------------"
+
+PERFTEST_CONSUMER=$STAGEDIR/bin/glite-lb-bkserverd
+CONSUMER_ARGS="-d --perf-sink=1"
+PERFTEST_COMPONENT=$STAGEDIR/bin/glite-lb-interlogd-perf
+LOGJOBS_ARGS=" $COMM_ARGS"
+
+
+COMPONENT_ARGS="-d  --noparse $COMM_ARGS"
+echo "No event parsing"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
+COMPONENT_ARGS="-d  --nosync $COMM_ARGS"
+echo "No checking of event files"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
+COMPONENT_ARGS="-d  --norecover $COMM_ARGS"
+echo "No recovery thread"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
+COMPONENT_ARGS="-d $COMM_ARGS"
+echo "Normal operation:"
+run_test il $numjobs
+print_result
+rm -f /tmp/perftest.log.*
+
 
index 9ee4f27..8cdfb2c 100644 (file)
@@ -33,6 +33,7 @@ queue_thread(void *q)
 {
        struct event_queue *eq = (struct event_queue *)q;
        int ret, exit;
+       int retrycnt;
 
        if(init_errors(0) < 0) {
                il_log(LOG_ERR, "Error initializing thread specific data, exiting!");
@@ -46,6 +47,7 @@ queue_thread(void *q)
        event_queue_cond_lock(eq);
 
        exit = 0;
+       retrycnt = 0;
        while(!exit) {
     
                clear_error();
@@ -83,7 +85,9 @@ queue_thread(void *q)
 #else
                        il_log(LOG_INFO, "    could not connect to bookkeeping server %s, waiting for retry\n", eq->dest_name);
 #endif
+                       retrycnt++;
                } else {
+                       retrycnt = 0;
                        /* connected, send events */
                        switch(ret=event_queue_send(eq)) {
                                
@@ -133,8 +137,12 @@ queue_thread(void *q)
 
                /* if there was some error with server, sleep for a while */
                /* iff !event_queue_empty() */
-               if(ret == 0) 
+               /* also allow for one more try immediately after server disconnect,
+                  which may cure server kicking us out after given number of connections */
+#ifndef LB_PERF
+               if((ret == 0) && (retrycnt == 0)) 
                        event_queue_sleep(eq);
+#endif
 
                if(exit) {
                        /* we have to clean up before exiting */