Browse Source

adjust thread count based on hardware and scenario

Nathan Anderson 8 years ago
parent
commit
e1b6427530

+ 18 - 9
frameworks/CSharp/aspnetcore/Benchmarks/project.json

@@ -1,8 +1,15 @@
 {
   "version": "1.0.0-*",
-  "compilationOptions": {
+  "buildOptions": {
     "emitEntryPoint": true,
-    "preserveCompilationContext": true
+    "preserveCompilationContext": true,
+    "copyToOutput": {
+      "include": [
+        "appsettings.json",
+        "wwwroot",
+        "Views"
+      ]
+    }
   },
   "dependencies": {
     "Dapper": "1.50.0-*",
@@ -28,7 +35,7 @@
           "version": "1.0.0-*",
           "type": "platform"
         },
-        "System.Runtime.Serialization.Primitives": "4.1.0-*"
+        "System.Runtime.Serialization.Primitives": "4.1.1-*"
       }
     },
     "net451": { }
@@ -42,14 +49,16 @@
       ]
     }
   },
-  "content": [
-    "appsettings.json",
-    "wwwroot",
-    "Views"
-  ],
+  "publishOptions": {
+    "include": [
+      "appsettings.json",
+      "wwwroot",
+      "Views"
+    ]
+  },
   "runtimeOptions": {
     "configProperties": {
       "System.GC.Server": true
     }
   }
-}
+}

+ 39 - 4
frameworks/CSharp/aspnetcore/benchmark_config.json

@@ -2,8 +2,7 @@
   "framework": "aspnetcore",
   "tests": [{
     "default": {
-      "setup_file": "setup",
-      "json_url": "/json",
+      "setup_file": "setup-plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "approach": "Realistic",
@@ -20,9 +19,26 @@
       "notes": "",
       "versus": ""
     },
+    "middleware-json": {
+      "setup_file": "setup-json",
+      "json_url": "/json",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "None",
+      "framework": "aspnetcore",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": "NET",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "aspnetcore-linux",
+      "notes": "",
+      "versus": ""
+    },
     "mvc-linux": {
-      "setup_file": "setup-mvc",
-      "json_url": "/mvc/json",
+      "setup_file": "setup-plaintext",
       "plaintext_url": "/mvc/plaintext",
       "port": 8080,
       "approach": "Realistic",
@@ -39,6 +55,25 @@
       "notes": "",
       "versus": ""
     },
+    "mvc-linux-json": {
+      "setup_file": "setup-json",
+      "json_url": "/mvc/json",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "None",
+      "framework": "aspnetcore",
+      "language": "C#",
+      "orm": "Raw",
+      "platform": "NET",
+      "webserver": "Kestrel",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "aspnetcore-mvc-linux",
+      "notes": "",
+      "versus": ""
+    },
+
     "win": {
       "setup_file": "setup-windows",
       "json_url": "/json",

+ 8 - 2
frameworks/CSharp/aspnetcore/run-linux.sh

@@ -1,8 +1,14 @@
 #!/bin/bash
 fw_depends mono dotnetcore
-sudo apt-get install unzip libunwind8 -y
+
+threadCount=$2
+if [ "$threadCount" -lt "1" ]
+then
+    threadCount=1
+fi
 
 cd Benchmarks
 dotnet restore
 dotnet build -c Release -f netcoreapp1.0
-dotnet run -c Release server.urls=http://*:8080 scenarios=$1 server=kestrel threadCount=1 NonInteractive=true &
+
+dotnet run -c Release server.urls=http://*:8080 scenarios=$1 server=kestrel threadCount=$threadCount NonInteractive=true &

+ 3 - 0
frameworks/CSharp/aspnetcore/setup-json.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+source run-linux.sh json $(($(nproc)*3/4))

+ 0 - 3
frameworks/CSharp/aspnetcore/setup-mvc.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh mvcjson,mvcplain

+ 3 - 0
frameworks/CSharp/aspnetcore/setup-plaintext.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+source run-linux.sh plaintext $(($(nproc)/6))

+ 0 - 3
frameworks/CSharp/aspnetcore/setup.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source run-linux.sh [default]

+ 4 - 4
toolset/setup/linux/languages/dotnetcore.sh

@@ -6,11 +6,11 @@ RETCODE=$(fw_exists ${IROOT}/dotnetcore.installed)
   dotnet --info
   return 0; }
 
-sudo apt-get install unzip libunwind8 -y
-fw_get -O https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.sh
-chmod +x $IROOT/dotnet-install.sh
+sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' 
+sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
+sudo apt-get update
 
-$IROOT/dotnet-install.sh
+sudo apt-get install dotnet-dev-1.0.0-preview2-003131 -y
 echo "PATH=$HOME/.dotnet:$PATH" > $IROOT/dotnetcore.installed
 
 source $IROOT/dotnetcore.installed