今天在跑一个任务,大概像下面这样

python task.py -s input/

input文件夹下有两百多个文件,比如1.txt, 2.txt等等,task.py会顺序读取并做操作。

我想,这不是太慢了吗。于是我写了个shell脚本

python task.py -s input/1.txt &
python task.py -s input/2.txt &
python task.py -s input/3.txt &
...

尼玛,然后就悲剧了。

两百多个进程一启动,整个系统卡死了!根本动都动不了啊!!!

 

目前想到的解决方法:

ps -aux|grep python task.py

然后kill掉所有相关进程。

 

可关键问题是,现在系统没反应,没法输入指令/(ㄒoㄒ)/~~

 

相关文章:

  • 2021-10-05
  • 2021-11-15
  • 2022-01-13
  • 2021-08-09
  • 2021-09-29
  • 2021-05-20
  • 2022-12-23
  • 2021-12-07
猜你喜欢
  • 2021-09-29
  • 2021-11-20
  • 2022-12-23
  • 2021-04-10
  • 2021-10-08
  • 2021-07-15
相关资源
相似解决方案