我正在尝试运行 locust 并在第一次成功运行它之后对我的 locustfile.py 进行了一些更改。运行 locust 命令后出现错误“OSError: [Errno 98] Address already in use: ('', 8089)”。已经尝试杀死PID,但它不起作用。我使用的是 Linux 18.04 系统。共享完整的日志跟踪:
[2020-06-23 14:22:25,687] sonali-Latitude-3490/WARNING/locust.main: System open file limit setting is not high enough for load testing, and the OS wouldnt allow locust to increase it by itself. See https://docs.locust.io/en/stable/installation.html#increasing-maximum-number-of-open-files-limit for more info.
[2020-06-23 14:22:25,687] sonali-Latitude-3490/INFO/locust.main: Starting web interface at http://:8089
[2020-06-23 14:22:25,694] sonali-Latitude-3490/INFO/locust.main: Starting Locust 1.0.3
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "/home/sonali/.local/lib/python3.6/site-packages/locust/web.py", line 288, in start
self.server.serve_forever()
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/baseserver.py", line 398, in serve_forever
self.start()
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/baseserver.py", line 336, in start
self.init_socket()
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/pywsgi.py", line 1500, in init_socket
StreamServer.init_socket(self)
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/server.py", line 180, in init_socket
self.socket = self.get_listener(self.address, self.backlog, self.family)
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/server.py", line 192, in get_listener
return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/server.py", line 288, in _tcp_listener
sock.bind(address)
OSError: [Errno 98] Address already in use: ('', 8089)
2020-06-23T08:52:25Z <Greenlet at 0x7fcb12f1f148: <bound method WebUI.start of <locust.web.WebUI object at 0x7fcb12ef2668>>> failed with OSError
[2020-06-23 14:22:25,696] sonali-Latitude-3490/CRITICAL/locust.web: Unhandled exception in greenlet: <Greenlet at 0x7fcb12f1f148: <bound method WebUI.start of <locust.web.WebUI object at 0x7fcb12ef2668>>>
Traceback (most recent call last):
File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
File "/home/sonali/.local/lib/python3.6/site-packages/locust/web.py", line 288, in start
self.server.serve_forever()
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/baseserver.py", line 398, in serve_forever
self.start()
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/baseserver.py", line 336, in start
self.init_socket()
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/pywsgi.py", line 1500, in init_socket
StreamServer.init_socket(self)
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/server.py", line 180, in init_socket
self.socket = self.get_listener(self.address, self.backlog, self.family)
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/server.py", line 192, in get_listener
return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
File "/home/sonali/.local/lib/python3.6/site-packages/gevent/server.py", line 288, in _tcp_listener
sock.bind(address)
OSError: [Errno 98] Address already in use: ('', 8089)
[2020-06-23 14:22:25,696] sonali-Latitude-3490/INFO/locust.main: Running teardowns...
[2020-06-23 14:22:25,696] sonali-Latitude-3490/INFO/locust.main: Shutting down (exit code 2), bye.
[2020-06-23 14:22:25,696] sonali-Latitude-3490/INFO/locust.main: Cleaning up runner...
Name # reqs # fails Avg Min Max | Median req/s failures/s
--------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------
Aggregated 0 0(0.00%) 0 0 0 | 0 0.00 0.00
Percentage of the requests completed within given times
Type Name # reqs 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100%
------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------