A long time ago, probably still in 07, I also did the ASP. NET in Ubuntu try, then probably is the U version 6.04-7.04 between it, Seems to be the 6.10,mono version I remember more clearly, probably 1.2.6, to compile the source code to run, now because Mono is no longer the same, many Daniel recommended and think that Mono Linux. NET scheme can be commercially used, so this test.
The Linux mono ASP solution I've found is primarily three-way:
- Traditional WEBSERVER+MONO-FASTCGI-SERVER4 here webserver can choose Nginx Apache
- Domestic closed source third-party ASP. NET Linux Mono solution: Jexus
- Microsoft Owin solution, optional Microsoft's own Owin implementation of Katana project, the same jexus developers of the closed source Owin implementation-Project Tinyfox
I am more familiar with Ubuntu, my system because it is windows, so use virtual machine to run Ubuntu current version 15.04;
Physical machine: My Notebook, I7-4710MQ 4 core 8 thread, 500GB SSD Samsung evo850, Memory 16GB;
Using VMware Workstation version 11 virtual machine, Virtual machine configuration: Cpu4 core, Memory 8GB, hard disk 40GB, and then install ubuntu15.04, replace the domestic software source, update not live.
First configure the compilation environment, Ubuntu is the Deb package management system, and the new version of Mono is usually not very likely to be added to the official software source, I like in what distribution version of the distribution of the package management system,
So the new version of the software source will be compiled into a deb package, the most convenient Deb production method I know is Checkinstall
sudo apt-get install checkinstall dh-make gcc g++
This completes the installation by configuring the underlying compilation environment.
In my use, Ubuntu Default Input Method small Penguin Fcitx will not see the candidate words, did not find the problem set up, had to delete
sudo apt-get purge fcitx
Fortunately, Chinese input system automatically with IBUs, although Lenovo ability is poor, but at least reluctantly can be used.
Next, go to mono official website www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives Find the latest mono installation method of Ubuntu, and then
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EFecho "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.listsudo apt-get update
结果之后没找到
Version updated mono main package mono-runtime, find the online post, would have to go under the source code compiled, found that a post on the new main package is written mono-complete, try it ... A whole bunch to pack, okay my network fast 50m download speed, check mono version,
Then install MonoDevelop
sudo apt-fast install MONO-XSP4
blog.csdn.net/penginpha/article/details/6947546
Right-click the project after compiling and run with Firefox to see
Project |
value |
CPU Type |
unknown |
operating system |
Linux |
IP address |
127.0.0. 1 |
. NET CLR version |
0.0 |
browser |
*0 |
Support for ActiveX |
not supported |
Support Cookies |
not supported |
support for CSS |
does not support |
language |
zh-cn |
Computer/Phone |
computer |
Platform |
unknown |
Win16 |
is not |
Win32 |
is not |
Http Accept Encoding |
gzip, deflate |
User Agent |
mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) gecko/20100101 firefox/38.0 |
Not the code for mono, so the unknown is a lot of uncertainty, but at least the basic debugging environment has been completed
Now go to configure the formal several environments, first nginx+mono-fastcgi-server4:
sudo apt-fast install Nginx mono-fastcgi-server4
Then go to configure, according to mono official www.mono-project.com/docs/web/fastcgi/nginx/have documentation,
Attempts by third-party developers to document Blog.chinaunix.net/uid-25508399-id-3234867.html,
Configure/etc/nginx/sites-available/default First
server {
Listen 801;
server_name localhost;
Access_log/var/log/nginx/test.log;
Location/{
root/home/sfissw/www/;
Index index index.html index.htm Default.aspx default.aspx;
Fastcgi_index Home/index; #指定根目录访问路径 (Default page)
Fastcgi_pass 127.0.0.1:9000; #mono fastcgi Server URL (you can specify a different server, currently pointing to local)
Include/etc/nginx/fastcgi_params; #包含 fastcgi params (php,aspnet related fastcgi parameter configuration)
}
}
Change to the above so root is the MVC Site Directory fastcgi_index is the home page link WebForm with index.aspx so MVC uses Home/index I didn't experiment but the Linux relationship may not be as big as windows. Sometimes it's possible to think
and change/etc/nginx/fastcgi_params.
Add to
Fastcgi_param path_info "";
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Start Nginx
Start fastcgi
And then if it's a little aspx that can show up normally, but MVC could be a bunch of mistakes. After searching the web, I found that I was going to reload xSP.
At this time may have to delete some mono's bag fast-mono-server4 Mod-mono, etc will not mention
Https://github.com/mono/xsp go here to download xsp-matser.zip ... The decompression installation may require additional installation of the base package
sudo apt-fast install autoconf
In the directory after decompression
./autogen.sh
./configure--PREFIX=/USR
Make
sudo checkinstall
By default there will be a version number error only need to ask you to use the number to change the version number and other information when you press 3 and then randomly enter a number
The Checkinstall will then install and generate the Deb package in the directory.
The Checkinstall is designed to facilitate centralized management of the deb RPM package.
Initial test, and sure enough, as the Netizen said, MVC is difficult to run under Mono, try a basic project MVC and WebForm each MVC does not run up, so not a bit,
Today's test content is very simple, is a single point of high concurrency test, redis is necessary,
Go to redis.io official website download current 2.x version of the latest version of the redis-2.8.21.tar.gz,3.0 version has a lot of changes, I accept some netizens suggestions so temporarily do not consider the use;
Unzip, after
sudo make
sudo make test yes, you can build the Deb package.
If sudo checkinstall is running properly, Redis should already be installed.
Virtual machines have never looked at their own IP
sudo apt-fast install Net-tools
And then
Ifconfig
Get
eth0 Link ENCAP: Ethernet Hardware Address 00:0c:29:b5:03:ba
inet Address: 192.168.3.11 Broadcast: 192.168.3.255 Mask: 255.255.255.0
Inet6 Address: fe80::20c:29ff:feb5:3ba/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 hop count: 1
Receive packet: 502727 Error: 0 Discard: 0 Overload: 0 Number of frames: 0
Send packet: 350025 error: 0 Discard: 0 Overload: 0 Carrier: 0
Collisions: 0 Send Queue Length: 1000
Receive bytes: 251792406 (251.7 MB) Send bytes: 114974666 (114.9 MB)
Lo Link encap: local loopback
inet Address: 127.0.0.1 Mask: 255.0.0.0
Inet6 Address::: 1/128 scope:host
Up LOOPBACK RUNNING mtu:65536 metric: 1
Receive packet: 3456387 Error: 0 Discard: 0 Overload: 0 Number of frames: 0
Send packet: 3456387 error: 0 Discard: 0 Overload: 0 Carrier: 0
Collisions: 0 Send Queue Length: 0
Receive bytes: 1083574717 (1.0 GB) Send bytes: 1083574717 (1.0 GB)
The local IP is 192.168.3.11.
Performing Redis
/usr/local/bin/redis-server
Now go to the real machine and test if Redis is normal.
CMD in execution
Redis-benchmark-h 192.168.3.11-q
PING (inline): 10559.66 Requests per second
ping:12804.10 Requests per second
MSET (keys): 12195.12 Requests per second
set:13736.26 Requests per second
get:13192.61 Requests per second
incr:13661.20 Requests per second
lpush:13458.95 Requests per second
lpop:14792.90 Requests per second
sadd:13812.16 Requests per second
spop:14814.81 Requests per second
Lpush (again, in order to bench Lrange): 13440.86 Requests per second
Lrange (first elements): 13175.23 requests per second
Lrange (first elements): 6489.29 requests per second
Lrange (first elements): 5592.84 requests per second
Lrange (first elements): 4345.94 requests per second
Basic get, set are above 1.3w should be able to do my machine configuration is not low but also the virtual machine allocated half of the resources, plus the real machine browser and VS and other software and services, it is difficult to have this performance,
Do a basic test on the Windows real machine side:
Test tool Apache AB
Main code
Response.Clear ();
String value = String. Empty;
Try
{
if (request["value"] = = null)
{
Value = "False_" + cache["Time"]. ToString ();
}
Else
{
DateTime now = DateTime.Now;
String k = System.Guid.NewGuid (). ToString ("N"). ToLower ();
String v = (now. ToString () + "" + Now.millisecond + request["value"]. ToString () + System.Guid.NewGuid (). ToString ("N")). ToLower ();
System.Threading.ThreadPool.QueueUserWorkItem (state =
{
Try
{
bool x = redisconnection.set<string> (k, v);//Storage to Redis Redis is within the virtual machine
v = redisconnection.stringget (k);
Log.enqueue (x.tostring () + "_" + DateTime.Now.ToString () + DateTime.Now.Millisecond.ToString () + "_" + K + "_" + V);
Redisconnection.keydelete (k);
}
catch (Exception OE)
{
string err = oe. Message + OE. StackTrace;
}
}, NULL);
Value = "true" + "______time:" + cache["Time"]. ToString () + "______key:" + k + "______value" + V;
}
}
Catch {}
Response.Write (value);
First as a reference directly in vs2013 mode 1000 concurrent analog speed is approximately 700-800 requests per second
250 concurrency condition Under my win7 IIS is 2,622 requests per second,
Estimating the number of CPU cores I have has a big impact on just 4 cores 8 threads
First Environment Nginx+fast-mono-server4
Perform
sudo fastcgi-mono-server4/applications=/:/home/sfissw/www/socket=tcp:127.0.0.1:9000
Sudo/etc/init.d/nginx start
Start this combination
The test result is very unstable, and then it crashes before it crashes, and gets a couple of test results in my machine configuration, about 1000 concurrent simulations, 1400-1700 requests per second of processing speed.
C:\Users\sfissw\Desktop\ Thunder Download \pc6-abdotexexz>ab-c 100-n "http://192.1
8.3.11:801/index.aspx?value=true_2015/6/29%203:13:02286_976fb1e9e75a40d68b297b2
E6d2dcef_2015/6/29%203:13:02%209217ba975a7f2ae4b45b47a13958ed66dd8true_2015/6/2
%203:13:04301_b56625d5003e417c981355d232094 "
This is apachebench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus technology LTD, http://www.zeustech.net/
Licensed to the Apache software Foundation, http://www.apache.org/
Benchmarking 192.168.3.11 (Be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests
Server software:nginx/1.6.2
Server hostname:192.168.3.11
Server port:801
Document Path:/index.aspx?value=true_2015/6/29%203:13:02286_976fb1e9e
5a40d68b297b29e6d2dcef_2015/6/29%203:13:02%209217ba975a7f2ae4b45b47a13958ed66dd
true_2015/6/29%203:13:04301_b56625d5003e417c981355d232094
Document length:181 bytes
Concurrency level:100
Time taken for tests:0.673 seconds
Complete requests:1000
Failed requests:0
Write errors:0
Non-2xx responses:1000
Total transferred:341000 bytes
HTML transferred:181000 bytes
Requests per second:1485.80 [#/sec] (mean)
Time per request:67.304 [MS] (mean)
Time per request:0.673 [MS] (mean, across all concurrent requests)
Transfer rate:494.78 [Kbytes/sec] Received
Connection Times (MS)
Min MEAN[+/-SD] Median max
Connect:0 1 0.7 0 4
PROCESSING:15 63 21.6 58 114
Waiting:1 40 20.6 39 109
TOTAL:15 64 21.8 58 114
Warning:the median and mean for the initial connection time is not within a n
Rmal deviation
These results is probably not that reliable.
Percentage of the requests served within a certain time (MS)
50% 58
66% 67
75% 78
80% 84
90% 99
95% 108
98% 110
99% 111
100% (Longest request)
Maybe I have a lot of resources allocated to the virtual machine, so there are many times there is the problem of CPU contention, the next test should try two physical machines,
The second scenario Jexus
Download Unzip http://www.linuxdot.net/down/jexus-5.6.4.tar.gz
There's a
sudo./install
It's all set up.
Cd/usr/jexus
Open/usr/jexus/siteconf #网站配置目录
The roo entry in the inside points to/home/sfissw/www/
cd/usr/jexus/
sudo./jws start
It's possible to run a scenario code that's already applied to mono, plus the solution itself is so customizable that it's running.
It's weird that the test results seem to be jexus smaller than the normal scenario.
Probably in the 350-700.
It may be that my system has been open for a few days, too many things to open the next time you have to change two physical machines.
Originally wanted to experiment Owin and open source of two solutions, the result because the Owin environment support of ASP., so time is not enough, another apache+mod-mono can also try to go back, although in theory, Apache throughput should be lower than Nginx
The next time the dual physical machine case, as well as the Owin of the 2 programs, Apache program;
Cond......
Linux. NET mono scenario Test record (i)