简体   繁体   English

Cherrypy服务器关闭了太多的请求

[英]Cherrypy server winding up on too many requests

I was using a cherrypy based server on AWS to handle some REST API calls. 我在AWS上使用基于cherrypy的服务器来处理一些REST API调用。 But on deploying the server and with some serious traffic (around 200,000 requests within 8hours) the server wound up. 但是在部署服务器和一些严重的流量(8小时内大约200,000个请求)时,服务器结束了。 The error log shows only one type of error. 错误日志仅显示一种类型的错误。

 ENGINE Error in HTTPServer.tick
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/wsgiserver/wsgiserver2.py", line 1837, in start
  File "/usr/local/lib/python2.7/dist-packages/CherryPy-3.2.2-py2.7.egg/cherrypy/wsgiserver/wsgiserver2.py", line 1887, in tick
  File "/usr/lib/python2.7/socket.py", line 202, in accept
error: [Errno 24] Too many open files

Is this because cherrypy cannot scale if there are too many requests, or is it something wrong in the code? 这是因为如果请求太多,或者代码中有什么问题,cherrypy无法扩展吗?

Sounds like you backlogged more connections than the operating system was configured to allow. 听起来你积压了比操作系统配置允许的更多连接。 Try checking ulimit -n and increasing it if you can. 尝试检查ulimit -nulimit -n增加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM