Modified to compare several scenarios:
authorJan Pospíšil <honik@ntc.zcu.cz>
Sun, 15 Oct 2006 21:36:30 +0000 (21:36 +0000)
committerJan Pospíšil <honik@ntc.zcu.cz>
Sun, 15 Oct 2006 21:36:30 +0000 (21:36 +0000)
0) registration only to bkserver (edg_wll_RegisterJobSync)
1) dual registration (edg_wll_RegisterJobProxy)
2) old (not dual) registration (edg_wll_RegisterJobProxyOld)
3) two separate registrations (edg_wll_RegisterJobSync + edg_wll_RegisterJobProxyOnly)

org.glite.lb.client/src/perftest_jobreg.c
org.glite.lb.client/src/perftest_jobreg.sh

index 9017f38..450206a 100644 (file)
@@ -29,9 +29,13 @@ extern int opterr,optind;
 
 static void usage(char *me)
 {
-       fprintf(stderr,"usage: %s [-m bkserver] [-x] [-n num_subjobs [-S]] [-l jdl_file] [-N num_repeat]\n"
+       fprintf(stderr,"usage: %s [-m bkserver] [-x scenario] [-n num_subjobs [-S]] [-l jdl_file] [-N num_repeat]\n"
                "       -m <bkserver>           address:port of bkserver\n"
-               "       -x                      use LBProxy\n"
+               "       -x <scenario>           use LBProxy\n"
+               "          1                    use one call (RegisterJobProxy - dual registration) \n"
+               "          2                    use one call (RegisterJobProxyOld - sequence registration) \n"
+               "          3                    use two separate calls (RegisterJob and RegisterJobProxyOnly) \n"
+               "          0 (or anything else) do not register to lbproxy at all\n"
                "       -n <num_subjobs>        number of subjobs of DAG\n"
                "       -S                      register subjobs\n"
                "       -l <jdl_file>           file with JDL\n"
@@ -54,8 +58,8 @@ int main(int argc, char *argv[])
        opterr = 0;
 
        do {
-               switch (getopt(argc,argv,"xm:n:Sl:N:v")) {
-                       case 'x': lbproxy = 1; break;
+               switch (getopt(argc,argv,"x:m:n:Sl:N:v")) {
+                       case 'x': lbproxy = optarg ? atoi(optarg):1; break;
                        case 'm': server = strdup(optarg); break;
                        case 'n': num_subjobs = atoi(optarg); break;
                        case 'S': if (num_subjobs>0) { reg_subjobs = 1; break; }
@@ -67,6 +71,8 @@ int main(int argc, char *argv[])
                }
        } while (!done);
 
+       if ((lbproxy > 3) || (lbproxy < 0)) lbproxy = 1;
+
        if (!server && !lbproxy) {
                fprintf(stderr,"%s: either -m server or -x has to be specified\n",argv[0]);
                exit(1);
@@ -112,30 +118,66 @@ int main(int argc, char *argv[])
        gettimeofday(&start, NULL);
 
        for (i=0; i<N; i++) {
-               if (server) {
-                       if (edg_wll_RegisterJobSync(ctx,jobids[i],
-                               num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
-                               jdl ? jdl : "blabla", "NNNSSSS",
-                               num_subjobs,NULL,&subjobs))
-                       {
-                               char    *et,*ed;
-                               edg_wll_Error(ctx,&et,&ed);
-                               fprintf(stderr,"edg_wll_RegisterJobSync(): %s (%s)\n",et,ed);
-                               exit(1);
-                       }
-               }
-               if (lbproxy) {
-                       if (edg_wll_RegisterJobProxyOnly(ctx,jobids[i],
-                               num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
-                               jdl ? jdl : "blabla", "NNNSSSS",
-                               num_subjobs,NULL,&subjobs))
-                       {
-                               char    *et,*ed;
-                               edg_wll_Error(ctx,&et,&ed);
-                               fprintf(stderr,"edg_wll_RegisterJobProxyOnly(): %s (%s)\n",et,ed);
-                               exit(1);
-                       }
-               } 
+               switch (lbproxy) {
+                       case 0: /* register to bkserver only */
+                               if (edg_wll_RegisterJobSync(ctx,jobids[i],
+                                       num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
+                                       jdl ? jdl : "blabla", "NNNSSSS",
+                                       num_subjobs,NULL,&subjobs))
+                               {
+                                       char    *et,*ed;
+                                       edg_wll_Error(ctx,&et,&ed);
+                                       fprintf(stderr,"edg_wll_RegisterJobSync(): %s (%s)\n",et,ed);
+                                       exit(1);
+                               }
+                               break;
+                       case 1: /* dual registration */
+                               if (edg_wll_RegisterJobProxy(ctx,jobids[i],
+                                       num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
+                                       jdl ? jdl : "blabla", "NNNSSSS",
+                                       num_subjobs,NULL,&subjobs))
+                               {
+                                       char    *et,*ed;
+                                       edg_wll_Error(ctx,&et,&ed);
+                                       fprintf(stderr,"edg_wll_RegisterJobProxy(): %s (%s)\n",et,ed);
+                                       exit(1);
+                               }
+                               break;
+                       case 2: /* old (not dual) registration */
+                               if (edg_wll_RegisterJobProxyOld(ctx,jobids[i],
+                                       num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
+                                       jdl ? jdl : "blabla", "NNNSSSS",
+                                       num_subjobs,NULL,&subjobs))
+                               {
+                                       char    *et,*ed;
+                                       edg_wll_Error(ctx,&et,&ed);
+                                       fprintf(stderr,"edg_wll_RegisterJobProxyOld(): %s (%s)\n",et,ed);
+                                       exit(1);
+                               }
+                               break;
+                       case 3: /* two calls: register to bkserver and then to lbproxy only */
+                               if (edg_wll_RegisterJobSync(ctx,jobids[i],
+                                       num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
+                                       jdl ? jdl : "blabla", "NNNSSSS",
+                                       num_subjobs,NULL,&subjobs))
+                               {
+                                       char    *et,*ed;
+                                       edg_wll_Error(ctx,&et,&ed);
+                                       fprintf(stderr,"edg_wll_RegisterJobSync(): %s (%s)\n",et,ed);
+                                       exit(1);
+                               }
+                               if (edg_wll_RegisterJobProxyOnly(ctx,jobids[i],
+                                       num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
+                                       jdl ? jdl : "blabla", "NNNSSSS",
+                                       num_subjobs,NULL,&subjobs))
+                               {
+                                       char    *et,*ed;
+                                       edg_wll_Error(ctx,&et,&ed);
+                                       fprintf(stderr,"edg_wll_RegisterJobProxyOnly(): %s (%s)\n",et,ed);
+                                       exit(1);
+                               }
+                               break;
+               }       
 
                if (reg_subjobs) {
                        char ** jdls = (char**) malloc(num_subjobs*sizeof(char*));
@@ -144,22 +186,21 @@ int main(int argc, char *argv[])
                                asprintf(jdls+j, "JDL of subjob #%d\n", j+1);
                        }
 
-                       if (server) {
-                               if (edg_wll_RegisterSubjobs(ctx, jobids[i], (const char **) jdls, NULL, subjobs)) {
+                       if (lbproxy) {
+                               if (edg_wll_RegisterSubjobsProxy(ctx, jobids[i], (const char **) jdls, NULL, subjobs)) {
                                        char    *et,*ed;
                                        edg_wll_Error(ctx,&et,&ed);
-                                       fprintf(stderr,"edg_wll_RegisterSubjobs: %s (%s)\n", et, ed);
+                                       fprintf(stderr,"edg_wll_RegisterSubjobsProxy: %s (%s)\n", et, ed);
                                        exit(1);
                                }
-                       }
-                       if (lbproxy) {
-                               if (edg_wll_RegisterSubjobsProxy(ctx, jobids[i], (const char **) jdls, NULL, subjobs)) {
+                       } else {
+                               if (edg_wll_RegisterSubjobs(ctx, jobids[i], (const char **) jdls, NULL, subjobs)) {
                                        char    *et,*ed;
                                        edg_wll_Error(ctx,&et,&ed);
-                                       fprintf(stderr,"edg_wll_RegisterSubjobsProxy: %s (%s)\n", et, ed);
+                                       fprintf(stderr,"edg_wll_RegisterSubjobs: %s (%s)\n", et, ed);
                                        exit(1);
                                }
-                       } 
+                       }
 
                        for (j=0; subjobs[j]; j++) free(jdls[j]);
                }
index 1cd1ecb..a4914ba 100755 (executable)
@@ -22,7 +22,7 @@ test_credentials()
 
         if test -z "$creds"; then
                 if [ -r /etc/grid-security/hostkey.pem -a -r /etc/grid-security/hostcert.pem ]; then
-                        creds="-c /etc/grid-security/hostcert.pem -k /etc/grid-security/hostkey.pem"
+                        creds="-c /etc/grid-security/hostcert.pem -k /etc/grid-security/hostkey.pem -C /etc/grid-security/certificates"
                 fi
         fi
         [ -z "$creds" ] && \
@@ -242,6 +242,59 @@ quick_test()
 
 }
 
+proxy_test()
+{
+       echo "----------------------------------------------------------------
+Scenarios:
+0) registration only to bkserver (edg_wll_RegisterJobSync)
+1) dual registration (edg_wll_RegisterJobProxy)        
+2) old (not dual) registration (edg_wll_RegisterJobProxyOld)
+3) two separate registrations (edg_wll_RegisterJobSync + edg_wll_RegisterJobProxyOnly)
+
+"
+        if [ -n "$1" ]; then
+                repeat="-N $1"
+                repeated="repeated $1 times"
+               scale=$1
+        else
+                repeat=""
+                repeated=""
+               scale=1
+        fi
+
+       # single registration
+       #
+       for i in 0 1 2 3; do
+               dest="-m $HOST:$PORT -x $i"
+               my_echo "-n single registration $repeated (scenario $i)..."
+               ai_sr_lb=`$GLITE_LOCATION/sbin/glite-lb-perftest_jobreg $dest $repeat`
+               mega_actions_per_day=`echo "scale=6; 86400/$ai_sr_lb/1000000*$scale" | bc`
+               my_echo ". $ai_sr_lb seconds ($mega_actions_per_day GU)"
+       done
+
+       # 1000 nodes DAG registration
+       #
+       for i in 0 1 2 3; do
+               dest="-m $HOST:$PORT -x $i"
+               my_echo "-n 1000 nodes DAG registration $repeated (scenario $i)..."
+               ai_dag1000_lb=`$GLITE_LOCATION/sbin/glite-lb-perftest_jobreg $dest $repeat -n 1000`
+               mega_actions_per_day=`echo "scale=6; 86400/$ai_dag1000_lb/1000000*1001*$scale" | bc`
+               my_echo ". $ai_dag1000_lb seconds ($mega_actions_per_day GU)"
+       done
+
+       # 10000 nodes DAG registration
+       #
+       for i in 0 1 2 3; do
+               dest="-m $HOST:$PORT -x $i"
+               my_echo "-n 10000 nodes DAG registration $repeated (scenario $i)..."
+               ai_dag10000_lb=`$GLITE_LOCATION/sbin/glite-lb-perftest_jobreg $dest $repeat -n 10000`
+               mega_actions_per_day=`echo "scale=6; 86400/$ai_dag10000_lb/1000000*10001*$scale" | bc`
+               my_echo ". $ai_dag10000_lb seconds ($mega_actions_per_day GU)"
+       done
+
+
+}
+
 
 ################################################################################
 
@@ -257,31 +310,55 @@ sink_mode[4]=GLITE_LB_SINK_SEND
 test_glite_location;
 test_credentials;
 
-start_bkserver 0;
-my_echo "================================================================"
-my_echo "Testing LB server with sink_mode ${sink_mode[0]}"
-
-sleep 5
-sync
-sleep 5
-
-for i in `seq 1 10000`; do
-       quick_test server 0;
-done
-stop_bkserver;
-
+#
+# QUICK TEST
+#
+#start_bkserver 0;
+#start_proxy 0;
+#my_echo "================================================================"
+#my_echo "Testing LB server with sink_mode ${sink_mode[0]}"
+#my_echo "Testing LB proxy with sink_mode ${sink_mode[0]}"
+#sleep 5
+#sync
+#sleep 5
+#for i in `seq 1 10000`; do
+#      quick_test server 0;
+##     quick_test proxy 0;
+#done
+#stop_bkserver;
+#stop_proxy;
 
+#
+# SINK TEST
+#
 #for i in 1 2 3 4; do
-
+#      my_echo "================================================================"
+#
+#      my_echo "Testing LB proxy with sink_mode ${sink_mode[$i]}"
 #      start_proxy $i
 #      test_ai proxy $i;
 #      stop_proxy
-
+#
+#      my_echo "Testing LB server with sink_mode ${sink_mode[$i]}"
 #      start_bkserver $i;
 #      test_ai server $i;
 #      stop_bkserver;
 #done
 
+#
+# PROXY TEST
+#
+start_bkserver 0;
+start_proxy 0;
+my_echo "================================================================"
+my_echo "Testing LB server with sink_mode ${sink_mode[0]}"
+my_echo "Testing LB proxy with sink_mode ${sink_mode[0]}"
+sleep 5
+proxy_test 1000;
+stop_bkserver;
+stop_proxy;
+
+
 echo "__________"
 echo "GU (goal units) are millons of registrations per day, where registration is"
 echo "registration of job or subjob by client or server"