Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 391
Codevalley Avatar asked Oct 24 '22 19:10

Codevalley


1 Answers

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

like image 153
fumanchu Avatar answered Oct 27 '22 10:10

fumanchu