我最近从 PhantomJS 换成了 Chromedriver。在 Docker 中运行 chromdriver 时,一段时间后,我发现 pod 被逐出了“节点资源不足:nodefs”。我看到使用'kubectl describe nodes''OOMKilling'和'Memory cgroup out of memory: Kill process 452 (chrome) score 1867 or sacrific child'。所以我认为这是内存泄漏/内存问题。我正在运行我的驱动程序:
options = webdriver.ChromeOptions()
options.add_argument('--disable-extensions')
options.add_argument('--headless')
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
options.add_argument('--incognito')
options.add_argument('--disable-application-cache')
还有什么我需要设置/做的吗?
最佳答案
chromedriver 没有问题。它是内存不足的 docker 实例。
您需要将您的 docker 实例移动到具有更多内存的系统上
.另一种选择是优化 OOM 进程 killer 并微调进程。您可以阅读有关容量调整的更多信息 here .
关于selenium - Chromedriver 内存不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47725828/