回答
收藏
分享
举报
nginx与tomcat区别?
提问于2020-05-17 22:16

浏览 7.6k

nginx与tomcat区别?之间有什么大的区别嘛?

已修改于2023-03-17 02:10



写下您的回答
发表回答
全部回答(2)

按点赞数排序

按时间排序

1、从功能上来说:1)Tomcat是Serlet,或者叫Web容器,在其上做定制化应用开发很简单,因为它会分配1个线程给你,随便用阻塞API来处理请求;2)Nginx只适合静态资源和Proxy(Lua生态只适合开发简单的动态服务),并不适合做Web容器。

2、从性能上来说:1)Tomcat用Java开发,未使用全异步、非阻塞的事件驱动模式,并发能力极为有限,通常只能处理数百个并发请求;2)Nginx用C开发,为了CDN、负载均衡、缓存等目的存在,性能强悍,可以实现百万、千万级的并发能力。

赞同

5

回复举报

回答于2020-09-09 10:11



回复陶辉
回复

我的理解有这样的,性能方面,Ngin是C语言开发,tomcat是java开发的,C性能会高于JAVA,不知道对不对,如有不对请给予指正,谢谢!

赞同

2

回复举报

回答于2020-09-08 09:02



回复浩聪
回复
相关问答

第1种。参考官方文档:

“When buffering is enabled, nginx receives a response from the proxied server as soon as possible, saving it into the buffers set by the proxy_buffer_size and proxy_buffers directives. If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk. Writing to temporary files is controlled by the proxy_max_temp_file_size and proxy_temp_file_write_size directives.

When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. nginx will not try to read the whole response from the proxied server. The maximum size of the data that nginx can receive from the server at a time is set by the proxy_buffer_size directive.”

点赞 0
浏览 3.7k

 Nginx这种七层Web Server不大关心二层的信息。如果你想知道,可以先取到IP,再查询arp表来获取MAC地址

点赞 0
浏览 3.3k