apache、Nginx、Mongoose 静态页面性能对比
2014-09-08 01:04
573 查看
继Mongoose的功能使用,简单验证其性能。
比对对象:Apache、Nginx与Mongoose;
比对方法:访问简单静态页面;
比对结果:用图表说话如下:
比对结论:Mongoose不适合作为高性能服务器。
关于性能不优的原因,在Mongoose的源码也略有一斑:
源码:http://code.google.com/p/mongoose/source/browse/mongoose.c
1、其中包含很多对Windows的兼容;
2、更关键的是master_thread函数,使用的select方法而非epoll:
if (select(max_fd + 1, &read_set, NULL, NULL, &tv) < 0) {
#ifdef _WIN32
/*
* On windows, if read_set and write_set are empty,
* select() returns "Invalid parameter" error
* (at least on my Windows XP Pro). So in this case,
* we sleep here.
*/
sleep(1);
#endif /* _WIN32 */
} else {
for (sp = ctx->listening_sockets;
sp != NULL; sp = sp->next)
if (FD_ISSET(sp->sock, &read_set))
accept_new_connection(sp, ctx);
}
比对对象:Apache、Nginx与Mongoose;
比对方法:访问简单静态页面;
比对结果:用图表说话如下:
比对结论:Mongoose不适合作为高性能服务器。
关于性能不优的原因,在Mongoose的源码也略有一斑:
源码:http://code.google.com/p/mongoose/source/browse/mongoose.c
1、其中包含很多对Windows的兼容;
2、更关键的是master_thread函数,使用的select方法而非epoll:
if (select(max_fd + 1, &read_set, NULL, NULL, &tv) < 0) {
#ifdef _WIN32
/*
* On windows, if read_set and write_set are empty,
* select() returns "Invalid parameter" error
* (at least on my Windows XP Pro). So in this case,
* we sleep here.
*/
sleep(1);
#endif /* _WIN32 */
} else {
for (sp = ctx->listening_sockets;
sp != NULL; sp = sp->next)
if (FD_ISSET(sp->sock, &read_set))
accept_new_connection(sp, ctx);
}
相关文章推荐
- Apache、Nginx、Mongoose 静态页面性能对比
- nginx与apache详细性能对比
- nginx+apache实现动静态页面分离的web生产环境(二)
- 测试Nginx 和 Tomcat 高并发情况下处理静态页面的性能
- Nginx-4:与apache性能对比
- nginx与apache详细性能对比
- nginx折腾记(HTTP性能能测试,与Apache对比)
- apache nginx 性能简单对比测试
- nginx折腾记(HTTP性能能测试,与Apache对比)
- nginx与apache详细性能对比
- nginx折腾记(HTTP性能能测试,与Apache对比)
- nginx折腾记(HTTP性能能测试,与Apache对比)
- 技术文章 | nginx lua 小项目:根据 user_agent 显示不同的页面_附带和 php 性能的对比
- FreeBSD和linux的nginx静态文件性能对比测试
- nginx+apache实现动静态页面分离的web生产环境(一)
- nginx折腾记(HTTP性能能测试,与Apache对比)
- nginx折腾记(HTTP性能能测试,与Apache对比)
- 详谈Apache、Nginx和tomcat的区别以及处理静态页面和动态页面的方式
- 【nginx】nginx与apache详细性能对比
- nginx折腾记(HTTP性能能测试,与Apache对比)