From 68756f4a4623c2a1e7025ba538eb379fbe71a420 Mon Sep 17 00:00:00 2001 From: Prashant Kumar Date: Thu, 6 Aug 2026 18:58:14 +0530 Subject: [PATCH 1/4] Add Azure Linux support to the MongoDB/YCSB workload Extends PERF-MONGODB-YCSB.json to run on Azure Linux in addition to Ubuntu, and introduces a general-purpose mechanism for scoping any profile component to specific Linux distributions. SupportedLinuxDistributions component parameter Components may now declare "SupportedLinuxDistributions": "AzureLinux,Ubuntu". IsSupported() evaluates it after the existing SupportedPlatforms check, and a component that declares it never runs on non-Linux systems. Profile The MongoDB installation steps are split into an apt path scoped to Debian/Ubuntu and a dnf path scoped to AzureLinux. lshw is added to the package prerequisites; VirtualClient uses it for disk discovery and it is not present by default on Azure Linux. gnupg is corrected to gnupg2 for the dnf/yum package names. MongoDBServerExecutor The mongod service account is resolved at runtime rather than hardcoded to mongodb. RPM packages create mongod while Debian packages create mongodb, so the data directory was left owned by root on Azure Linux and mongod exited with status 100. The MongoDB port is opened via IFirewallManager during initialization. Azure Linux applies a default-deny policy to inbound traffic, so the client could not reach the server and runs completed with zero recorded operations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../MongoDB/MongoDBServerExecutorTests.cs | 71 +++++++++++ .../MongoDB/MongoDBServerExecutor.cs | 42 +++++- .../VirtualClientComponentTests.cs | 120 ++++++++++++++++++ .../VirtualClientComponent.cs | 33 +++++ .../profiles/PERF-MONGODB-YCSB.json | 63 ++++++++- 5 files changed, 322 insertions(+), 7 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Actions.UnitTests/MongoDB/MongoDBServerExecutorTests.cs b/src/VirtualClient/VirtualClient.Actions.UnitTests/MongoDB/MongoDBServerExecutorTests.cs index e188862b90..08446fde78 100644 --- a/src/VirtualClient/VirtualClient.Actions.UnitTests/MongoDB/MongoDBServerExecutorTests.cs +++ b/src/VirtualClient/VirtualClient.Actions.UnitTests/MongoDB/MongoDBServerExecutorTests.cs @@ -342,6 +342,77 @@ public async Task MongoDBServerExecutor_InitializeAsync_WithDiskFilter_CallsInit "ServerApiClient should be initialized"); } + [Test] + public async Task MongoDBServerExecutor_ConfigureDisk_ResolvesTheMongoDBServiceUserForThePlatform() + { + // SETUP: A DiskFilter triggers the disk configuration workflow. + this.mockFixture.Parameters["DiskFilter"] = "BiggestSize"; + this.mockFixture.Parameters["DiskDevicePath"] = "/dev/nvme0n1"; + + var volumes = new List(); + var disk = new Disk(index: 0, devicePath: "/dev/nvme0n1", volumes: volumes, properties: null); + this.mockFixture.DiskManager.Setup(dm => dm.GetDisksAsync(It.IsAny())) + .ReturnsAsync(new List { disk }); + + List commandsExecuted = new List(); + this.mockFixture.ProcessManager.OnCreateProcess = (exe, args, workingDir) => + { + commandsExecuted.Add($"{exe} {args}"); + this.mockFixture.Process.StandardOutput.Clear(); + this.mockFixture.Process.StandardOutput.Append("{ \"ok\" : 1 }"); + this.mockFixture.Process.ExitCode = 0; + return this.mockFixture.Process; + }; + + var executor = new TestableMongoDBServerExecutor(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + // ACT + await executor.InitializeAsync(EventContext.Persisted(), CancellationToken.None); + + // ASSERT: The MongoDB service account is named 'mongodb' by Debian/Ubuntu packages but + // 'mongod' by RPM packages (Azure Linux, RHEL, Fedora). Hardcoding either one leaves the + // data directory owned by root on the other, and mongod then fails to create its journal. + string chownCommand = commandsExecuted.FirstOrDefault(cmd => cmd.Contains("chown", StringComparison.OrdinalIgnoreCase)); + + Assert.IsNotNull(chownCommand, "The data directory ownership command should have been executed."); + + Assert.IsFalse( + chownCommand.Contains("chown -R mongodb:mongodb", StringComparison.OrdinalIgnoreCase), + "The ownership command must not hardcode the Debian-only 'mongodb' account."); + + Assert.IsTrue( + chownCommand.Contains("id -u mongod", StringComparison.OrdinalIgnoreCase), + "The ownership command should probe for the RPM 'mongod' account."); + + Assert.IsTrue( + chownCommand.Contains("echo mongodb", StringComparison.OrdinalIgnoreCase), + "The ownership command should fall back to the Debian 'mongodb' account."); + } + + [Test] + public async Task MongoDBServerExecutor_InitializeAsync_OpensTheMongoDBPortOnTheLocalFirewall() + { + // SETUP: Capture the firewall entries the executor asks to be opened. + List firewallEntries = new List(); + this.mockFixture.FirewallManager + .Setup(mgr => mgr.EnableInboundConnectionsAsync(It.IsAny>(), It.IsAny())) + .Callback, CancellationToken>((entries, token) => firewallEntries.AddRange(entries)) + .Returns(Task.CompletedTask); + + this.mockFixture.Parameters["Port"] = 27017; + + var executor = new TestableMongoDBServerExecutor(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + // ACT + await executor.InitializeAsync(EventContext.Persisted(), CancellationToken.None); + + // ASSERT: Distros such as Azure Linux apply a default-deny inbound policy. Without opening + // the port, the YCSB client times out connecting to the server and loads zero records. + Assert.AreEqual(1, firewallEntries.Count, "The MongoDB port should have been opened on the local firewall."); + Assert.AreEqual("tcp", firewallEntries[0].Protocol); + CollectionAssert.AreEqual(new List { 27017 }, firewallEntries[0].Ports.ToList()); + } + [Test] public async Task MongoDBServerExecutor_InitializeAsync_CallsConfigureBindAddressAndStartServer() { diff --git a/src/VirtualClient/VirtualClient.Actions/MongoDB/MongoDBServerExecutor.cs b/src/VirtualClient/VirtualClient.Actions/MongoDB/MongoDBServerExecutor.cs index 2d52e0e828..a4d6544b0d 100644 --- a/src/VirtualClient/VirtualClient.Actions/MongoDB/MongoDBServerExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/MongoDB/MongoDBServerExecutor.cs @@ -24,6 +24,16 @@ namespace VirtualClient.Actions [SupportedPlatforms("linux-arm64,linux-x64")] public class MongoDBServerExecutor : MongoDBExecutor { + /// + /// The MongoDB service account created by RPM-based packages (Azure Linux, RHEL, Fedora). + /// + private const string RpmServiceUser = "mongod"; + + /// + /// The MongoDB service account created by Debian-based packages (Ubuntu, Debian). + /// + private const string DebianServiceUser = "mongodb"; + private IFileSystem fileSystem; private ISystemManagement systemManagement; private bool disposed; @@ -68,6 +78,9 @@ protected override async Task InitializeAsync(EventContext telemetryContext, Can this.InitializeApiClients(); + await MongoDBServerExecutor.OpenFirewallPortsAsync(this.Port, this.systemManagement.FirewallManager, cancellationToken) + .ConfigureAwait(false); + // Initialize disk if DiskFilter is specified if (!string.IsNullOrWhiteSpace(this.DiskFilter)) { @@ -122,6 +135,25 @@ protected override void Dispose(bool disposing) } } + /// + /// Opens the MongoDB port on the local firewall so that the client instance is able to + /// connect to the MongoDB server. Distros such as Azure Linux apply a default-deny policy + /// to inbound traffic, so the port must be opened explicitly. + /// + private static Task OpenFirewallPortsAsync(int port, IFirewallManager firewallManager, CancellationToken cancellationToken) + { + return firewallManager.EnableInboundConnectionsAsync( + new List + { + new FirewallEntry( + "MongoDB: Allow Multiple Machines communications", + "Allows individual machine instances to communicate with other machine in client-server scenario", + "tcp", + new List { port }) + }, + cancellationToken); + } + /// /// Configures MongoDB to bind to all network interfaces. /// @@ -266,10 +298,16 @@ await this.ExecuteMongoDBCommandAsync( telemetryContext, cancellationToken).ConfigureAwait(false); - // Set permissions + // Set permissions. The MongoDB service account name differs by package format: + // Debian/Ubuntu packages create 'mongodb' whereas RPM-based distributions + // (Azure Linux, RHEL, Fedora) create 'mongod'. Resolve it at runtime so the + // data directory is owned by the account mongod actually runs as. + string resolveServiceUser = $"MONGO_USER=$(id -u {MongoDBServerExecutor.RpmServiceUser} >/dev/null 2>&1 && echo {MongoDBServerExecutor.RpmServiceUser} || echo {MongoDBServerExecutor.DebianServiceUser}); " + + $"sudo chown -R $MONGO_USER:$MONGO_USER {mongoDataPath}"; + await this.ExecuteMongoDBCommandAsync( "bash", - $"-c \"sudo chown -R mongodb:mongodb {mongoDataPath}\"", + $"-c \"{resolveServiceUser}\"", "SetPermissions", telemetryContext, cancellationToken).ConfigureAwait(false); diff --git a/src/VirtualClient/VirtualClient.Contracts.UnitTests/VirtualClientComponentTests.cs b/src/VirtualClient/VirtualClient.Contracts.UnitTests/VirtualClientComponentTests.cs index 561f0ddfb5..2ff93c702e 100644 --- a/src/VirtualClient/VirtualClient.Contracts.UnitTests/VirtualClientComponentTests.cs +++ b/src/VirtualClient/VirtualClient.Contracts.UnitTests/VirtualClientComponentTests.cs @@ -724,6 +724,121 @@ public void VirtualClientComponentIsSupportedRespectsSupportedPlatformAttribute( Assert.IsFalse(VirtualClientComponent.IsSupported(component)); } + [Test] + public void VirtualClientComponentSupportedLinuxDistributionsIsEmptyWhenTheParameterIsNotDefined() + { + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsNotNull(component.SupportedLinuxDistributions); + Assert.IsEmpty(component.SupportedLinuxDistributions); + } + + [Test] + public void VirtualClientComponentSupportedLinuxDistributionsParsesDelimitedValues() + { + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedLinuxDistributions)] = "Debian,Ubuntu"; + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + CollectionAssert.AreEqual(new List { "Debian", "Ubuntu" }, component.SupportedLinuxDistributions); + } + + [Test] + public void VirtualClientComponentIsSupportedWhenTheSupportedLinuxDistributionsParameterIsNotDefined() + { + // A component that does not define the parameter is not filtered on the Linux distribution + // at all and thus executes on any distribution. + this.mockFixture.Setup(PlatformID.Unix); + this.SetupLinuxDistribution(LinuxDistribution.AzureLinux, LinuxUpstreamDistribution.Fedora); + + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsTrue(component.IsSupported()); + } + + [Test] + [TestCase("AzureLinux")] + [TestCase("Debian,Ubuntu,AzureLinux")] + [TestCase("azurelinux")] + [TestCase("AZURELINUX")] + [TestCase(" AzureLinux , Ubuntu ")] + public void VirtualClientComponentIsSupportedWhenTheLinuxDistributionMatchesTheSupportedLinuxDistributions(string supportedDistributions) + { + this.mockFixture.Setup(PlatformID.Unix); + this.SetupLinuxDistribution(LinuxDistribution.AzureLinux, LinuxUpstreamDistribution.Fedora); + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedLinuxDistributions)] = supportedDistributions; + + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsTrue(component.IsSupported()); + } + + [Test] + [TestCase("Debian,Ubuntu")] + [TestCase("Ubuntu")] + [TestCase("Fedora")] + public void VirtualClientComponentIsNotSupportedWhenTheLinuxDistributionDoesNotMatchTheSupportedLinuxDistributions(string supportedDistributions) + { + this.mockFixture.Setup(PlatformID.Unix); + this.SetupLinuxDistribution(LinuxDistribution.AzureLinux, LinuxUpstreamDistribution.Fedora); + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedLinuxDistributions)] = supportedDistributions; + + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsFalse(component.IsSupported()); + } + + [Test] + public void VirtualClientComponentIsSupportedWhenTheLinuxDistributionMatchesADownstreamDistribution() + { + // Ubuntu is a downstream distribution of Debian. The match is made on the distribution + // itself and not on the upstream distribution. + this.mockFixture.Setup(PlatformID.Unix); + this.SetupLinuxDistribution(LinuxDistribution.Ubuntu, LinuxUpstreamDistribution.Debian); + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedLinuxDistributions)] = "Debian,Ubuntu"; + + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsTrue(component.IsSupported()); + } + + [Test] + public void VirtualClientComponentIsNotSupportedOnNonLinuxSystemsWhenTheSupportedLinuxDistributionsParameterIsDefined() + { + // A component defining the parameter is describing Linux-specific behavior and thus + // is never supported on non-Linux systems. + this.mockFixture.Setup(PlatformID.Win32NT); + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedLinuxDistributions)] = "Ubuntu"; + + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsFalse(component.IsSupported()); + } + + [Test] + public void VirtualClientComponentIsNotSupportedWhenTheSupportedPlatformsDoNotMatchEvenIfTheLinuxDistributionMatches() + { + this.mockFixture.Setup(PlatformID.Unix, System.Runtime.InteropServices.Architecture.X64); + this.SetupLinuxDistribution(LinuxDistribution.AzureLinux, LinuxUpstreamDistribution.Fedora); + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedPlatforms)] = "linux-arm64"; + this.mockFixture.Parameters[nameof(VirtualClientComponent.SupportedLinuxDistributions)] = "AzureLinux"; + + TestVirtualClientComponent component = new TestVirtualClientComponent(this.mockFixture.Dependencies, this.mockFixture.Parameters); + + Assert.IsFalse(component.IsSupported()); + } + + private void SetupLinuxDistribution(LinuxDistribution distribution, LinuxUpstreamDistribution upstreamDistribution) + { + this.mockFixture.SystemManagement + .Setup(sm => sm.GetLinuxDistributionAsync(It.IsAny())) + .ReturnsAsync(new LinuxDistributionInfo + { + Name = distribution.ToString(), + Distribution = distribution, + UpstreamDistribution = upstreamDistribution + }); + } + private class TestVirtualClientComponent : VirtualClientComponent { public TestVirtualClientComponent(VirtualClientComponent component) @@ -743,6 +858,11 @@ public TestVirtualClientComponent(IServiceCollection dependencies, IDictionary public DateTime StartTime { get; private set; } + /// + /// Parameter describes the Linux distributions (e.g. AzureLinux, Ubuntu) for which the component + /// is supported. A component defining this parameter is never executed on non-Linux systems. + /// + public IEnumerable SupportedLinuxDistributions + { + get + { + this.Parameters.TryGetCollection(nameof(this.SupportedLinuxDistributions), out IEnumerable distributions); + return distributions ?? Array.Empty(); + } + } + /// /// Parameter describes the platform/architectures for which the component is supported. /// @@ -943,6 +956,10 @@ protected virtual bool IsSupported() { isSupported = false; } + else if (this.SupportedLinuxDistributions?.Any() == true && !this.IsSupportedLinuxDistribution()) + { + isSupported = false; + } else if (this.Layout?.Clients?.Count() >= 2 && this.Roles?.Any() == true) { // Execution Criteria @@ -1018,5 +1035,21 @@ private bool IsMe(ClientInstance clientInstance) return isMatch; } + + private bool IsSupportedLinuxDistribution() + { + bool isSupported = false; + if (this.Platform == PlatformID.Unix) + { + LinuxDistributionInfo distribution = this.systemInfo.GetLinuxDistributionAsync(CancellationToken.None) + .GetAwaiter().GetResult(); + + isSupported = this.SupportedLinuxDistributions.Contains( + distribution.Distribution.ToString(), + StringComparer.OrdinalIgnoreCase); + } + + return isSupported; + } } } \ No newline at end of file diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json index a70ac9ef05..d9a1f6fc51 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json @@ -3,7 +3,7 @@ "Metadata": { "RecommendedMinimumExecutionTime": "00:15:00", "SupportedPlatforms": "linux-x64,linux-arm64", - "SupportedOperatingSystems": "Ubuntu", + "SupportedOperatingSystems": "AzureLinux,Ubuntu", "Notes": "Database sizes vary based on RecordCount: Small (500000 records) ~8-10 GB, Medium (2500000 records) ~40-50 GB, Large (20000000 records) ~320-400 GB, XLarge (55000000 records) ~900 GB-1 TB. Default configuration uses Medium size (~40-50 GB) with 2500000 records." }, "Parameters": { @@ -173,10 +173,10 @@ "Type": "LinuxPackageInstallation", "Parameters": { "Scenario": "InstallMongoPrereqs", - "Packages-Apt": "gnupg,curl", - "Packages-Dnf": "gnupg,curl", - "Packages-Yum": "gnupg,curl", - "Packages-Zypper": "gpg2,curl" + "Packages-Apt": "gnupg,curl,lshw", + "Packages-Dnf": "gnupg2,curl,lshw", + "Packages-Yum": "gnupg2,curl,lshw", + "Packages-Zypper": "gpg2,curl,lshw" } }, { @@ -184,6 +184,7 @@ "Parameters": { "Scenario": "MongoGPGKey", "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "Debian,Ubuntu", "Command": "curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc -o server-8.0.asc" } }, @@ -192,6 +193,7 @@ "Parameters": { "Scenario": "MongoGPGDearmor", "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "Debian,Ubuntu", "Command": "sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg server-8.0.asc" } }, @@ -200,6 +202,7 @@ "Parameters": { "Scenario": "MongoAddRepository", "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "Debian,Ubuntu", "Command": "sudo sh -c \"echo 'deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse' > /etc/apt/sources.list.d/mongodb-org-8.0.list\"" } }, @@ -208,14 +211,43 @@ "Parameters": { "Scenario": "MongoUpdatePackageList", "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "Debian,Ubuntu", "Command": "sudo apt-get update" } }, + { + "Type": "ExecuteCommand", + "Parameters": { + "Scenario": "MongoImportGPGKey", + "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "AzureLinux", + "Command": "sudo rpm --import https://pgp.mongodb.com/server-8.0.asc" + } + }, + { + "Type": "ExecuteCommand", + "Parameters": { + "Scenario": "MongoCreateDnfRepository", + "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "AzureLinux", + "Command": "sudo sh -c \"echo '[mongodb-org-8.0]\nname=MongoDB Repository\nbaseurl=https://repo.mongodb.org/yum/redhat/9/mongodb-org/8.0/$basearch/\ngpgcheck=1\nenabled=1\ngpgkey=https://pgp.mongodb.com/server-8.0.asc' > /etc/yum.repos.d/mongodb-org-8.0.repo\"" + } + }, + { + "Type": "ExecuteCommand", + "Parameters": { + "Scenario": "MongoRefreshPackageMetadata", + "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "AzureLinux", + "Command": "sudo dnf makecache --refresh" + } + }, { "Type": "ExecuteCommand", "Parameters": { "Scenario": "MongoInstallServer", "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "Debian,Ubuntu", "Command": "sudo apt-get install -y mongodb-org", "Role": "Server" } @@ -225,10 +257,31 @@ "Parameters": { "Scenario": "MongoInstallClient", "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "Debian,Ubuntu", "Command": "sudo apt-get install -y mongodb-mongosh", "Role": "Client" } }, + { + "Type": "ExecuteCommand", + "Parameters": { + "Scenario": "MongoInstallServer", + "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "AzureLinux", + "Command": "sudo dnf install -y mongodb-org", + "Role": "Server" + } + }, + { + "Type": "ExecuteCommand", + "Parameters": { + "Scenario": "MongoInstallClient", + "SupportedPlatforms": "linux-x64,linux-arm64", + "SupportedLinuxDistributions": "AzureLinux", + "Command": "sudo dnf install -y mongodb-mongosh", + "Role": "Client" + } + }, { "Type": "ExecuteCommand", "Parameters": { From fbb547690af1b443a7d202f28da04a399fa77a58 Mon Sep 17 00:00:00 2001 From: Prashant Kumar Date: Tue, 11 Aug 2026 10:45:49 +0530 Subject: [PATCH 2/4] Fix duplicate key insert failures in YCSB run-phase insert scenarios Read_Latest (workloadd) and Short_Range_Scan (workloade) both perform 5% run-phase inserts. YCSB seeds the insert key sequence for both scenarios at recordcount, so the scenario that runs second collides with keys already written by the first and every insert fails with: E11000 duplicate key error collection: ycsb.usertable index: _id_ Measured on a 2500000 record run, Short_Range_Scan reported INSERT-Operations=0 with INSERT-FAILED-Operations=3445, matching the 3445 duplicate key errors in the logs exactly. Setting mongodb.upsert=true makes colliding inserts update the existing document instead of failing. This is the documented behaviour of the YCSB MongoDB binding for partially loaded data sets and requires no change to RecordCount, operation mix, metric names or scenario names. This issue is not platform specific and reproduces on both Ubuntu and Azure Linux. Verified on Azure Linux 3 and Ubuntu 24.04 (2 VM client/server, exit code 0, all 7 scenarios): Short_Range_Scan now reports non-zero INSERT-Operations with zero failed operations and no E11000 errors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json index d9a1f6fc51..54208f7ba5 100644 --- a/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json +++ b/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json @@ -107,7 +107,7 @@ "MetricScenario": "Read_Latest_95_Read_5_Insert_{RecordCount}_Records", "Database": "$.Parameters.Database", "Port": "$.Parameters.Port", - "RunCommand": "run {Database} -s -p maxexecutiontime={Duration.TotalSeconds} -p operationcount={OperationCount} -p recordcount={RecordCount} -threads {ThreadCount} -p fieldcount={FieldCount} -p fieldlength={FieldLength} -p mongodb.url=mongodb://{ServerIP}:{Port}/ycsb -P {PackagePath:ycsb}/ycsb-0.17.0/workloads/workloadd", + "RunCommand": "run {Database} -s -p maxexecutiontime={Duration.TotalSeconds} -p operationcount={OperationCount} -p recordcount={RecordCount} -threads {ThreadCount} -p fieldcount={FieldCount} -p fieldlength={FieldLength} -p mongodb.url=mongodb://{ServerIP}:{Port}/ycsb -p mongodb.upsert=true -P {PackagePath:ycsb}/ycsb-0.17.0/workloads/workloadd", "Duration": "$.Parameters.Duration", "ThreadCount": "$.Parameters.ThreadCount", "OperationCount": "5000000", @@ -126,7 +126,7 @@ "MetricScenario": "Short_Range_Scan_95_Scan_5_Insert_{RecordCount}_Records", "Database": "$.Parameters.Database", "Port": "$.Parameters.Port", - "RunCommand": "run {Database} -s -p maxexecutiontime={Duration.TotalSeconds} -p operationcount={OperationCount} -p recordcount={RecordCount} -threads {ThreadCount} -p fieldcount={FieldCount} -p fieldlength={FieldLength} -p mongodb.url=mongodb://{ServerIP}:{Port}/ycsb -P {PackagePath:ycsb}/ycsb-0.17.0/workloads/workloade", + "RunCommand": "run {Database} -s -p maxexecutiontime={Duration.TotalSeconds} -p operationcount={OperationCount} -p recordcount={RecordCount} -threads {ThreadCount} -p fieldcount={FieldCount} -p fieldlength={FieldLength} -p mongodb.url=mongodb://{ServerIP}:{Port}/ycsb -p mongodb.upsert=true -P {PackagePath:ycsb}/ycsb-0.17.0/workloads/workloade", "Duration": "$.Parameters.Duration", "ThreadCount": "$.Parameters.ThreadCount", "OperationCount": "5000000", From 68e0f04ee906cbb15f36f0bf403a46838486a0cc Mon Sep 17 00:00:00 2001 From: moprashant Date: Wed, 12 Aug 2026 16:53:16 +0530 Subject: [PATCH 3/4] Document Azure Linux support for the MongoDB YCSB profile The profile metadata declares SupportedOperatingSystems as 'AzureLinux,Ubuntu', but the workload documentation still listed Ubuntu only. This aligns the documentation with the profile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../workloads/mongodb/mongodb-profiles.md | 241 +++++++++--------- 1 file changed, 121 insertions(+), 120 deletions(-) diff --git a/website/docs/workloads/mongodb/mongodb-profiles.md b/website/docs/workloads/mongodb/mongodb-profiles.md index f5cad62fab..311bf1a989 100644 --- a/website/docs/workloads/mongodb/mongodb-profiles.md +++ b/website/docs/workloads/mongodb/mongodb-profiles.md @@ -1,121 +1,122 @@ -# MongoDB Workload Profiles -The following profile runs customer-representative or benchmarking scenarios using the YCSB (Yahoo! Cloud Serving Benchmark) workload against -a MongoDB server. - -* [Workload Details](./mongodb.md) -* [Client/Server Workloads](../../guides/0020-client-server.md) - -## Client/Server Topology Support -MongoDB workload profiles support running the workload in a client/server topology. This means that the workload is designed to run on 2 distinct systems. The client/server topology is used to include a network component in the overall performance evaluation. In a client/server topology, one system operates in the 'Client' role making calls to the system operating in the 'Server' role. The Virtual Client instances running on the client and server systems will synchronize with each other before running the workload. In order to support a client/server topology, an environment layout file MUST be supplied to each instance of the Virtual Client on the command line to describe the IP address/location of other Virtual Client instances. - -* [Environment Layouts](../../guides/0020-client-server.md) - -In the environment layout file provided to the Virtual Client, define the role of the client system/VM as "Client" and the role of the server system(s)/VM(s) as "Server". -The spelling of the roles must be exact. The IP addresses of the systems/VMs must be correct as well. The following example illustrates the -idea. The name of the client must match the name of the system or the value of the agent ID passed in on the command line. - -``` bash -# Multi-System -# On Client Role System... -./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Client01 --layoutPath=/any/path/to/layout.json - -# On Server Role System... -./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Server01 --layoutPath=/any/path/to/layout.json - -# Example contents of the 'layout.json' file: -{ - "clients": [ - { - "name": "Client01", - "role": "Client", - "ipAddress": "10.1.0.1" - }, - { - "name": "Server01", - "role": "Server", - "ipAddress": "10.1.0.2" - } - ] -} -``` - -## PERF-MONGODB-YCSB.json -Runs multiple workload variations using YCSB's built-in workloads to test MongoDB server performance across CPU, Memory, and Disk I/O. -This profile loads a dataset into MongoDB and then runs various read, write, scan, and mixed operation workloads against it using YCSB benchmark. - -* [Workload Profile](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json) - -* **Supported Platform/Architectures** - * linux-x64 - * linux-arm64 - -* **Supported Operating Systems** - * Ubuntu - -* **Supports Disconnected Scenarios** - * No. Internet connection required. - -* **Dependencies** - The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. - * Internet connection. - * The IP addresses defined in the environment layout (see above) for the Client and Server systems must be correct. - * The name of the Client and Server instances defined in the environment layout must match the agent/client IDs supplied on the command line (e.g. --clientId) - or must match the name of the system as defined by the operating system itself. - - Additional information on components that exist within the 'Dependencies' section of the profile can be found in the following locations: - * [Installing Dependencies](https://microsoft.github.io/VirtualClient/docs/category/dependencies/) - -* **Profile Parameters** - The following parameters can be optionally supplied on the command line to modify the behaviors of the workload. - - | Parameter | Purpose | Default Value | - |---------------------------|---------------------------------------------------------------------------------|---------------| - | Duration | Optional. Defines the length of time to execute each YCSB workload scenario against the MongoDB server. | 00:05:00 | - | ThreadCount | Optional. Number of threads to use during workload execution. | # logical processors / 2 | - | RecordCount | Optional. Number of records to load into the database. Affects database size: Small (500000) ~8-10 GB, Medium (2500000) ~40-50 GB, Large (20000000) ~320-400 GB, XLarge (55000000) ~900 GB-1 TB. | 2500000 | - | Port | Optional. The port on which the MongoDB server will listen for traffic. | 27017 | - | Database | Optional. The name of the MongoDB database to use for the workload. | mongodb | - | DiskFilter | Optional. Filter for selecting disks to use for MongoDB data storage. | BiggestSize | - -* **Workload Scenarios** - The profile executes the following YCSB workload scenarios: - - | Scenario | YCSB Workload | Description | - |--------------------------|---------------|-------------| - | read50_write50 | workloada | 50% reads, 50% updates | - | read95_write05 | workloadb | 95% reads, 5% updates | - | read100 | workloadc | 100% reads | - | read95_insert05 | workloadd | 95% reads, 5% inserts (Warning: grows database size) | - | scan95_insert05 | workloade | 95% scans, 5% inserts (Warning: grows database size) | - | read50_readmodifywrite50 | workloadf | 50% reads, 50% read-modify-write | - - Additional information on YCSB workloads can be found here: - * [YCSB Core Workloads](https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads) - -* **Database Size Considerations** - Database sizes vary based on RecordCount parameter: - * Small (500,000 records): ~8-10 GB - * Medium (2,500,000 records): ~40-50 GB (default) - * Large (20,000,000 records): ~320-400 GB - * XLarge (55,000,000 records): ~900 GB-1 TB - - **Warning**: The `read95_insert05` (workloadd) and `scan95_insert05` (workloade) scenarios insert new records into the database. This will cause the dataset to grow in size over time. This can lead to a server failure if MongoDB runs out of disk space. Ensure adequate disk space is available. - -* **Profile Runtimes** - See the 'Metadata' section of the profile for estimated runtimes. These timings represent the length of time required to run a single round of profile - actions. These timings can be used to determine minimum required runtimes for the Virtual Client in order to get results. These are often estimates based on the - number of system cores. - - Recommended minimum execution time: 15 minutes - -* **Usage Examples** - The following section provides a few basic examples of how to use the workload profile. - - ``` bash - # When running in a client/server environment - ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" - ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Server01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" - - # Example with custom parameters - ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" --parameters="Duration=00:10:00,,,RecordCount=5000000" +# MongoDB Workload Profiles +The following profile runs customer-representative or benchmarking scenarios using the YCSB (Yahoo! Cloud Serving Benchmark) workload against +a MongoDB server. + +* [Workload Details](./mongodb.md) +* [Client/Server Workloads](../../guides/0020-client-server.md) + +## Client/Server Topology Support +MongoDB workload profiles support running the workload in a client/server topology. This means that the workload is designed to run on 2 distinct systems. The client/server topology is used to include a network component in the overall performance evaluation. In a client/server topology, one system operates in the 'Client' role making calls to the system operating in the 'Server' role. The Virtual Client instances running on the client and server systems will synchronize with each other before running the workload. In order to support a client/server topology, an environment layout file MUST be supplied to each instance of the Virtual Client on the command line to describe the IP address/location of other Virtual Client instances. + +* [Environment Layouts](../../guides/0020-client-server.md) + +In the environment layout file provided to the Virtual Client, define the role of the client system/VM as "Client" and the role of the server system(s)/VM(s) as "Server". +The spelling of the roles must be exact. The IP addresses of the systems/VMs must be correct as well. The following example illustrates the +idea. The name of the client must match the name of the system or the value of the agent ID passed in on the command line. + +``` bash +# Multi-System +# On Client Role System... +./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Client01 --layoutPath=/any/path/to/layout.json + +# On Server Role System... +./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Server01 --layoutPath=/any/path/to/layout.json + +# Example contents of the 'layout.json' file: +{ + "clients": [ + { + "name": "Client01", + "role": "Client", + "ipAddress": "10.1.0.1" + }, + { + "name": "Server01", + "role": "Server", + "ipAddress": "10.1.0.2" + } + ] +} +``` + +## PERF-MONGODB-YCSB.json +Runs multiple workload variations using YCSB's built-in workloads to test MongoDB server performance across CPU, Memory, and Disk I/O. +This profile loads a dataset into MongoDB and then runs various read, write, scan, and mixed operation workloads against it using YCSB benchmark. + +* [Workload Profile](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json) + +* **Supported Platform/Architectures** + * linux-x64 + * linux-arm64 + +* **Supported Operating Systems** + * AzureLinux + * Ubuntu + +* **Supports Disconnected Scenarios** + * No. Internet connection required. + +* **Dependencies** + The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. + * Internet connection. + * The IP addresses defined in the environment layout (see above) for the Client and Server systems must be correct. + * The name of the Client and Server instances defined in the environment layout must match the agent/client IDs supplied on the command line (e.g. --clientId) + or must match the name of the system as defined by the operating system itself. + + Additional information on components that exist within the 'Dependencies' section of the profile can be found in the following locations: + * [Installing Dependencies](https://microsoft.github.io/VirtualClient/docs/category/dependencies/) + +* **Profile Parameters** + The following parameters can be optionally supplied on the command line to modify the behaviors of the workload. + + | Parameter | Purpose | Default Value | + |---------------------------|---------------------------------------------------------------------------------|---------------| + | Duration | Optional. Defines the length of time to execute each YCSB workload scenario against the MongoDB server. | 00:05:00 | + | ThreadCount | Optional. Number of threads to use during workload execution. | # logical processors / 2 | + | RecordCount | Optional. Number of records to load into the database. Affects database size: Small (500000) ~8-10 GB, Medium (2500000) ~40-50 GB, Large (20000000) ~320-400 GB, XLarge (55000000) ~900 GB-1 TB. | 2500000 | + | Port | Optional. The port on which the MongoDB server will listen for traffic. | 27017 | + | Database | Optional. The name of the MongoDB database to use for the workload. | mongodb | + | DiskFilter | Optional. Filter for selecting disks to use for MongoDB data storage. | BiggestSize | + +* **Workload Scenarios** + The profile executes the following YCSB workload scenarios: + + | Scenario | YCSB Workload | Description | + |--------------------------|---------------|-------------| + | read50_write50 | workloada | 50% reads, 50% updates | + | read95_write05 | workloadb | 95% reads, 5% updates | + | read100 | workloadc | 100% reads | + | read95_insert05 | workloadd | 95% reads, 5% inserts (Warning: grows database size) | + | scan95_insert05 | workloade | 95% scans, 5% inserts (Warning: grows database size) | + | read50_readmodifywrite50 | workloadf | 50% reads, 50% read-modify-write | + + Additional information on YCSB workloads can be found here: + * [YCSB Core Workloads](https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads) + +* **Database Size Considerations** + Database sizes vary based on RecordCount parameter: + * Small (500,000 records): ~8-10 GB + * Medium (2,500,000 records): ~40-50 GB (default) + * Large (20,000,000 records): ~320-400 GB + * XLarge (55,000,000 records): ~900 GB-1 TB + + **Warning**: The `read95_insert05` (workloadd) and `scan95_insert05` (workloade) scenarios insert new records into the database. This will cause the dataset to grow in size over time. This can lead to a server failure if MongoDB runs out of disk space. Ensure adequate disk space is available. + +* **Profile Runtimes** + See the 'Metadata' section of the profile for estimated runtimes. These timings represent the length of time required to run a single round of profile + actions. These timings can be used to determine minimum required runtimes for the Virtual Client in order to get results. These are often estimates based on the + number of system cores. + + Recommended minimum execution time: 15 minutes + +* **Usage Examples** + The following section provides a few basic examples of how to use the workload profile. + + ``` bash + # When running in a client/server environment + ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" + ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Server01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" + + # Example with custom parameters + ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" --parameters="Duration=00:10:00,,,RecordCount=5000000" ``` \ No newline at end of file From 9f4fd019f79bdcca2a0e3f034a14fb040cd873b2 Mon Sep 17 00:00:00 2001 From: moprashant Date: Wed, 12 Aug 2026 16:54:17 +0530 Subject: [PATCH 4/4] Fix line endings on the MongoDB docs update The previous commit was uploaded from a CRLF working copy, which rewrote every line. This restores LF endings so the change is the intended single line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../workloads/mongodb/mongodb-profiles.md | 242 +++++++++--------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/website/docs/workloads/mongodb/mongodb-profiles.md b/website/docs/workloads/mongodb/mongodb-profiles.md index 311bf1a989..61acb18c3a 100644 --- a/website/docs/workloads/mongodb/mongodb-profiles.md +++ b/website/docs/workloads/mongodb/mongodb-profiles.md @@ -1,122 +1,122 @@ -# MongoDB Workload Profiles -The following profile runs customer-representative or benchmarking scenarios using the YCSB (Yahoo! Cloud Serving Benchmark) workload against -a MongoDB server. - -* [Workload Details](./mongodb.md) -* [Client/Server Workloads](../../guides/0020-client-server.md) - -## Client/Server Topology Support -MongoDB workload profiles support running the workload in a client/server topology. This means that the workload is designed to run on 2 distinct systems. The client/server topology is used to include a network component in the overall performance evaluation. In a client/server topology, one system operates in the 'Client' role making calls to the system operating in the 'Server' role. The Virtual Client instances running on the client and server systems will synchronize with each other before running the workload. In order to support a client/server topology, an environment layout file MUST be supplied to each instance of the Virtual Client on the command line to describe the IP address/location of other Virtual Client instances. - -* [Environment Layouts](../../guides/0020-client-server.md) - -In the environment layout file provided to the Virtual Client, define the role of the client system/VM as "Client" and the role of the server system(s)/VM(s) as "Server". -The spelling of the roles must be exact. The IP addresses of the systems/VMs must be correct as well. The following example illustrates the -idea. The name of the client must match the name of the system or the value of the agent ID passed in on the command line. - -``` bash -# Multi-System -# On Client Role System... -./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Client01 --layoutPath=/any/path/to/layout.json - -# On Server Role System... -./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Server01 --layoutPath=/any/path/to/layout.json - -# Example contents of the 'layout.json' file: -{ - "clients": [ - { - "name": "Client01", - "role": "Client", - "ipAddress": "10.1.0.1" - }, - { - "name": "Server01", - "role": "Server", - "ipAddress": "10.1.0.2" - } - ] -} -``` - -## PERF-MONGODB-YCSB.json -Runs multiple workload variations using YCSB's built-in workloads to test MongoDB server performance across CPU, Memory, and Disk I/O. -This profile loads a dataset into MongoDB and then runs various read, write, scan, and mixed operation workloads against it using YCSB benchmark. - -* [Workload Profile](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json) - -* **Supported Platform/Architectures** - * linux-x64 - * linux-arm64 - -* **Supported Operating Systems** - * AzureLinux - * Ubuntu - -* **Supports Disconnected Scenarios** - * No. Internet connection required. - -* **Dependencies** - The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. - * Internet connection. - * The IP addresses defined in the environment layout (see above) for the Client and Server systems must be correct. - * The name of the Client and Server instances defined in the environment layout must match the agent/client IDs supplied on the command line (e.g. --clientId) - or must match the name of the system as defined by the operating system itself. - - Additional information on components that exist within the 'Dependencies' section of the profile can be found in the following locations: - * [Installing Dependencies](https://microsoft.github.io/VirtualClient/docs/category/dependencies/) - -* **Profile Parameters** - The following parameters can be optionally supplied on the command line to modify the behaviors of the workload. - - | Parameter | Purpose | Default Value | - |---------------------------|---------------------------------------------------------------------------------|---------------| - | Duration | Optional. Defines the length of time to execute each YCSB workload scenario against the MongoDB server. | 00:05:00 | - | ThreadCount | Optional. Number of threads to use during workload execution. | # logical processors / 2 | - | RecordCount | Optional. Number of records to load into the database. Affects database size: Small (500000) ~8-10 GB, Medium (2500000) ~40-50 GB, Large (20000000) ~320-400 GB, XLarge (55000000) ~900 GB-1 TB. | 2500000 | - | Port | Optional. The port on which the MongoDB server will listen for traffic. | 27017 | - | Database | Optional. The name of the MongoDB database to use for the workload. | mongodb | - | DiskFilter | Optional. Filter for selecting disks to use for MongoDB data storage. | BiggestSize | - -* **Workload Scenarios** - The profile executes the following YCSB workload scenarios: - - | Scenario | YCSB Workload | Description | - |--------------------------|---------------|-------------| - | read50_write50 | workloada | 50% reads, 50% updates | - | read95_write05 | workloadb | 95% reads, 5% updates | - | read100 | workloadc | 100% reads | - | read95_insert05 | workloadd | 95% reads, 5% inserts (Warning: grows database size) | - | scan95_insert05 | workloade | 95% scans, 5% inserts (Warning: grows database size) | - | read50_readmodifywrite50 | workloadf | 50% reads, 50% read-modify-write | - - Additional information on YCSB workloads can be found here: - * [YCSB Core Workloads](https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads) - -* **Database Size Considerations** - Database sizes vary based on RecordCount parameter: - * Small (500,000 records): ~8-10 GB - * Medium (2,500,000 records): ~40-50 GB (default) - * Large (20,000,000 records): ~320-400 GB - * XLarge (55,000,000 records): ~900 GB-1 TB - - **Warning**: The `read95_insert05` (workloadd) and `scan95_insert05` (workloade) scenarios insert new records into the database. This will cause the dataset to grow in size over time. This can lead to a server failure if MongoDB runs out of disk space. Ensure adequate disk space is available. - -* **Profile Runtimes** - See the 'Metadata' section of the profile for estimated runtimes. These timings represent the length of time required to run a single round of profile - actions. These timings can be used to determine minimum required runtimes for the Virtual Client in order to get results. These are often estimates based on the - number of system cores. - - Recommended minimum execution time: 15 minutes - -* **Usage Examples** - The following section provides a few basic examples of how to use the workload profile. - - ``` bash - # When running in a client/server environment - ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" - ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Server01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" - - # Example with custom parameters - ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" --parameters="Duration=00:10:00,,,RecordCount=5000000" +# MongoDB Workload Profiles +The following profile runs customer-representative or benchmarking scenarios using the YCSB (Yahoo! Cloud Serving Benchmark) workload against +a MongoDB server. + +* [Workload Details](./mongodb.md) +* [Client/Server Workloads](../../guides/0020-client-server.md) + +## Client/Server Topology Support +MongoDB workload profiles support running the workload in a client/server topology. This means that the workload is designed to run on 2 distinct systems. The client/server topology is used to include a network component in the overall performance evaluation. In a client/server topology, one system operates in the 'Client' role making calls to the system operating in the 'Server' role. The Virtual Client instances running on the client and server systems will synchronize with each other before running the workload. In order to support a client/server topology, an environment layout file MUST be supplied to each instance of the Virtual Client on the command line to describe the IP address/location of other Virtual Client instances. + +* [Environment Layouts](../../guides/0020-client-server.md) + +In the environment layout file provided to the Virtual Client, define the role of the client system/VM as "Client" and the role of the server system(s)/VM(s) as "Server". +The spelling of the roles must be exact. The IP addresses of the systems/VMs must be correct as well. The following example illustrates the +idea. The name of the client must match the name of the system or the value of the agent ID passed in on the command line. + +``` bash +# Multi-System +# On Client Role System... +./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Client01 --layoutPath=/any/path/to/layout.json + +# On Server Role System... +./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Juno --timeout=1440 --clientId=Server01 --layoutPath=/any/path/to/layout.json + +# Example contents of the 'layout.json' file: +{ + "clients": [ + { + "name": "Client01", + "role": "Client", + "ipAddress": "10.1.0.1" + }, + { + "name": "Server01", + "role": "Server", + "ipAddress": "10.1.0.2" + } + ] +} +``` + +## PERF-MONGODB-YCSB.json +Runs multiple workload variations using YCSB's built-in workloads to test MongoDB server performance across CPU, Memory, and Disk I/O. +This profile loads a dataset into MongoDB and then runs various read, write, scan, and mixed operation workloads against it using YCSB benchmark. + +* [Workload Profile](https://github.com/microsoft/VirtualClient/blob/main/src/VirtualClient/VirtualClient.Main/profiles/PERF-MONGODB-YCSB.json) + +* **Supported Platform/Architectures** + * linux-x64 + * linux-arm64 + +* **Supported Operating Systems** + * AzureLinux + * Ubuntu + +* **Supports Disconnected Scenarios** + * No. Internet connection required. + +* **Dependencies** + The dependencies defined in the 'Dependencies' section of the profile itself are required in order to run the workload operations effectively. + * Internet connection. + * The IP addresses defined in the environment layout (see above) for the Client and Server systems must be correct. + * The name of the Client and Server instances defined in the environment layout must match the agent/client IDs supplied on the command line (e.g. --clientId) + or must match the name of the system as defined by the operating system itself. + + Additional information on components that exist within the 'Dependencies' section of the profile can be found in the following locations: + * [Installing Dependencies](https://microsoft.github.io/VirtualClient/docs/category/dependencies/) + +* **Profile Parameters** + The following parameters can be optionally supplied on the command line to modify the behaviors of the workload. + + | Parameter | Purpose | Default Value | + |---------------------------|---------------------------------------------------------------------------------|---------------| + | Duration | Optional. Defines the length of time to execute each YCSB workload scenario against the MongoDB server. | 00:05:00 | + | ThreadCount | Optional. Number of threads to use during workload execution. | # logical processors / 2 | + | RecordCount | Optional. Number of records to load into the database. Affects database size: Small (500000) ~8-10 GB, Medium (2500000) ~40-50 GB, Large (20000000) ~320-400 GB, XLarge (55000000) ~900 GB-1 TB. | 2500000 | + | Port | Optional. The port on which the MongoDB server will listen for traffic. | 27017 | + | Database | Optional. The name of the MongoDB database to use for the workload. | mongodb | + | DiskFilter | Optional. Filter for selecting disks to use for MongoDB data storage. | BiggestSize | + +* **Workload Scenarios** + The profile executes the following YCSB workload scenarios: + + | Scenario | YCSB Workload | Description | + |--------------------------|---------------|-------------| + | read50_write50 | workloada | 50% reads, 50% updates | + | read95_write05 | workloadb | 95% reads, 5% updates | + | read100 | workloadc | 100% reads | + | read95_insert05 | workloadd | 95% reads, 5% inserts (Warning: grows database size) | + | scan95_insert05 | workloade | 95% scans, 5% inserts (Warning: grows database size) | + | read50_readmodifywrite50 | workloadf | 50% reads, 50% read-modify-write | + + Additional information on YCSB workloads can be found here: + * [YCSB Core Workloads](https://github.com/brianfrankcooper/YCSB/wiki/Core-Workloads) + +* **Database Size Considerations** + Database sizes vary based on RecordCount parameter: + * Small (500,000 records): ~8-10 GB + * Medium (2,500,000 records): ~40-50 GB (default) + * Large (20,000,000 records): ~320-400 GB + * XLarge (55,000,000 records): ~900 GB-1 TB + + **Warning**: The `read95_insert05` (workloadd) and `scan95_insert05` (workloade) scenarios insert new records into the database. This will cause the dataset to grow in size over time. This can lead to a server failure if MongoDB runs out of disk space. Ensure adequate disk space is available. + +* **Profile Runtimes** + See the 'Metadata' section of the profile for estimated runtimes. These timings represent the length of time required to run a single round of profile + actions. These timings can be used to determine minimum required runtimes for the Virtual Client in order to get results. These are often estimates based on the + number of system cores. + + Recommended minimum execution time: 15 minutes + +* **Usage Examples** + The following section provides a few basic examples of how to use the workload profile. + + ``` bash + # When running in a client/server environment + ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" + ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Server01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" + + # Example with custom parameters + ./VirtualClient --profile=PERF-MONGODB-YCSB.json --system=Demo --timeout=1440 --clientId=Client01 --layoutPath="/any/path/to/layout.json" --packageStore="{BlobConnectionString|SAS Uri}" --parameters="Duration=00:10:00,,,RecordCount=5000000" ``` \ No newline at end of file