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"
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; }
}
} 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);
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*));
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]);
}
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" ] && \
}
+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
+
+
+}
+
################################################################################
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"