azure - 如何增加Azure容器实例的共享内存(dev/shm)?

标签 azure shared-memory azure-container-instances firefox-marionette

我正在将 Selenium Standalone Firefox 作为 Azure 容器实例运行。为了解决运行 protractor 测试时经常出现的错误“无法解码木偶的响应”,我需要增加容器的共享内存。

无法将其作为参数传递给我在管道中使用的 az container create 命令。

我尝试将其作为命令行脚本传递,以便在部署容器后执行 --command-line "/bin/sh -c 'sudo mount -o remount,size=2G/dev/shm'"但它不起作用,因为容器是只读的,不幸的是,根据 https://feedback.azure.com/forums/602224-azure-container-instances/suggestions/33870166-aci-support-for-privileged-container无法在特权模式下运行容器实例以允许写入模式。

你有什么想法吗? 谢谢, 玛格达

最佳答案

这不受支持,而且很难支持,因为它会给运行不同容器组的虚拟机带来很大的风险。

底层内存/CPU 与其他用户共享,允许额外的/DEV/SHM 可能会隐藏容器的实际内存使用情况,从而影响现在运行在同一容器上的其他容器。

此请求过去已提出过。见下文。

https://feedback.azure.com/forums/602224-azure-container-instances/suggestions/37442194-allow-specifying-the-size-of-the-dev-shm-filesyst

我建议查看 Kubernetes 替代方案,它支持中等类型的emptyDir:内存,这将根据您的需要创建正确的临时目录。

you can set the emptyDir.medium field to "Memory" to tell Kubernetes to mount a tmpfs (RAM-backed filesystem) for you instead. While tmpfs is very fast, be aware that unlike disks, tmpfs is cleared on node reboot and any files you write will count against your Container’s memory limit.

https://kubernetes.io/docs/concepts/storage/volumes/#emptydir

关于azure - 如何增加Azure容器实例的共享内存(dev/shm)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61565041/

相关文章:

sql - 将数据(直接查询模式)从 Databricks SQL 查询引入 Power BI

php - 如何使用 Zend Framework 在用户之间实现共享变量?

azure - 是否可以将 NFS(NetApp 文件)卷附加到 Azure 容器实例?

azure - 使用Azure CLI在运行于Azure容器实例上的Docker容器上执行命令

postgresql - 向 postgres 添加更多索引会导致 "out of shared memory"错误

Azure Functions-新-AzContainerGroup : Object reference not set to an instance of an object

通过 VNet 用于 Azure SQL 的 Azure 函数连接字符串

c# - 如何使用 Azure 资源管理 api 按资源类型和资源组获取资源列表

azure - 增加 Azure 应用服务计划的存储空间

c - IPC SysV 共享内存 - shmget()、shmat() 不起作用