Ejemplo n.º 1
0
        /// <summary>
        /// YCSB async benchmark test on Cassandra with partitions
        /// </summary>
        /// <param name="args"></param>
        static void YCSBAsyncTestWithPartitionedCassandraVersionDb(string[] args)
        {
            BenchmarkTestConfig config = new BenchmarkTestConfig(args);

            int replicationFactor = 3;

            ConsistencyLevel consistencyLevel = ConsistencyLevel.Quorum;

            string[] tables =
            {
                YCSBAsyncBenchmarkTest.TABLE_ID,
                VersionDb.TX_TABLE
            };

            PartitionedCassandraVersionDb versionDb = PartitionedCassandraVersionDb.Instance(config.WorkerCount,
                                                                                             config.Host, replicationFactor, consistencyLevel);
            YCSBAsyncBenchmarkTest test = new YCSBAsyncBenchmarkTest(config.RecordCount, config.WorkerCount,
                                                                     config.WorkloadCount, versionDb, tables, config);

            if (config.LoadRecords)
            {
                test.load(versionDb, config.WorkerCount, config.RecordCount);
            }
            else
            {
                test.prepare();
                test.StartMonitors();
                test.Run2("async");
            }
        }
Ejemplo n.º 2
0
        public static void YCSBAsyncTestWithPartitionedCassandra()
        {
            const int partitionCount     = 4;
            const int recordCount        = 100;
            const int executorCount      = 4;
            const int txCountPerExecutor = 250;

            const string dataFile      = "ycsb_data_r.in";
            const string operationFile = "ycsb_ops_r.in";

            string[] tables = new string[]
            {
                VersionDb.TX_TABLE,
                YCSBAsyncBenchmarkTest.TABLE_ID
            };

            // The default mode of versionDb is daemonMode
            PartitionedCassandraVersionDb versionDb = PartitionedCassandraVersionDb.Instance(partitionCount, "127.0.0.1", 1, ConsistencyLevel.One);
            YCSBAsyncBenchmarkTest        test      = new YCSBAsyncBenchmarkTest(recordCount,
                                                                                 executorCount, txCountPerExecutor, versionDb, tables);

            test.Setup(dataFile, operationFile);
            test.Run();
            test.Stats();
        }
