Closed mucthienton closed 4 years ago
You are using wsgiref the default server which isn't able to handle more than a few requests per second. You should really use gunicorn or uwsgi.
Thanks @oz123, I'm trying gunicorn in two days and no problem.
You should close the issue then
I'm use Bottle 0.12.17 and python3, my server get file bytes from body and use opencv resize and save it.
Server run normally but client request and server didn't response When I press Ctrl + C server show:
File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 979, in call
return self.wsgi(environ, start_response)
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 954, in wsgi
out = self._cast(self._handle(environ))
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 862, in _handle
return route.call(*args)
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 1742, in wrapper
rv = callback(a, **ka)
File "server.py", line 350, in checkFake
buff = request.body.read()
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 1197, in body
self._body.seek(0)
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 166, in get
if key not in storage: storage[key] = self.getter(obj)
File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 1166, in _body for part in body_iter(read_func, self.MEMFILE_MAX): File "/home/wee1/.local/lib/python3.6/site-packages/bottle.py", line 1129, in _iter_body part = read(min(maxread, bufsize)) File "/usr/lib/python3.6/socket.py", line 586, in readinto return self._sock.recv_into(b)
After, client request and get response normal. This problem happen nearly random and I press Ctrl + C to fix it. Can anyone help, thanks.