From e4a73b7f7e1cc3d04580c1c227c9da170934e7a7 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 28 Apr 2021 15:17:58 -0700 Subject: [PATCH 01/21] draft. --- sdk/storage/azure-storage-perf/pom.xml | 69 +++++++++++++++++++ .../blob/perf/UploadOutputStreamTest.java | 2 +- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index dc4124caed0dc..8836e1172e3ba 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -65,4 +65,73 @@ + + + + storage-stress-scenarios + + + storage-stress-scenarios + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + uploadoutputstream + verify + + exec + + + java + + -Xms700m + -Xmx700m + -jar + ${project.basedir}/target/${project.artifactId}-${project.version}-jar-with-dependencies.jar + uploadoutputstream + --warmup + 0 + --duration + 120 + --size + 1048576000 + --sync + + + + + uploadblob + verify + + exec + + + java + + -Xms50m + -Xmx50m + -jar + ${project.basedir}/target/${project.artifactId}-${project.version}-jar-with-dependencies.jar + uploadblob + --warmup + 0 + --duration + 120 + --size + 1048576000 + + + + + + + + + diff --git a/sdk/storage/azure-storage-perf/src/main/java/com/azure/storage/blob/perf/UploadOutputStreamTest.java b/sdk/storage/azure-storage-perf/src/main/java/com/azure/storage/blob/perf/UploadOutputStreamTest.java index 8988dd196f0b7..5a27d24573f82 100644 --- a/sdk/storage/azure-storage-perf/src/main/java/com/azure/storage/blob/perf/UploadOutputStreamTest.java +++ b/sdk/storage/azure-storage-perf/src/main/java/com/azure/storage/blob/perf/UploadOutputStreamTest.java @@ -20,7 +20,7 @@ public UploadOutputStreamTest(PerfStressOptions options) { @Override public void run() { try { - BlobOutputStream blobOutputStream = blockBlobClient.getBlobOutputStream(); + BlobOutputStream blobOutputStream = blockBlobClient.getBlobOutputStream(true); writeBytesToOutputStream(blobOutputStream, options.getSize()); blobOutputStream.close(); } catch (IOException e) { From 5f9a986168a06a93160e41346b264c76f8481279 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 28 Apr 2021 15:33:48 -0700 Subject: [PATCH 02/21] does this work ? --- sdk/storage/tests.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 5e9f73780448c..4e2d5f06081df 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -47,6 +47,19 @@ stages: Path: sdk/storage/platform-matrix.json Selection: sparse GenerateVMJobs: true + PostSteps: + - task: Maven@3 + displayName: 'Run Stress Scenarios' + inputs: + mavenPomFile: sdk/storage/azure-storage-perf/pom.xml + options: -Dstorage-stress-scenarios + mavenOptions: '$(MemoryOptions) $(LoggingOptions)' + javaHomeOption: 'JDKVersion' + jdkVersionOption: $(JavaTestVersion) + jdkArchitectureOption: 'x64' + goals: verify + env: + STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_BLOB_CONNECTION_STRING) EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) From 40c3bd4827764415580e1b73c704840b98918bc9 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 28 Apr 2021 17:30:02 -0700 Subject: [PATCH 03/21] try this. --- sdk/storage/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 4e2d5f06081df..67ac179326316 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -35,6 +35,9 @@ stages: - name: azure-storage-queue groupId: com.azure safeName: azurestoragequeue + AdditionalModules: + - name: perf-test-core + groupId: com.azure TestMode: 'LIVE' TimeoutInMinutes: 240 Location: canadacentral From be5a8030bf28036f8c55fe997a7050673a89db9e Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Thu, 29 Apr 2021 11:49:35 -0700 Subject: [PATCH 04/21] well, here is verbosity... --- sdk/storage/azure-storage-perf/pom.xml | 4 ++-- sdk/storage/tests.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index 8836e1172e3ba..20df1857ae3ce 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -90,8 +90,8 @@ java - -Xms700m - -Xmx700m + -Xms100m + -Xmx100m -jar ${project.basedir}/target/${project.artifactId}-${project.version}-jar-with-dependencies.jar uploadoutputstream diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 67ac179326316..8f60b31d6ea34 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -55,7 +55,7 @@ stages: displayName: 'Run Stress Scenarios' inputs: mavenPomFile: sdk/storage/azure-storage-perf/pom.xml - options: -Dstorage-stress-scenarios + options: '$(DefaultOptions) -Dstorage-stress-scenarios' mavenOptions: '$(MemoryOptions) $(LoggingOptions)' javaHomeOption: 'JDKVersion' jdkVersionOption: $(JavaTestVersion) From 326ad612ef2a5e85dfac4bec8de0579ee23e39b2 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 15:10:30 -0700 Subject: [PATCH 05/21] disable tests temporarily --- sdk/storage/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 1bb05f827f6c7..3f0dd9a30b291 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -43,7 +43,7 @@ stages: Location: canadacentral Clouds: 'Preview' TestStepMavenInputs: - options: '$(DefaultOptions) -T 1C -Dmaven.javadoc.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)' + options: '$(DefaultOptions) -T 1C -Dmaven.javadoc.skip=true -DskipTests -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)' MatrixReplace: # Use dedicated storage pool in canadacentral with higher memory capacity - Pool=(.*)-general/$1-storage From a2d29c8fe5c4cca0042df2317d065fe3bb859121 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 15:18:04 -0700 Subject: [PATCH 06/21] try this. --- sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 | 1 + sdk/storage/tests.yml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 new file mode 100644 index 0000000000000..296cf78560dd0 --- /dev/null +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -0,0 +1 @@ +java -version diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 3f0dd9a30b291..d63f34e8beda1 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -59,6 +59,11 @@ stages: Selection: sparse GenerateVMJobs: true PostSteps: + - task: PowerShell@2 + displayName: 'Run Stress Scenarios' + inputs: + targetType: 'filePath' + filePath: sdk/storage/azure-storage-perf - task: Maven@3 displayName: 'Run Stress Scenarios' inputs: @@ -70,7 +75,7 @@ stages: jdkArchitectureOption: 'x64' goals: verify env: - STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_BLOB_CONNECTION_STRING) + STORAGE_CONNECTION_STRING: $(PRIMARY_STORAGE_CONNECTION_STRING) EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) From 478309b00ffcdc73ddbd0a913e45b7a388b8f494 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 15:31:30 -0700 Subject: [PATCH 07/21] ugh.. --- sdk/storage/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index d63f34e8beda1..9983e6f8b2dc4 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -63,7 +63,7 @@ stages: displayName: 'Run Stress Scenarios' inputs: targetType: 'filePath' - filePath: sdk/storage/azure-storage-perf + filePath: sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 - task: Maven@3 displayName: 'Run Stress Scenarios' inputs: From 4c7ba2b9fcd629903189042ef6a2822af4266e18 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 16:01:48 -0700 Subject: [PATCH 08/21] right java ? --- sdk/storage/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 9983e6f8b2dc4..bcf76d585d617 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -64,6 +64,11 @@ stages: inputs: targetType: 'filePath' filePath: sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 + env: + ${{ if eq(variables['JavaTestVersion'], '1.11') }}: + PATH: $(JAVA_HOME_11_X64)/bin;$(PATH) + ${{ if eq(variables['JavaTestVersion'], '1.8') }}: + PATH: $(JAVA_HOME_8_X64)/bin;$(PATH) - task: Maven@3 displayName: 'Run Stress Scenarios' inputs: From d4c4810353910eb8c3e9cae93a6a791bafe6a8b8 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 16:34:06 -0700 Subject: [PATCH 09/21] right java ? --- sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 | 4 +++- sdk/storage/tests.yml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index 296cf78560dd0..d3c449637f792 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -1 +1,3 @@ -java -version +$JavaPath = Join-Path -Path $Env:JAVA_HOME -ChildPath "bin" | Join-Path -ChildPath "java" + +Invoke-Expression "& '$JavaPath' -version" diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index bcf76d585d617..130089dd5de58 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -66,9 +66,9 @@ stages: filePath: sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 env: ${{ if eq(variables['JavaTestVersion'], '1.11') }}: - PATH: $(JAVA_HOME_11_X64)/bin;$(PATH) + JAVA_HOME: $(JAVA_HOME_11_X64) ${{ if eq(variables['JavaTestVersion'], '1.8') }}: - PATH: $(JAVA_HOME_8_X64)/bin;$(PATH) + JAVA_HOME: $(JAVA_HOME_8_X64) - task: Maven@3 displayName: 'Run Stress Scenarios' inputs: From fac73ea07ce9fee12d5c458084f0543bb7845634 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 17:09:29 -0700 Subject: [PATCH 10/21] try this. --- sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 | 5 +++++ sdk/storage/tests.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index d3c449637f792..ade2de83e5766 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -1,3 +1,8 @@ $JavaPath = Join-Path -Path $Env:JAVA_HOME -ChildPath "bin" | Join-Path -ChildPath "java" +$TargetDirPath = Join-Path -Path $PSScriptRoot -ChildPath "target" +$PerfJarPath = Get-ChildItem -Path (Join-Path -Path $TargetDirPath -ChildPath "*") -Include azure-storage-perf-*-jar-with-dependencies.jar -File Invoke-Expression "& '$JavaPath' -version" + +Invoke-Expression "& '$JavaPath' -Xms100m -Xmx100m -jar '$PerfJarPath' uploadoutputstream --warmup 0 --duration 120 --size 1048576000 --sync" +Invoke-Expression "& '$JavaPath' -Xms50m -Xmx50m -jar '$PerfJarPath' uploadblob --warmup 0 --duration 120 --size 1048576000" diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 130089dd5de58..a56e37745e228 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -69,6 +69,7 @@ stages: JAVA_HOME: $(JAVA_HOME_11_X64) ${{ if eq(variables['JavaTestVersion'], '1.8') }}: JAVA_HOME: $(JAVA_HOME_8_X64) + STORAGE_CONNECTION_STRING: $(PRIMARY_STORAGE_CONNECTION_STRING) - task: Maven@3 displayName: 'Run Stress Scenarios' inputs: From 3dea10018c3fd7c27d720c1e4f1dc82a1a2b3edd Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 17:36:25 -0700 Subject: [PATCH 11/21] try this. --- sdk/storage/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index a56e37745e228..8d900dcbc1c07 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -38,6 +38,8 @@ stages: AdditionalModules: - name: perf-test-core groupId: com.azure + - name: azure-storage-perf + groupId: com.azure TestMode: 'LIVE' TimeoutInMinutes: 240 Location: canadacentral From eff14bb3e564607ce1150bf6e189dcd1fdd98103 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 19:10:35 -0700 Subject: [PATCH 12/21] comment out hanging case. --- sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index ade2de83e5766..61141f15ff2be 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -5,4 +5,4 @@ $PerfJarPath = Get-ChildItem -Path (Join-Path -Path $TargetDirPath -ChildPath "* Invoke-Expression "& '$JavaPath' -version" Invoke-Expression "& '$JavaPath' -Xms100m -Xmx100m -jar '$PerfJarPath' uploadoutputstream --warmup 0 --duration 120 --size 1048576000 --sync" -Invoke-Expression "& '$JavaPath' -Xms50m -Xmx50m -jar '$PerfJarPath' uploadblob --warmup 0 --duration 120 --size 1048576000" +#Invoke-Expression "& '$JavaPath' -Xms500m -Xmx500m -jar '$PerfJarPath' uploadblob --warmup 0 --duration 120 --size 1048576000" From 02aa1ce2aa4d7d7ccd60fbda160653b7f0f8e5ee Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 19:46:52 -0700 Subject: [PATCH 13/21] make sure at least iteration completes --- .../main/java/com/azure/perf/test/core/PerfStressProgram.java | 2 +- sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java index 833429db1e0bc..eb3708aa83035 100644 --- a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java +++ b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java @@ -249,7 +249,7 @@ private static Mono runLoopAsync(PerfStressTest test, int index, long e completedOperations[index]++; lastCompletionNanoTimes[index] = System.nanoTime() - startNanoTime; }) - .take(Duration.ofNanos(endNanoTime - startNanoTime)) + .takeWhile(i -> System.nanoTime() < endNanoTime || completedOperations[index] == 0) .then(); } diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index 61141f15ff2be..3bb9bc5710a9b 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -4,5 +4,5 @@ $PerfJarPath = Get-ChildItem -Path (Join-Path -Path $TargetDirPath -ChildPath "* Invoke-Expression "& '$JavaPath' -version" -Invoke-Expression "& '$JavaPath' -Xms100m -Xmx100m -jar '$PerfJarPath' uploadoutputstream --warmup 0 --duration 120 --size 1048576000 --sync" -#Invoke-Expression "& '$JavaPath' -Xms500m -Xmx500m -jar '$PerfJarPath' uploadblob --warmup 0 --duration 120 --size 1048576000" +Invoke-Expression "& '$JavaPath' -Xms500m -Xmx500m -jar '$PerfJarPath' uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" +Invoke-Expression "& '$JavaPath' -Xms500m -Xmx500m -jar '$PerfJarPath' uploadblob --warmup 0 --duration 1 --size 1048576000" From bbecc1ce04ac1a046bef46a93849f8d908f14a3b Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 19:47:39 -0700 Subject: [PATCH 14/21] undo maven way... --- sdk/storage/azure-storage-perf/pom.xml | 69 -------------------------- sdk/storage/tests.yml | 12 ----- 2 files changed, 81 deletions(-) diff --git a/sdk/storage/azure-storage-perf/pom.xml b/sdk/storage/azure-storage-perf/pom.xml index 9a7ee7948247a..8cf97b1143ff5 100644 --- a/sdk/storage/azure-storage-perf/pom.xml +++ b/sdk/storage/azure-storage-perf/pom.xml @@ -79,73 +79,4 @@ - - - - storage-stress-scenarios - - - storage-stress-scenarios - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - uploadoutputstream - verify - - exec - - - java - - -Xms100m - -Xmx100m - -jar - ${project.basedir}/target/${project.artifactId}-${project.version}-jar-with-dependencies.jar - uploadoutputstream - --warmup - 0 - --duration - 120 - --size - 1048576000 - --sync - - - - - uploadblob - verify - - exec - - - java - - -Xms50m - -Xmx50m - -jar - ${project.basedir}/target/${project.artifactId}-${project.version}-jar-with-dependencies.jar - uploadblob - --warmup - 0 - --duration - 120 - --size - 1048576000 - - - - - - - - - diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index 8d900dcbc1c07..d3e0185af7d34 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -72,18 +72,6 @@ stages: ${{ if eq(variables['JavaTestVersion'], '1.8') }}: JAVA_HOME: $(JAVA_HOME_8_X64) STORAGE_CONNECTION_STRING: $(PRIMARY_STORAGE_CONNECTION_STRING) - - task: Maven@3 - displayName: 'Run Stress Scenarios' - inputs: - mavenPomFile: sdk/storage/azure-storage-perf/pom.xml - options: '$(DefaultOptions) -Dstorage-stress-scenarios' - mavenOptions: '$(MemoryOptions) $(LoggingOptions)' - javaHomeOption: 'JDKVersion' - jdkVersionOption: $(JavaTestVersion) - jdkArchitectureOption: 'x64' - goals: verify - env: - STORAGE_CONNECTION_STRING: $(PRIMARY_STORAGE_CONNECTION_STRING) EnvVars: AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) From ab92b86b7bfe9654d74274fd1d8f93606cf513a0 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 19:47:56 -0700 Subject: [PATCH 15/21] undo disable tests. --- sdk/storage/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index d3e0185af7d34..a516f98938f38 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -45,7 +45,7 @@ stages: Location: canadacentral Clouds: 'Preview' TestStepMavenInputs: - options: '$(DefaultOptions) -T 1C -Dmaven.javadoc.skip=true -DskipTests -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)' + options: '$(DefaultOptions) -T 1C -Dmaven.javadoc.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -DtrimStackTrace=false -pl $(ProjectList)' MatrixReplace: # Use dedicated storage pool in canadacentral with higher memory capacity - Pool=(.*)-general/$1-storage From 0c8adab57c578a433a27183e80197d00e36cb3f6 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 20:57:37 -0700 Subject: [PATCH 16/21] refactor. --- .../memory-stress-scenarios.ps1 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index 3bb9bc5710a9b..9eff73dc6377e 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -4,5 +4,20 @@ $PerfJarPath = Get-ChildItem -Path (Join-Path -Path $TargetDirPath -ChildPath "* Invoke-Expression "& '$JavaPath' -version" -Invoke-Expression "& '$JavaPath' -Xms500m -Xmx500m -jar '$PerfJarPath' uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" -Invoke-Expression "& '$JavaPath' -Xms500m -Xmx500m -jar '$PerfJarPath' uploadblob --warmup 0 --duration 1 --size 1048576000" +function Run-Scenario { + param ( + [Parameter(Mandatory=$true, Position=0)] + [string] $HeapSize, + [Parameter(Mandatory=$true, Position=1)] + [string] $Scenario + ) + Write-Host "Executing '$Scenario' with '$HeapSize' heap" + Invoke-Expression "& '$JavaPath' -Xms$HeapSize -Xmx$HeapSize -jar '$PerfJarPath' $Scenario" + if ($LASTEXITCODE -ne 0) { + Write-Host "Scenario failed, exiting" + exit 1 + } +} + +Run-Scenario "700m" "uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" +Run-Scenario "700m" "uploadblob --warmup 0 --duration 1 --size 1048576000" From 15b0db18ecdfad7d2403a7d4b7cc3ac1760388f1 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Mon, 17 May 2021 21:06:23 -0700 Subject: [PATCH 17/21] this normally completes faster now. --- sdk/storage/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/tests.yml b/sdk/storage/tests.yml index a516f98938f38..b2c7245adaa0c 100644 --- a/sdk/storage/tests.yml +++ b/sdk/storage/tests.yml @@ -41,7 +41,7 @@ stages: - name: azure-storage-perf groupId: com.azure TestMode: 'LIVE' - TimeoutInMinutes: 240 + TimeoutInMinutes: 60 Location: canadacentral Clouds: 'Preview' TestStepMavenInputs: From ebd3e2c624db7150e35050ef56e70a3ee6d416df Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 18 May 2021 14:04:30 -0700 Subject: [PATCH 18/21] this isn't necessary. --- .../perf/test/core/PerfStressProgram.java | 2 +- .../com/azure/storage/blob/BlobClient.java | 26 +++++++++++++++++++ .../memory-stress-scenarios.ps1 | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java index eb3708aa83035..75cd2f2f07f7a 100644 --- a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java +++ b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java @@ -249,7 +249,7 @@ private static Mono runLoopAsync(PerfStressTest test, int index, long e completedOperations[index]++; lastCompletionNanoTimes[index] = System.nanoTime() - startNanoTime; }) - .takeWhile(i -> System.nanoTime() < endNanoTime || completedOperations[index] == 0) + .takeWhile(i -> System.nanoTime() < endNanoTime) .then(); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java index 21c8299cded3e..f5432acd6f8d7 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java @@ -26,13 +26,22 @@ import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.implementation.UploadUtils; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.io.IOException; import java.io.InputStream; import java.io.UncheckedIOException; +import java.nio.ByteBuffer; +import java.nio.channels.AsynchronousFileChannel; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; import java.time.Duration; import java.util.Map; import java.util.Objects; +import java.util.UUID; /** * This class provides a client that contains generic blob operations for Azure Storage Blobs. Operations allowed by @@ -367,4 +376,21 @@ public Response uploadFromFileWithResponse(BlobUploadFromFileOpti throw logger.logExceptionAsError(e); } } + + private static String CONN = "DefaultEndpointsProtocol=https;AccountName=kasoboltest;AccountKey=KpxM9LrNFBlIxAdjUdQZ5N6AxT9geKdYV2sMZssnmjQ0tdSXx3QrFm91tQgo91c+4f+ywFeKFyRDTA64x5uvKA==;EndpointSuffix=core.windows.net"; + + public static void main(String[] args) throws IOException { + BlobServiceAsyncClient blobServiceAsyncClient = new BlobServiceClientBuilder() + .connectionString(CONN) + .buildAsyncClient(); + BlobContainerAsyncClient container = blobServiceAsyncClient.getBlobContainerAsyncClient("testasynchang"); + + //container.create().block(); + + BlobAsyncClient blobAsyncClient = container.getBlobAsyncClient(UUID.randomUUID().toString()); + Path path = Paths.get("C:\\tmp\\10gb\\10GB-blob-upload-stackoverflow.dmp"); + AsynchronousFileChannel channel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); + Flux byteBufferFlux = FluxUtil.readFile(channel); + blobAsyncClient.upload(byteBufferFlux, null).block(); + } } diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index 9eff73dc6377e..1727ee3ed6f3f 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -19,5 +19,5 @@ function Run-Scenario { } } -Run-Scenario "700m" "uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" +#Run-Scenario "100m" "uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" Run-Scenario "700m" "uploadblob --warmup 0 --duration 1 --size 1048576000" From b5afc84da0dadf3fc4c91198727b0dffefd86c1e Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 18 May 2021 14:10:36 -0700 Subject: [PATCH 19/21] Revert "this isn't necessary." This reverts commit ebd3e2c6 --- .../perf/test/core/PerfStressProgram.java | 2 +- .../com/azure/storage/blob/BlobClient.java | 26 ------------------- .../memory-stress-scenarios.ps1 | 2 +- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java index 75cd2f2f07f7a..eb3708aa83035 100644 --- a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java +++ b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java @@ -249,7 +249,7 @@ private static Mono runLoopAsync(PerfStressTest test, int index, long e completedOperations[index]++; lastCompletionNanoTimes[index] = System.nanoTime() - startNanoTime; }) - .takeWhile(i -> System.nanoTime() < endNanoTime) + .takeWhile(i -> System.nanoTime() < endNanoTime || completedOperations[index] == 0) .then(); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java index f5432acd6f8d7..21c8299cded3e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java @@ -26,22 +26,13 @@ import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.implementation.UploadUtils; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.io.IOException; import java.io.InputStream; import java.io.UncheckedIOException; -import java.nio.ByteBuffer; -import java.nio.channels.AsynchronousFileChannel; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; import java.time.Duration; import java.util.Map; import java.util.Objects; -import java.util.UUID; /** * This class provides a client that contains generic blob operations for Azure Storage Blobs. Operations allowed by @@ -376,21 +367,4 @@ public Response uploadFromFileWithResponse(BlobUploadFromFileOpti throw logger.logExceptionAsError(e); } } - - private static String CONN = "DefaultEndpointsProtocol=https;AccountName=kasoboltest;AccountKey=KpxM9LrNFBlIxAdjUdQZ5N6AxT9geKdYV2sMZssnmjQ0tdSXx3QrFm91tQgo91c+4f+ywFeKFyRDTA64x5uvKA==;EndpointSuffix=core.windows.net"; - - public static void main(String[] args) throws IOException { - BlobServiceAsyncClient blobServiceAsyncClient = new BlobServiceClientBuilder() - .connectionString(CONN) - .buildAsyncClient(); - BlobContainerAsyncClient container = blobServiceAsyncClient.getBlobContainerAsyncClient("testasynchang"); - - //container.create().block(); - - BlobAsyncClient blobAsyncClient = container.getBlobAsyncClient(UUID.randomUUID().toString()); - Path path = Paths.get("C:\\tmp\\10gb\\10GB-blob-upload-stackoverflow.dmp"); - AsynchronousFileChannel channel = AsynchronousFileChannel.open(path, StandardOpenOption.READ); - Flux byteBufferFlux = FluxUtil.readFile(channel); - blobAsyncClient.upload(byteBufferFlux, null).block(); - } } diff --git a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 index 1727ee3ed6f3f..9eff73dc6377e 100644 --- a/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 +++ b/sdk/storage/azure-storage-perf/memory-stress-scenarios.ps1 @@ -19,5 +19,5 @@ function Run-Scenario { } } -#Run-Scenario "100m" "uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" +Run-Scenario "700m" "uploadoutputstream --warmup 0 --duration 1 --size 1048576000 --sync" Run-Scenario "700m" "uploadblob --warmup 0 --duration 1 --size 1048576000" From ac336589f50fa1e8542fba1a630796175c86c9b9 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 18 May 2021 14:11:05 -0700 Subject: [PATCH 20/21] this isn't necessary --- .../main/java/com/azure/perf/test/core/PerfStressProgram.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java index eb3708aa83035..75cd2f2f07f7a 100644 --- a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java +++ b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java @@ -249,7 +249,7 @@ private static Mono runLoopAsync(PerfStressTest test, int index, long e completedOperations[index]++; lastCompletionNanoTimes[index] = System.nanoTime() - startNanoTime; }) - .takeWhile(i -> System.nanoTime() < endNanoTime || completedOperations[index] == 0) + .takeWhile(i -> System.nanoTime() < endNanoTime) .then(); } From 196440918ff8526a61f89f74a50f60f1ecb4269d Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Tue, 18 May 2021 14:40:35 -0700 Subject: [PATCH 21/21] add assertion to make sure we don't regress "at least one operation completed". --- .../main/java/com/azure/perf/test/core/PerfStressProgram.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java index 75cd2f2f07f7a..f80085efb9e22 100644 --- a/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java +++ b/common/perf-test-core/src/main/java/com/azure/perf/test/core/PerfStressProgram.java @@ -221,6 +221,9 @@ public static void runTests(PerfStressTest[] tests, boolean sync, int paralle System.out.println("=== Results ==="); int totalOperations = getCompletedOperations(); + if (totalOperations == 0) { + throw new IllegalStateException("Zero operations has been completed"); + } double operationsPerSecond = getOperationsPerSecond(); double secondsPerOperation = 1 / operationsPerSecond; double weightedAverageSeconds = totalOperations / operationsPerSecond;