Browse Source

Took a stab at C#

msmith-techempower 10 years ago
parent
commit
06b2227070

+ 2 - 0
frameworks/C#/aspnet/bash_profile.sh

@@ -6,3 +6,5 @@ export PATH="$MONO_ROOT/bin:$PATH"
 
 # Needed to find Mono's shared libraries
 export LD_LIBRARY_PATH="$MONO_ROOT/lib"
+
+export NGINX_HOME=${IROOT}/nginx

+ 30 - 0
frameworks/C#/aspnet/setup.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+
+sed -i 's|localhost|'"$DBHOST"'|g' aspnet/src/Web.config
+
+# build
+rm -rf bin obj
+cd src
+xbuild /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 -g "${MAX_THREADS}"
+
+# Start fastcgi for each thread
+# To debug, use --printlog --verbose --loglevels=All
+current=9001
+end=$(($current+$MAX_THREADS))
+while [ $current -lt $end ]; do
+  MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:$(pwd)/src --socket=tcp:127.0.0.1:$current
+  let current=current+1
+done

+ 2 - 2
toolset/benchmark/framework_test.py

@@ -169,8 +169,8 @@ class FrameworkTest:
 
     # Setup variables for TROOT and IROOT
     setup_util.replace_environ(config=profile, 
-              command='export TROOT=%s && export IROOT=%s && export DBHOST=%s' %
-              (self.directory, self.install_root, self.database_host))
+              command='export TROOT=%s && export IROOT=%s && export DBHOST=%s && export MAX_THREADS=%s' %
+              (self.directory, self.install_root, self.database_host, self.benchmarker.threads))
 
     # Because start can take so long, we print a dot to let the user know 
     # we are working

+ 5 - 3
toolset/setup/linux/webservers/nginx.sh

@@ -1,11 +1,13 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists /usr/local/nginx/sbin/nginx)
+RETCODE=$(fw_exists nginx.installed)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
 fw_get http://nginx.org/download/nginx-1.4.1.tar.gz
 fw_untar nginx-1.4.1.tar.gz
 cd nginx-1.4.1
-./configure
+./configure --prefix=$IROOT/nginx
 make
-sudo make install
+make install
+
+touch nginx.installed