Help me please! I have project django-channels. I user cache_layer redis. I deployed the application to digitalocean app platform. I’m doing load testing using and when the number of connections is more than 200 I get an error.
Stack
django 4.2.6
channels 4.0.0
channels-redis 4.2.0
daphne 4.0.0
After 200 connections from locust i have error
с```
alex-2/ERROR/locust.user.task: Handshake status 403 Forbidden -±± {‘date’: ‘Fri, 14 Jun 2024 08:26:44 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’, ‘x-do-app-origin’: ‘8c16af01-84d7-49fd-901c-fcfa01070288’, ‘cache-control’: ‘private’, ‘x-do-orig-status’: ‘403’, ‘cf-cache-status’: ‘DYNAMIC’, ‘server’: ‘cloudflare’, ‘cf-ray’: ‘8938efed4b541c8c-AMS’} -±± None
Traceback (most recent call last):
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/locust/user/task.py”, line 340, in run
self.execute_next_task()
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/locust/user/task.py”, line 373, in execute_next_task
self.execute_task(self._task_queue.popleft())
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/locust/user/task.py”, line 487, in execute_task
task(self.user).run()
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/locust/user/task.py”, line 325, in run
self.on_start()
File “/Users/user/test_req/loadtesting/locustfile.py”, line 39, in on_start
self.ws = create_connection(ws_url, cookie=cookie_header)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/websocket/_core.py”, line 646, in create_connection
websock.connect(url, **options)
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/websocket/_core.py”, line 261, in connect
self.handshake_response = handshake(self.sock, url, *addrs, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/websocket/_handshake.py”, line 65, in handshake
status, resp = _get_resp_headers(sock)
^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/user/test_req/loadtesting/.venv/lib/python3.12/site-packages/websocket/_handshake.py”, line 150, in _get_resp_headers
raise WebSocketBadStatusException(
websocket._exceptions.WebSocketBadStatusException: Handshake status 403 Forbidden -±± {‘date’: ‘Fri, 14 Jun 2024 08:26:44 GMT’, ‘transfer-encoding’: ‘chunked’, ‘connection’: ‘keep-alive’, ‘x-do-app-origin’: ‘8c16af01-84d7-49fd-901c-fcfa01070288’, ‘cache-control’: ‘private’, ‘x-do-orig-status’: ‘403’, ‘cf-cache-status’: ‘DYNAMIC’, ‘server’: ‘cloudflare’, ‘cf-ray’: ‘8938efed4b541c8c-AMS’} -±± None
And error on sentry
Error occurred during connection: Error UNKNOWN while writing to socket. Connection lost.