leniac
leniac
RRailway
Created by leniac on 2/25/2024 in #✋|help
Flask server failing when load increases
I've deployed a flask server and it works totally fine if I test it on a dev Vercel deployment, but as soon as I switch the prod backend to the railway flask server and start getting high traffic, I get this weird error over and over. Definitely a traffic thing because it even works for the first few seconds that I deploy, but quickyl get CORS error, presumably because the server can't send back headers.
2024-02-25 18:05:24 +0000] [11] [ERROR] Socket error processing request.
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 133, in handle
req = next(parser)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/parser.py", line 41, in __next__
self.mesg = self.mesg_class(self.cfg, self.unreader, self.req_count)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 186, in __init__
super().__init__(cfg, unreader)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 53, in __init__
unused = self.parse(self.unreader)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 235, in parse
self.headers = self.parse_headers(data[:idx])
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 73, in parse_headers
remote_addr = self.unreader.sock.getpeername()
OSError: [Errno 107] Transport endpoint is not connected
2024-02-25 18:05:24 +0000] [11] [ERROR] Socket error processing request.
Traceback (most recent call last):
File "/opt/venv/lib/python3.8/site-packages/gunicorn/workers/sync.py", line 133, in handle
req = next(parser)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/parser.py", line 41, in __next__
self.mesg = self.mesg_class(self.cfg, self.unreader, self.req_count)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 186, in __init__
super().__init__(cfg, unreader)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 53, in __init__
unused = self.parse(self.unreader)
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 235, in parse
self.headers = self.parse_headers(data[:idx])
File "/opt/venv/lib/python3.8/site-packages/gunicorn/http/message.py", line 73, in parse_headers
remote_addr = self.unreader.sock.getpeername()
OSError: [Errno 107] Transport endpoint is not connected
15 replies