Windows Server 2008 R2的web服务器nginx和Apache的比较

时间:2023-11-28 20:25:08

因为很喜欢nginx,所以也想尝试在Windows下使用nginx,前面安装配置都挺顺利,把域名解析尽量后,通过域名代理访问jboss,却异常的慢,起码有3秒的时间才显示页面,而这个页面是jboss的默认页面,超级简单毫无业务逻辑的页面。

无奈之下,还是用回Apache。

安装过程和配置自不必说。

通过比较,在Windows下,Apache代理jboss的页面,访问速度提高了。虽然没有更多的数据来论证,但是在Windows下还是用Apache比较好。

用httping来测试nginx表现,大失所望。

luodengxiongdeMacBook-Pro:~ luodengxiong$ httping -S -G -s -b -c  www.yaoxiao2.com
PING www.yaoxiao2.com: (/):
timeout while receiving reply-headers from host
^CGot signal --- http://www.yaoxiao2.com/ ping statistics ---
connects, ok, 40.00% failed, time 36392ms

而换成Apache之后,令人惊喜。

luodengxiongdeMacBook-Pro:~ luodengxiong$ httping -S -G -s -b -c  www.yaoxiao2.com
PING www.yaoxiao2.com: (/):
connected to 58.67.156.190: ( bytes), seq= time=219.49+ 10.34+ 0.05+ 13.21+ 0.02=243.09 ms OK 1049KB/s
connected to 58.67.156.190: ( bytes), seq= time= 0.47+ 12.05+ 0.04+ 19.73+ 0.02= 32.29 ms OK 1898KB/s
connected to 58.67.156.190: ( bytes), seq= time= 0.45+ 11.89+ 0.03+ 28.84+ 0.02= 41.22 ms OK 106KB/s
connected to 58.67.156.190: ( bytes), seq= time= 0.38+ 12.38+ 0.04+ 15.36+ 0.03= 28.16 ms OK 286KB/s
connected to 58.67.156.190: ( bytes), seq= time= 0.57+ 11.00+ 0.04+ 12.78+ 0.03= 24.39 ms OK 1058KB/s
--- http://www.yaoxiao2.com/ ping statistics ---
connects, ok, 0.00% failed, time 5385ms
round-trip min/avg/max = 24.4/73.8/243.1 ms
Transfer speed: min/avg/max = 106.808579/880.154102/1898.807947 KB