1.安装nginx
sudo apt-get update
sudo apt-get install nginx
2安装mono
sudo apt-get install mono-runtime
------------------------------------------
root@ -Ubuntu:~# sudo apt-get install mono-runtime
正在分析软件包的依赖关系树
将会安装下列额外的软件包:
binfmt-support cli-common libmono-corlib2.0-cil libmono-i18n-west2.0-cil libmono-security2.0-cil libmono-system2.0-cil
mono-2.0-gac mono-gac
建议安装的软件包:
libmono-i18n2.0-cil libasound2 libcups2 libgamin0 libgdiplus libmono-winforms2.0-cil xdg-utils libgnome2-0 konqueror
下列【新】软件包将被安装:
binfmt-support cli-common libmono-corlib2.0-cil libmono-i18n-west2.0-cil libmono-security2.0-cil libmono-system2.0-cil
mono-2.0-gac mono-gac mono-runtime
升级了 0 个软件包,新安装了 9 个软件包,要卸载 0 个软件包,有 30 个软件包未被升级。
需要下载 4,118kB 的软件包。
解压缩后会消耗掉 12.0MB 的额外空间。
---------------------------------------------------------------------------------------------------------------------
root@ -ubuntu:~# mono -V
Mono JIT compiler version 2.4.4 (Debian 2.4.4~svn151842-1ubuntu4)
Copyright (C) 2002-2010 Novell, Inc and Contributors.
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
root@ -ubuntu:~#
------------------
sudo apt-get install mono-gmcs libmono-system-data2.0-cil libmono-system-messaging2.0-cil libmono-system-ldap2.0-cil libmono-system-
messaging2.0-cil libmono-system-runtime2.0-cil libmono-system-web2.0-cil libmono-system-web-mvc1.0-cil libmono-wcf3.0-cil libmono-
winforms2.0-cil
可选:
libmono-Oracle2.0-cil libmono-npgsql2.0-cil libmono-nunit2.4-cil libmono-sharpzip2.84-cil libmono-sqlite2.0-cil
----------------------------
3安装fastcgi-mono-server2
###样安装的是最基本的编译包和库。Oracle编译还得再加包。sudo apt-get install build-essential
sudo apt-get install mono-fastcgi-server2
下列软件包将被升级:
libc-bin libc6 libc6-i686 libglib2.0-0
升级了 4 个软件包,新安装了 153 个软件包,要卸载 0 个软件包,有 26 个软件包未被升级。
需要下载 58.3MB 的软件包。
解压缩后会消耗掉 182MB 的额外空间。
您希望继续执行吗?[Y/n]y
root@ -ubuntu:~# fastcgi-mono-server2 /version
fastcgi-mono-server2.exe 2.4.3.0
(c) 2007 Brian Nickel
FastCGI Backend for XSP
------------------------------------------------------------------------------
压力测试1:
----------------------------------------------------------------------
--- ubuntu ---cpu 虚拟1核--
#ab -n 1000 -c 50
此命令表示使用 50 个并发连接,进行 1000 次请求。
因此这个程序每秒平均可以处理 (Requests per second) 1000/12.17424=82个联机请求。
Server Software: nginx/0.7.65
Server Hostname: 192.168.99.20
Server Port: 80
Document Path: /info.aspx
Document Length: 21153 bytes
Concurrency Level: 50
Time taken for tests: 12.17424 seconds
Complete requests: 1000
Failed requests: 2
(Connect: 0, Length: 2, Exceptions: 0)
Write errors: 0
Non-2xx responses: 2
Total transferred: 21387790 bytes
HTML transferred: 21111040 bytes
Requests per second: 83.21 [#/sec] (mean)
Time per request: 600.871 [ms] (mean)
Time per request: 12.017 [ms] (mean, across all concurrent requests)
Transfer rate: 1737.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.0 0 17
Processing: 24 361 469.1 260 5659
Waiting: 18 355 467.8 251 5659
Total: 24 362 469.1 261 5659
Percentage of the requests served within a certain time (ms)
50% 261
66% 314
75% 367
80% 396
90% 499
95% 1134
98% 1661
99% 2551
100% 5659 (longest request)
---压力测试2 ,修改NGINX.CONF配置
--- ubuntu ---cpu 虚拟1核.nginx.conf配置为2,最大连接为51200(默认是1024)--
#ab -n 1000 -c 50
此命令表示使用 50 个并发连接,进行 1000 次请求。
因此这个程序每秒平均可以处理 (Requests per second) 1000/8.194228=122个联机请求。(修改配置同比每秒增加40个左右链接)
Server Software: nginx/0.7.65
Server Hostname: 192.168.99.20
Server Port: 80
Document Path: /info.aspx
Document Length: 21155 bytes
Concurrency Level: 50
Time taken for tests: 8.194228 seconds
Complete requests: 1000
Failed requests: 6
(Connect: 0, Length: 6, Exceptions: 0)
Write errors: 0
Non-2xx responses: 3
Total transferred: 21305214 bytes
HTML transferred: 21028589 bytes
Requests per second: 122.04 [#/sec] (mean)
Time per request: 409.711 [ms] (mean)
Time per request: 8.194 [ms] (mean, across all concurrent requests)
Transfer rate: 2538.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 55.9 0 996
Processing: 10 262 285.2 202 3050
Waiting: 3 257 285.8 197 3049
Total: 15 267 290.5 202 3050
Percentage of the requests served within a certain time (ms)
50% 202
66% 252
75% 283
80% 300
90% 359
95% 583
98% 1485
99% 1625
100% 3050 (longest request)
测试:
Ubuntu 10.04 Server Mono2.4.4 Nginx (实战成功)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/a25ba986e46fde472446c3b0d9f5586d.html