lzjzx1122 / Pagurus

Help Rather Than Recycle: Alleviating Cold Startup in Serverless Computing Through Inter-Function Container Sharing
Apache License 2.0
48 stars 9 forks source link

Frequent Connection Errors when Running Experiment #7

Open qishenghu opened 2 weeks ago

qishenghu commented 2 weeks ago

Dear author,

First of all, thank you for this amazing work. Sorry to bother you, I'm new to this field and was running the following command to execute the experiment on AWS data:

python3 run_experiments.py 1

The program initially ran smoothly for about an hour. However, it then started to display numerous errors similar to the one shown below. Have you encountered this issue before? Could you kindly provide guidance on resolving it?

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
  File "send_requests.py", line 31, in send_func
    requests.post(url, json = {"action_name": action, "params": {'runtime': runtime}})
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=5000): Max retries exceeded with url: /listen (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdbe501eb20>: Failed to establish a new connection: [Errno 111] Connection refused'))
2024-11-06T14:12:40Z <Greenlet at 0x7fdbfdd45ea0: send_func('fmp_twitterddb', 0.05)> failed with ConnectionError

Traceback (most recent call last):
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connection.py", line 199, in _new_conn
    sock = connection.create_connection(
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/gevent/_socketcommon.py", line 590, in connect
    self._internal_connect(address)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/gevent/_socketcommon.py", line 634, in _internal_connect
    raise _SocketError(err, strerror(err))
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connection.py", line 441, in request
    self.endheaders()
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/http/client.py", line 951, in send
    self.connect()
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connection.py", line 279, in connect
    self.sock = self._new_conn()
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connection.py", line 214, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fdbe314c8e0>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
  File "/home/qs/miniconda3/envs/pagurus/lib/python3.8/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=5000): Max retries exceeded with url: /listen (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdbe314c8e0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Thank you for your help!

Regards, QS

lzjzx1122 commented 5 hours ago

Please check whether you have established too much http connections without closing it. Maybe you can first try to close redundant connections requests when using the urllib3 library. The default http connection is keep-alive, and requests can be closed by setting False.