diff --git a/src/VirtualClient/VirtualClient.Actions/CtsTraffic/CtsTrafficClientExecutor.cs b/src/VirtualClient/VirtualClient.Actions/CtsTraffic/CtsTrafficClientExecutor.cs index 9f51eeb72d..c00b88be9c 100644 --- a/src/VirtualClient/VirtualClient.Actions/CtsTraffic/CtsTrafficClientExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/CtsTraffic/CtsTrafficClientExecutor.cs @@ -6,8 +6,10 @@ namespace VirtualClient.Actions using System; using System.Collections.Generic; using System.Linq; + using System.Net; using System.Threading; using System.Threading.Tasks; + using MathNet.Numerics; using Microsoft.Extensions.DependencyInjection; using VirtualClient; using VirtualClient.Common; @@ -98,7 +100,9 @@ await this.ServerApiClient.PollForExpectedStateAsync( cancellationToken, this.PollingInterval); - string targetIPAddress = this.GetServerIPAddress(cancellationToken); + string targetIPAddress = (this.GetLayoutClientInstances(ClientRole.Server, false) ?? Enumerable.Empty()) + .FirstOrDefault()?.IPAddress + ?? "localhost"; string ctsTrafficCommandArgs = $"-Target:{targetIPAddress} -Consoleverbosity:1 -StatusFilename:{this.StatusFileName} " + $@"-ConnectionFilename:{this.ConnectionsFileName} -ErrorFileName:{this.ErrorFileName} -Port:{this.Port} " + @@ -145,18 +149,5 @@ await this.ServerApiClient.PollForExpectedStateAsync( } } - - private string GetServerIPAddress(CancellationToken cancellationToken) - { - string targetIPAddress = "localhost"; - - if (this.IsMultiRoleLayout()) - { - ClientInstance serverInstance = this.GetLayoutClientInstances(ClientRole.Server).First(); - targetIPAddress = serverInstance.IPAddress; - } - - return targetIPAddress; - } } } \ No newline at end of file diff --git a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs index 3f82e2ed71..9c891a8df0 100644 --- a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs @@ -5,16 +5,13 @@ namespace VirtualClient.Actions { using System; using System.Collections.Generic; - using System.Globalization; using System.Linq; - using System.Net.Http; - using System.Text.RegularExpressions; + using System.Net; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Polly; using VirtualClient.Common; - using VirtualClient.Common.Contracts; using VirtualClient.Common.Extensions; using VirtualClient.Common.Telemetry; using VirtualClient.Contracts; @@ -27,6 +24,8 @@ public class SysbenchClientExecutor : SysbenchExecutor { private string sysbenchExecutionArguments; private string sysbenchLoggingArguments; + private string sysbenchPrepareArguments; + private string packageDirectory; /// /// Initializes a new instance of the class. @@ -169,7 +168,24 @@ private Task ExecuteWorkloadAsync(EventContext telemetryContext, CancellationTok { if (this.Benchmark == BenchmarkName.OLTP) { - await this.RunOLTPWorkloadAsync(telemetryContext, cancellationToken); + if (this.Action == ClientAction.TruncateDatabase) + { + DependencyPath workloadPackage = await this.GetPackageAsync(this.PackageName, cancellationToken).ConfigureAwait(false); + workloadPackage.ThrowIfNull(this.PackageName); + + DependencyPath package = await this.GetPlatformSpecificPackageAsync(this.PackageName, cancellationToken); + this.packageDirectory = package.Path; + + await this.TruncateMySQLDatabaseAsync(telemetryContext, cancellationToken).ConfigureAwait(false); + } + else if (this.Action == ClientAction.PopulateDatabase) + { + await this.PrepareOLTPMySQLDatabase(telemetryContext, cancellationToken); + } + else + { + await this.RunOLTPWorkloadAsync(telemetryContext, cancellationToken); + } } else if (this.Benchmark == BenchmarkName.TPCC) { @@ -194,11 +210,10 @@ private async Task RunOLTPWorkloadAsync(EventContext telemetryContext, Cancellat this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --workload {this.Workload} --threadCount {threadCount} --tableCount {tableCount} --recordCount {recordCount} "; this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}"; - string command = "python3"; string script = $"{this.SysbenchPackagePath}/run-workload.py "; using (IProcessProxy process = await this.ExecuteCommandAsync( - command, + SysbenchExecutor.PythonCommand, script + this.sysbenchExecutionArguments, this.SysbenchPackagePath, telemetryContext, @@ -223,11 +238,10 @@ private async Task RunTPCCWorkloadAsync(EventContext telemetryContext, Cancellat this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --workload tpcc --threadCount {threadCount} --tableCount {tableCount} --warehouses {warehouseCount} "; this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}"; - string command = "python3"; string script = $"{this.SysbenchPackagePath}/run-workload.py "; using (IProcessProxy process = await this.ExecuteCommandAsync( - command, + SysbenchExecutor.PythonCommand, script + this.sysbenchExecutionArguments, this.SysbenchPackagePath, telemetryContext, @@ -242,5 +256,64 @@ private async Task RunTPCCWorkloadAsync(EventContext telemetryContext, Cancellat } } } + + private async Task TruncateMySQLDatabaseAsync(EventContext telemetryContext, CancellationToken cancellationToken) + { + string arguments = $"{this.packageDirectory}/truncate-tables.py --dbName {this.DatabaseName}"; + + string serverIps = (this.GetLayoutClientInstances(ClientRole.Server, false) ?? Enumerable.Empty()) + .FirstOrDefault()?.IPAddress + ?? "localhost"; + + arguments += $" --clientIps \"{serverIps}\""; + + using (IProcessProxy process = await this.ExecuteCommandAsync( + SysbenchExecutor.PythonCommand, + arguments, + Environment.CurrentDirectory, + telemetryContext, + cancellationToken)) + { + if (!cancellationToken.IsCancellationRequested) + { + await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true); + process.ThrowIfDependencyInstallationFailed(process.StandardError.ToString()); + } + } + } + + private async Task PrepareOLTPMySQLDatabase(EventContext telemetryContext, CancellationToken cancellationToken) + { + int tableCount = GetTableCount(this.DatabaseScenario, this.TableCount, this.Workload); + int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads); + int recordCount = GetRecordCount(this.SystemManager, this.DatabaseScenario, this.RecordCount); + + this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount} --recordCount {recordCount} --threadCount {threadCount}"; + this.sysbenchPrepareArguments = $"{this.sysbenchLoggingArguments} --password {this.SuperUserPassword}"; + + string serverIp = (this.GetLayoutClientInstances(ClientRole.Server, false) ?? Enumerable.Empty()) + .FirstOrDefault()?.IPAddress + ?? "localhost"; + + this.sysbenchPrepareArguments += $" --host \"{serverIp}\""; + + string arguments = $"{this.SysbenchPackagePath}/populate-database.py "; + + using (IProcessProxy process = await this.ExecuteCommandAsync( + SysbenchExecutor.PythonCommand, + arguments + this.sysbenchPrepareArguments, + this.SysbenchPackagePath, + telemetryContext, + cancellationToken)) + { + if (!cancellationToken.IsCancellationRequested) + { + await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true); + process.ThrowIfErrored(process.StandardError.ToString(), ErrorReason.WorkloadUnexpectedAnomaly); + + this.AddMetric(this.sysbenchLoggingArguments, process, telemetryContext, cancellationToken); + } + } + } } } diff --git a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchConfiguration.cs b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchConfiguration.cs index 42e0f102c8..87587facc3 100644 --- a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchConfiguration.cs +++ b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchConfiguration.cs @@ -5,6 +5,9 @@ namespace VirtualClient.Actions { using System; using System.Collections.Generic; + using System.ComponentModel; + using System.Linq; + using System.Net; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -79,13 +82,17 @@ private async Task PrepareOLTPMySQLDatabase(EventContext telemetryContext, Cance int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads); int recordCount = GetRecordCount(this.SystemManager, this.DatabaseScenario, this.RecordCount); - this.sysbenchPrepareArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount} --recordCount {recordCount} --threadCount {threadCount} --password {this.SuperUserPassword}"; + string sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount} --recordCount {recordCount} --threadCount {threadCount}"; + this.sysbenchPrepareArguments = $"{sysbenchLoggingArguments} --password {this.SuperUserPassword}"; + + string serverIp = "localhost"; + + this.sysbenchPrepareArguments += $" --host \"{serverIp}\""; - string command = $"python3"; string arguments = $"{this.SysbenchPackagePath}/populate-database.py "; using (IProcessProxy process = await this.ExecuteCommandAsync( - command, + SysbenchExecutor.PythonCommand, arguments + this.sysbenchPrepareArguments, this.SysbenchPackagePath, telemetryContext, @@ -95,6 +102,8 @@ private async Task PrepareOLTPMySQLDatabase(EventContext telemetryContext, Cance { await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true); process.ThrowIfErrored(process.StandardError.ToString(), ErrorReason.WorkloadUnexpectedAnomaly); + + this.AddMetric(sysbenchLoggingArguments, process, telemetryContext, cancellationToken); } } } @@ -105,13 +114,13 @@ private async Task PrepareTPCCMySQLDatabase(EventContext telemetryContext, Cance int threadCount = GetThreadCount(this.SystemManager, this.DatabaseScenario, this.Threads); int warehouseCount = GetWarehouseCount(this.DatabaseScenario, this.WarehouseCount); - this.sysbenchPrepareArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount} --warehouses {warehouseCount} --threadCount {threadCount} --password {this.SuperUserPassword}"; + string sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --tableCount {tableCount} --warehouses {warehouseCount} --threadCount {threadCount}"; + this.sysbenchPrepareArguments = $"{sysbenchLoggingArguments} --password {this.SuperUserPassword}"; - string command = $"python3"; string arguments = $"{this.SysbenchPackagePath}/populate-database.py "; using (IProcessProxy process = await this.ExecuteCommandAsync( - command, + SysbenchExecutor.PythonCommand, arguments + this.sysbenchPrepareArguments, this.SysbenchPackagePath, telemetryContext, @@ -121,6 +130,8 @@ private async Task PrepareTPCCMySQLDatabase(EventContext telemetryContext, Cance { await this.LogProcessDetailsAsync(process, telemetryContext, "Sysbench", logToFile: true); process.ThrowIfErrored(process.StandardError.ToString(), ErrorReason.WorkloadUnexpectedAnomaly); + + this.AddMetric(sysbenchLoggingArguments, process, telemetryContext, cancellationToken); } } } diff --git a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchExecutor.cs b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchExecutor.cs index dd0bed98a5..e020517fc6 100644 --- a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchExecutor.cs @@ -18,6 +18,7 @@ namespace VirtualClient.Actions using VirtualClient.Common.Extensions; using VirtualClient.Common.Telemetry; using VirtualClient.Contracts; + using VirtualClient.Contracts.Metadata; /// /// The Sysbench workload executor. @@ -35,6 +36,11 @@ public class SysbenchExecutor : VirtualClientComponent /// public const int SelectWorkloadDefaultTableCount = 1; + /// + /// const for python command. + /// + protected const string PythonCommand = "python3"; + private readonly IStateManager stateManager; private static readonly string[] SelectWorkloads = { @@ -175,6 +181,18 @@ public string Workload } } + /// + /// The specifed action that controls the execution of the dependency. + /// + public string Action + { + get + { + this.Parameters.TryGetValue(nameof(this.Action), out IConvertible action); + return action?.ToString(); + } + } + /// /// Client used to communicate with the hosted instance of the /// Virtual Client API at server side. @@ -299,7 +317,10 @@ await this.CheckDistroSupportAsync(telemetryContext, cancellationToken) DependencyPath package = await this.GetPackageAsync(this.PackageName, cancellationToken); this.SysbenchPackagePath = package.Path; - await this.InitializeExecutablesAsync(telemetryContext, cancellationToken); + if (this.Action != ClientAction.TruncateDatabase) + { + await this.InitializeExecutablesAsync(telemetryContext, cancellationToken); + } this.InitializeApiClients(telemetryContext, cancellationToken); @@ -377,6 +398,43 @@ protected async Task InitializeExecutablesAsync(EventContext telemetryContext, C await this.stateManager.SaveStateAsync(nameof(SysbenchState), state, cancellationToken); } + /// + /// Add metrics to telemtry. + /// + /// + /// + /// + /// + protected void AddMetric(string arguments, IProcessProxy process, EventContext telemetryContext, CancellationToken cancellationToken) + { + if (!cancellationToken.IsCancellationRequested) + { + this.MetadataContract.AddForScenario( + "Sysbench", + process.FullCommand(), + toolVersion: null); + + this.MetadataContract.Apply(telemetryContext); + + string text = process.StandardOutput.ToString(); + + List metrics = new List(); + double duration = (process.ExitTime - process.StartTime).TotalMinutes; + metrics.Add(new Metric("PopulateDatabaseTime_Minutes ", duration, "minutes", MetricRelativity.LowerIsBetter)); + + this.Logger.LogMetrics( + toolName: "Sysbench", + scenarioName: this.MetricScenario ?? this.Scenario, + process.StartTime, + process.ExitTime, + metrics, + null, + scenarioArguments: arguments, + this.Tags, + telemetryContext); + } + } + private async Task CheckDistroSupportAsync(EventContext telemetryContext, CancellationToken cancellationToken) { if (this.Platform == PlatformID.Unix) @@ -460,5 +518,26 @@ internal class BenchmarkName public const string OLTP = nameof(OLTP); public const string TPCC = nameof(TPCC); } + + /// + /// Supported Sysbench Client actions. + /// + internal class ClientAction + { + /// + /// Creates Database on MySQL server and Users on Server and any Clients. + /// + public const string PopulateDatabase = nameof(PopulateDatabase); + + /// + /// Truncates all tables existing in database + /// + public const string TruncateDatabase = nameof(TruncateDatabase); + + /// + /// Truncates all tables existing in database + /// + public const string RunWorkload = nameof(RunWorkload); + } } } \ No newline at end of file diff --git a/src/VirtualClient/VirtualClient.Core/ProfileExpressionEvaluator.cs b/src/VirtualClient/VirtualClient.Core/ProfileExpressionEvaluator.cs index 78fbc83c9f..86cca7e54f 100644 --- a/src/VirtualClient/VirtualClient.Core/ProfileExpressionEvaluator.cs +++ b/src/VirtualClient/VirtualClient.Core/ProfileExpressionEvaluator.cs @@ -25,8 +25,8 @@ public class ProfileExpressionEvaluator : IExpressionEvaluator // {fn(512 / 16)]} // {fn(512 / {LogicalThreadCount})} private static readonly Regex CalculateExpression = new Regex( - @"\{calculate\(([0-9\*\/\+\-\(\)\s]+)\)\}", - RegexOptions.Compiled | RegexOptions.IgnoreCase); + @"\{calculate\(([0-9L\*\/\+\-\(\)\s]+)\)\}", + RegexOptions.Compiled | RegexOptions.IgnoreCase); // e.g. // {calculate({IsTLSEnabled} ? "Yes" : "No")} @@ -441,7 +441,6 @@ public class ProfileExpressionEvaluator : IExpressionEvaluator { string function = match.Groups[1].Value; long result = await Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScript.EvaluateAsync(function); - evaluatedExpression = evaluatedExpression.Replace(match.Value, result.ToString()); } } diff --git a/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs b/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs index e6957dd718..4ee17e5f28 100644 --- a/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs +++ b/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs @@ -63,6 +63,22 @@ public bool SkipInitialize } } + /// + /// stripedisk mount point. + /// + public string StripeDiskMountPoint + { + get + { + if (this.Parameters.TryGetValue(nameof(this.StripeDiskMountPoint), out IConvertible stripediskmountpoint) && stripediskmountpoint != null) + { + return stripediskmountpoint.ToString(); + } + + return string.Empty; + } + } + /// /// Disk filter specified /// @@ -123,14 +139,14 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel ConfigurationState configurationState = await this.stateManager.GetStateAsync(stateId, cancellationToken) .ConfigureAwait(false); + telemetryContext.AddContext(nameof(configurationState), configurationState); + DependencyPath workloadPackage = await this.GetPackageAsync(this.PackageName, cancellationToken).ConfigureAwait(false); workloadPackage.ThrowIfNull(this.PackageName); DependencyPath package = await this.GetPlatformSpecificPackageAsync(this.PackageName, cancellationToken); this.packageDirectory = package.Path; - telemetryContext.AddContext(nameof(configurationState), configurationState); - if (!this.SkipInitialize) { if (configurationState == null) @@ -163,8 +179,11 @@ await this.SetMySQLGlobalVariableAsync(telemetryContext, cancellationToken) private async Task ConfigureMySQLServerAsync(EventContext telemetryContext, CancellationToken cancellationToken) { - string serverIp = this.GetServerIpAddress(); - string innoDbDirs = await this.GetMySQLInnodbDirectoriesAsync(cancellationToken); + string serverIp = (this.GetLayoutClientInstances(ClientRole.Server, false) ?? Enumerable.Empty()) + .FirstOrDefault()?.IPAddress + ?? IPAddress.Loopback.ToString(); + + string innoDbDirs = !string.IsNullOrEmpty(this.StripeDiskMountPoint) ? this.StripeDiskMountPoint : await this.GetMySQLInnodbDirectoriesAsync(cancellationToken); string arguments = $"{this.packageDirectory}/configure.py --serverIp {serverIp} --innoDbDirs \"{innoDbDirs}\""; @@ -299,20 +318,6 @@ private async Task GetMySQLInMemoryCapacityAsync(CancellationToken cance return bufferSizeInMegaBytes.ToString(); } - private string GetServerIpAddress() - { - string serverIPAddress = IPAddress.Loopback.ToString(); - - if (this.IsMultiRoleLayout()) - { - ClientInstance serverInstance = this.GetLayoutClientInstances(ClientRole.Server).First(); - IPAddress.TryParse(serverInstance.IPAddress, out IPAddress serverIP); - serverIPAddress = serverIP.ToString(); - } - - return serverIPAddress; - } - private string GetClientIpAddresses() { string clientIpAddresses = string.Empty; @@ -352,8 +357,7 @@ internal class ConfigurationAction /// /// Distributes existing database to disks on the system /// - public const string DistributeDatabase = nameof(DistributeDatabase); - + public const string DistributeDatabase = nameof(DistributeDatabase); } internal class ConfigurationState diff --git a/src/VirtualClient/VirtualClient.Dependencies/PostgreSQLServer/PostgreSQLServerConfiguration.cs b/src/VirtualClient/VirtualClient.Dependencies/PostgreSQLServer/PostgreSQLServerConfiguration.cs index 3ff111e0e4..876f7d8ca3 100644 --- a/src/VirtualClient/VirtualClient.Dependencies/PostgreSQLServer/PostgreSQLServerConfiguration.cs +++ b/src/VirtualClient/VirtualClient.Dependencies/PostgreSQLServer/PostgreSQLServerConfiguration.cs @@ -177,7 +177,9 @@ await this.DistributePostgreSQLDatabaseAsync(telemetryContext, cancellationToken private async Task ConfigurePostgreSQLServerAsync(EventContext telemetryContext, CancellationToken cancellationToken) { - string serverIp = this.GetServerIpAddress(); + string serverIp = (this.GetLayoutClientInstances(ClientRole.Server, false) ?? Enumerable.Empty()) + .FirstOrDefault()?.IPAddress + ?? IPAddress.Loopback.ToString(); string arguments = $"{this.packageDirectory}/configure-server.py --dbName {this.DatabaseName} --serverIp {serverIp} --password {this.SuperUserPassword} --port {this.Port} --inMemory {this.SharedMemoryBuffer}"; @@ -272,20 +274,6 @@ private async Task GetPostgreSQLInnodbDirectoriesAsync(CancellationToken return diskPaths; } - private string GetServerIpAddress() - { - string serverIPAddress = IPAddress.Loopback.ToString(); - - if (this.IsMultiRoleLayout()) - { - ClientInstance serverInstance = this.GetLayoutClientInstances(ClientRole.Server).First(); - IPAddress.TryParse(serverInstance.IPAddress, out IPAddress serverIP); - serverIPAddress = serverIP.ToString(); - } - - return serverIPAddress; - } - /// /// Supported PostgreSQL Server configuration actions. /// diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MYSQL-SYSBENCH-OLTP.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MYSQL-SYSBENCH-OLTP.json index afeae9c139..58c7745c19 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MYSQL-SYSBENCH-OLTP.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MYSQL-SYSBENCH-OLTP.json @@ -10,6 +10,7 @@ "DatabaseName": "sbtest", "DatabaseScenario": "Balanced", "DiskFilter": "osdisk:false&sizegreaterthan:256g", + "InnodbBufferPoolSize": "{calculate({SystemMemoryBytes} * 80 / 100)}", "Duration": "00:05:00" }, "Actions": [ @@ -169,7 +170,7 @@ "Parameters": { "Scenario": "DownloadMySqlServerPackage", "BlobContainer": "packages", - "BlobName": "mysql-server-8.0.36.zip", + "BlobName": "mysql-server-8.0.36-v2.zip", "PackageName": "mysql-server", "Extract": true, "Role": "Server" @@ -180,7 +181,7 @@ "Parameters": { "Scenario": "DownloadSysbenchPackage", "BlobContainer": "packages", - "BlobName": "sysbench-1.0.20.rev1.zip", + "BlobName": "sysbench-1.0.20.rev2.zip", "PackageName": "sysbench", "Extract": true } @@ -231,7 +232,8 @@ "Action": "SetGlobalVariables", "Benchmark": "OLTP", "DiskFilter": "$.Parameters.DiskFilter", - "Variables": "MAX_PREPARED_STMT_COUNT=1000000;MAX_CONNECTIONS=1000000", + "InnodbBufferPoolSize": "$.Parameters.InnodbBufferPoolSize", + "Variables": "MAX_PREPARED_STMT_COUNT=1000000;MAX_CONNECTIONS=100000;innodb_buffer_pool_size={InnodbBufferPoolSize};innodb_lock_wait_timeout=300;innodb_io_capacity=10000;innodb_io_capacity_max=10000;innodb_buffer_pool_dump_at_shutdown=OFF;innodb_change_buffering=0;table_open_cache=20000;", "PackageName": "mysql-server", "Role": "Server" } diff --git a/website/docs/workloads/sysbench/sysbench-profiles.md b/website/docs/workloads/sysbench/sysbench-profiles.md index 9ef2ec5184..39823ec2fd 100644 --- a/website/docs/workloads/sysbench/sysbench-profiles.md +++ b/website/docs/workloads/sysbench/sysbench-profiles.md @@ -157,6 +157,76 @@ There are a lot of moving parts to this workload that allows for both out-of-box with 10,000 records each can be created, a workload can be run on 5 tables for 1000 records if desired. VC does not support dropping and recreating a new database or table configuration within the same profile or system. + VC now supports truncating tables and populating the table again. Following are changes to be made in profile. + + **Note:** Use TruncateDatabase with caution. + + ** **DO NOT CHANGE THE SIZE OF DATABASE FROM ACTION TO ACTION. IF DEALING WITH LARGE DATABASES RE-POPULATING DATABASE WOULD TAKE A LOT OF TIME AND IS NOT ALWAYS RECOMMENDED** ** + + ``` bash + { + "Type": "SysbenchClientExecutor", + "Parameters": { + "Scenario": "TruncateMySQLDatabaseTables", + "Action": "TruncateDatabase", + "DatabaseSystem": "MySQL", + "Benchmark": "OLTP", + "DatabaseName": "$.Parameters.DatabaseName", + "PackageName": "mysql-server", + "Role": "Client" + } + }, + { + "Type": "WaitExecutor", + "Parameters": { + "Scenario": "WaitForTimeProvided", + "Duration": "00:01:00" + } + }, + { + "Type": "SysbenchClientExecutor", + "Parameters": { + "Scenario": "PopulateMySQLDatabase", + "Action": "PopulateDatabase", + "DatabaseSystem": "MySQL", + "Benchmark": "OLTP", + "DatabaseName": "$.Parameters.DatabaseName", + "DatabaseScenario": "$.Parameters.DatabaseScenario", + "PackageName": "sysbench", + "Threads": "$.Parameters.Threads", + "RecordCount": "$.Parameters.RecordCount", + "TableCount": "$.Parameters.TableCount", + "Role": "Client" + } + }, + { + "Type": "WaitExecutor", + "Parameters": { + "Scenario": "WaitForTimeProvided", + "Duration": "00:01:00" + } + }, + { + "Type": "SysbenchClientExecutor", + "Parameters": { + "Scenario": "oltp_read_only", + "Action": "RunWorkload", + "DatabaseSystem": "MySQL", + "Benchmark": "OLTP", + "DatabaseName": "$.Parameters.DatabaseName", + "DatabaseScenario": "$.Parameters.DatabaseScenario", + "Duration": "$.Parameters.Duration", + "Workload": "oltp_read_only", + "PackageName": "sysbench", + "Threads": "$.Parameters.Threads", + "RecordCount": "$.Parameters.RecordCount", + "TableCount": "$.Parameters.TableCount", + "Role": "Client" + } + }, + ``` + + * **SysbenchServerExecutor** Sets the server online for client interaction.