Browse Source

Merge branch 'fixNancy-mono' of https://github.com/TechEmpower/FrameworkBenchmarks into lgratrix-fix-nancy-mono

Conflicts:
	toolset/setup/linux/languages/mono.sh
Brittany Mazza 10 years ago
parent
commit
0b489aef35

+ 31 - 0
frameworks/CSharp/nancy/setup_libevent.sh

@@ -0,0 +1,31 @@
+#!/bin/bash
+. ${IROOT}/mono.installed
+
+sed -i 's|localhost|${DBHOST}|g' src/Web.config
+
+rm -rf bin obj
+xbuild src/NancyBenchmark.csproj /p:Configuration=Release
+
+# nginx
+conf="upstream mono {\n"
+current=9001
+end=$(($current+$MAX_THREADS))
+while [ $current -lt $end ]; do
+  conf+="\tserver 127.0.0.1:${current};\n"
+  let current=current+1
+done
+conf+="}"
+echo -e $conf > $TROOT/nginx.upstream.conf
+
+$NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf.libevent -g "worker_processes '"${MAX_THREADS}"';"
+
+export MONO_GC_PARAMS=nursery-size=16m
+
+# Start fastcgi for each thread
+# To debug, use --printlog --verbose --loglevels=All
+current=9001
+end=$(($current+$MAX_THREADS))
+while [ $current -lt $end ]; do
+  mono-sgen -O=all LibeventHost/bin/Release/LibeventHost.exe 127.0.0.1 $current ${DBHOST} &
+  let current=current+1
+done

+ 2 - 6
frameworks/CSharp/nancy/setup_nginx.sh

@@ -1,17 +1,13 @@
 #!/bin/bash
+. ${IROOT}/mono.installed
 
 sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config
 sed -i 's|include /usr/local/nginx/conf/fastcgi_params;|include '"${NGINX_HOME}"'/conf/fastcgi_params;|g' nginx.conf
 
-export PATH="$MONO_ROOT/bin:$PATH"
-
-# Needed to find Mono's shared libraries
-export LD_LIBRARY_PATH="$MONO_ROOT/lib"
-
 # build
 cd src
 rm -rf bin obj
-$MONO_ROOT/bin/xbuild /p:Configuration=Release
+xbuild /p:Configuration=Release
 
 # nginx
 conf="upstream mono {\n"

+ 0 - 1
frameworks/CSharp/nancy/src/Global.asax.cs

@@ -2,7 +2,6 @@
 using System.Collections.Generic;
 using System.Web;
 using Nancy;
-using Nancy.ErrorHandling;
 using System.Threading;
 
 namespace NancyBenchmark

+ 1 - 1
frameworks/CSharp/nancy/src/LibeventHost/LibeventHost.csproj

@@ -33,7 +33,7 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Nancy">
-      <HintPath>..\..\lib\Nancy.0.17.1\lib\net40\Nancy.dll</HintPath>
+      <HintPath>..\..\lib\Nancy.0.23.0\lib\net40\Nancy.dll</HintPath>
     </Reference>
     <Reference Include="Nancy.Hosting.Event2">
       <HintPath>..\..\lib\Nancy.Hosting.Event2.dll</HintPath>