简体   繁体   中英

Cherrypy server winding up on too many requests

I was using a cherrypy based server on AWS to handle some REST API calls. But on deploying the server and with some serious traffic (around 200,000 requests within 8hours) the server wound up. 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?

Sounds like you backlogged more connections than the operating system was configured to allow. Try checking ulimit -n and increasing it if you can.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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