Ejemplo n.º 3
0
        public static void YCSBAsyncTestWithPartitionedCassandraHybrid(string[] args)
        {
            string action             = "run";
            int    workerCount        = 500;
            int    taskCountPerWorker = 1000;
            int    partitionCount     = 500; // equal to workerCount

            int runall           = 1;
            int stableRoundStart = 5;
            int stableRoundEnd   = 15;

            /// one data file
            string dataFile = "ycsb_data_u.in";

            /// four kinds of operation(workload) files
            string operationFile = "ycsb_ops_u.in";

            /// <summary>
            /// CassandraVersionDb Single Node parameters
            /// </summary>
            string           contactPoints     = "127.0.0.1";
            int              replicationFactor = 1;
            ConsistencyLevel consistencyLevel  = ConsistencyLevel.One;

            /// <summary>
            /// CassandraVersionDb Cluster parameters - 10 nodes
            /// </summary>
            //string contactPoints = "10.6.0.4,10.6.0.5,10.6.0.6,10.6.0.12,10.6.0.13,10.6.0.14,10.6.0.15,10.6.0.16,10.6.0.17,10.6.0.18";
            //int replicationFactor = 3;
            //ConsistencyLevel consistencyLevel = ConsistencyLevel.Quorum;

            // see YCSBAsyncBenchmarkTest.run2 to know all types
            //string exeType = "ycsb_sync_ro_strk";
            //string exeType = "ycsb_sync_ro_intk"
            //string exeType = "ycsb_sync_wo_intk";
            //string exeType = "ycsb_sync_rw_intk";
            string exeType = "async";
            //string exeType = "cassandra_ro_intk";
            //string exeType = "cassandra_wo_intk";

            int i = 0;

            while (i < args.Length)
            {
                switch (args[i++])
                {
                case "--datafile":
                    dataFile = args[i++];
                    break;

                case "--opsfile":       // unused
                    operationFile = args[i++];
                    break;

                case "--workers":
                    workerCount = int.Parse(args[i++]);
                    break;

                case "--taskspw":
                    taskCountPerWorker = int.Parse(args[i++]);
                    break;

                case "--partitions":        // equal to workers
                    partitionCount = int.Parse(args[i++]);
                    break;

                case "--nodes":
                    contactPoints = args[i++];
                    break;

                case "--replica":           // default 3
                    replicationFactor = int.Parse(args[i++]);
                    break;

                case "--consislevel":       // local: one, cluster: quorum
                    if (args[i++] == "one")
                    {
                        consistencyLevel = ConsistencyLevel.One;
                    }
                    else
                    {
                        consistencyLevel = ConsistencyLevel.Quorum;
                    }
                    break;

                case "--exetype":           //
                    exeType = args[i++];
                    break;

                case "--startround":        // unused
                    stableRoundStart = int.Parse(args[i++]);
                    break;

                case "--endround":          // unused
                    stableRoundEnd = int.Parse(args[i++]);
                    break;

                case "--runall":            // unused
                    runall = int.Parse(args[i++]);
                    break;

                case "--action":            // load/run
                    action = args[i++];
                    break;

                default:
                    break;
                }
            }

            Console.WriteLine("contact points " + contactPoints);
            if (runall == 0 && stableRoundEnd <= stableRoundStart)
            {
                Console.WriteLine("Bad stable round setting");
                return;
            }

            if (action == "load")
            {
                PartitionedCassandraVersionDb versionDb = PartitionedCassandraVersionDb.Instance(partitionCount, contactPoints, replicationFactor, consistencyLevel);
                LoadDataWithSyncForCassandra(dataFile, workerCount, versionDb);
            }
            else if (action == "run")
            {
                string[] tables = new string[]
                {
                    VersionDb.TX_TABLE,
                    YCSBAsyncBenchmarkTest.TABLE_ID
                };

                // The default mode of versionDb is daemonMode
                PartitionedCassandraVersionDb versionDb = PartitionedCassandraVersionDb.Instance(partitionCount, contactPoints, replicationFactor, consistencyLevel);
                YCSBAsyncBenchmarkTest        test      = new YCSBAsyncBenchmarkTest(0,
                                                                                     workerCount, taskCountPerWorker, versionDb, tables);
                if (runall == 0)
                {
                    test.SetStableRound(stableRoundStart, stableRoundEnd);
                }

                // sync test
                //test.SetupOpsNull();

                // async test
                test.SetupOps(operationFile);
                test.StartMonitors();

                test.Run2(exeType);
                test.Stats2();
            }
            else
            {
                Console.WriteLine("bad action. Only <load> or <run> allowed");
            }
        }
Ejemplo n.º 4
0
        public static void YCSBSyncTestWithPartitionedCassandra(string[] args)
        {
            int    workerCount        = 1;
            int    taskCountPerWorker = 1000;
            string dataFile           = "ycsb_data_r.in";
            string operationFile      = "ycsb_ops_r.in";

            // Cassandra version db
            int maxVdbCnt            = 8192;
            List <VersionDb> vdbList = new List <VersionDb>();

            for (int j = 0; j < maxVdbCnt; j++)
            {
                vdbList.Add(PartitionedCassandraVersionDb.Instance(1, "127.0.0.1", 1, ConsistencyLevel.One));
            }
            YCSBBenchmarkTest test = new YCSBBenchmarkTest(0, 0, vdbList[0]);

            test.LoadDataWithMultiThreads(dataFile, vdbList, 10);


            // run
            //test.rerun(1, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(2, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(4, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(8, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(16, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(32, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(64, 5000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(128, 2000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(64, 2000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(256, 1000, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(512, 500, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(1024, 250, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(2048, 125, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(4096, 50, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //test.rerun(8192, 25, operationFile, vdbList);
            //Console.WriteLine("*****************************************************");

            //Console.WriteLine("done");
            //Console.ReadLine();
        }