使用 uwsgi 作为 web 服务器启动,配置 4 个 worker,启动 django 后服务无法正常访问,uwsgi 日志出现大量如下内容:
** uWSGI listen queue of socket "127.0.0.1:9001" (fd: 3) full !!! (101/100) **
** uWSGI listen queue of socket "127.0.0.1:9001" (fd: 3) full !!! (101/100) **
** uWSGI listen queue of socket "127.0.0.1:9001" (fd: 3) full !!! (101/100) **
场景:
某一个功能使用 threading 模块,伪代码如下:
def _thread_mission():
def _core():
while True:
<make a http request and do some logical work>
time.sleep(10)
t_lst = [threading.Thread(target=_core),
threading.Thread(target=_core_1),
threading.Thread(target=_core_2),
]
for t in t_lst:
t.setDaemon(True)
t.start()
三个线程任务的内容类似,都是一个 while 循环,不断的定时请求某一个 url 然后执行一些业务逻辑。
应该描述的差不多了,有么有经验的大佬分析一波呢?感谢~
append: 将这三个定时任务使用 crontab 执行就没有上面的报错了。