1、Nginx 服务器上的 Master 和 Worker 进程分别是什么

Master 进程:读取及评估配置和维持
Worker 进程:处理请求

 

2、怎么添加模块?

Firstly, you have to select the Nginx module during the compile. Runtime selection of module is not being supported by the Nginx server.
在编译过程添加模块

3、什么是 C10K 问题?

C10K 问题是指无法同时处理大量客户端(10,000)的网络套接字。 

4、在 Nginx 中,如何使用未定义的服务器名称来阻止处理请求? 

只需将请求删除的服务器就可以定义为:
Server {listen 80;server_name “ “ ;return 444;
}

5、Nginx和Apache的区别?

Firstly, Nginx is an event-based web server and Apache is a process-based server.
1、Nginx是事件驱动,Apache是过程驱动
Nginx is best known for its speed and Apache is best known for its power.
Nginx is the best when it comes to memory consumption and connection whereas Apache is not best in this category.
In Nginx, a single thread is handling all of the requests whereas in Apache single thread handles a single request.
Nginx is best when you want the load balancing. But Apache will refuse the new connection when traffic reaches the limit of the process.
Apache provides lots of functionality as compared to Nginx.

更为通用的方案是,前端 nginx 抗并发,后端 apache 集群,配合起来会更好。

6、Nginx是什么语言写的?

C语言

7、Nginx的负载均衡策略有哪几种?

调度策略 含义
轮询 按照时间顺序,逐一分配到不同的后端服务器
加权轮询 weight值越大,分配到的访问几率越高
ip_hash 每个请求按访问IP的hash结果分配,这样来自同一个IP的请求固定访问一个后端服务器,可以解决分布式session问题,但不是最优的解决办法,另一个即集中式session存储校验,将session放到redis集群当中。
url_hash(第三方) 按照访问的URL的hash结果来分配请求,使一个URL始终定向到同一个后端服务器
less_conn 最少连接数,哪个机器连接数少,就分发
fair(第三方) 按后端服务器的响应时间来分配请求,响应时间短的优先分配。

8、如何设置在81端口上运行nginx?

修改nginx.conf里的端口号

参考:

https://www.onlineinterviewquestions.com/nginx-interview-questions/

https://www.jianshu.com/p/19d0516ea29e

https://segmentfault.com/a/1190000010677483

最新文章

  1. Jquery 小技巧
  2. 后台系统组件:一丶bootstrap table
  3. HBase工程师线上工作经验总结----HBase常见问题及分析
  4. SharePoint 2013 SP1发布了
  5. 工欲善其事必先利其器——dreamweaver
  6. xml学习总结(三)
  7. 工作流设计 zt
  8. HTML5与CSS3权威指南.pdf8
  9. Docker集群实验环境布署--swarm【7 让docker客户端支持docker-compose】
  10. 修改tomcat编码方式
  11. restfull软件架构风格
  12. 使用python进行24bit音频处理
  13. MT【286】最佳有理逼近
  14. APP-8.1-百度语音应用
  15. python入门第0篇 Windows下python的安装及pip安装和使用
  16. jQuery动画高级用法(上)——详解animation中的.queue()函数
  17. Chrome自定义最小字号
  18. Django的MultipleChoiceField处理小技巧
  19. Java容器_01
  20. exit和die的区别

热门文章

  1. server端并发聊天
  2. Python3基础笔记_列表
  3. HOOK NtCreateSection
  4. Thrift(PHP)入门无错篇章(一)
  5. 从三层架构到Spring框架
  6. typeof 、Object.prototype.toString和 instanceof
  7. 2019-5-21-Roslyn-使用-Directory.Build.props-管理多个项目配置
  8. Leetcode959. Regions Cut By Slashes由斜杠划分区域
  9. Python基本数据类型之字典,集合,range
  10. 阿里云 Aliplayer高级功能介绍(九):自动播放体验