Browse Source

attempt to get nancy-libevent to work. Not Successful. The Nancy version
has been updated and this might be the root cause of the issue. When
attempting to manually run the nancy-libevent test I am able to compile and
to start mono/nginx but when making a request receive several errors of the
following type:
Unhandled Exception:
System.MissingMethodException: Method not found: 'Nancy.Request..ctor'.
2015/01/08 10:39:28 [error] 31240#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /json HTTP/1.1", upstream: "http://127.0.0.1:9001/json", host: "localhost:8080"
Missing method Nancy.Request::.ctor(string,string,IDictionary`2<string, IEnumerable`1<string>>,RequestStream,string,string,string) in assembly /home/lgratrix/FrameworkBenchmarks/frameworks/CSharp/nancy/src/LibeventHost/bin/Release/Nancy.dll, referenced in assembly /home/lgratrix/FrameworkBenchmarks/frameworks/CSharp/nancy/src/LibeventHost/bin/Release/Nancy.Hosting.Event2.dll

Lita Gratrix 10 years ago
parent
commit
a26c9a70e0

+ 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

+ 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>