nginx 线程是否会锁定直到查询完成?
我有一个有 4 个线程的 nginx。 nginx 位于 5 个杂种前面。有时,杂种运行的查询需要很长时间。如果 4 个这样的查询同时发生,是否意味着 nginx 的所有 4 个线程都很忙,并且会锁定进一步的请求,直到有一个线程空闲为止?
I have a nginx with 4 threads. The nginx is in front of 5 mongrels. Sometimes a query a mongrel is running takes very long. If 4 such queries occur simultaneously does that mean that all 4 threads of nginx are busy and will lock out further requests until a thread is free?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,nginx 线程提供多个连接,通过系统调用(如“epol”和“kqueue”)对它们进行复用。因此,当它循环时,它有时会检查系统调用以从后端返回某些内容,但它肯定能够回复客户端。
As far as I know nginx threads serve multiple connections, multiplexing them by syscalls (like "epol" and "kqueue"). So, while it loops it would check syscalls to return something from backends sometimes, but it would certainly be able to reply to clients.