如何在App Engine Flexible中更改/ dev / shm的大小 [英] How to Change the Size of /dev/shm in App Engine Flexible

查看:90
本文介绍了如何在App Engine Flexible中更改/ dev / shm的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在App Engine Flexible应用中更改共享内存文件夹 / dev / shm 的大小?

How do you change the size of the shared memory folder /dev/shm in an App Engine Flexible app?

默认情况下,它设置为64M,太低而无法运行许多应用程序(例如chrome)。我看不到任何更改方法。如果您有权访问 docker运行命令,但是在启动应用程序引擎灵活的应用程序时我们没有这种访问权限。

By default it is set to 64M, too low to run many apps (e.g., chrome). I don't see any way to change it. There are ways to change it if you have access to the docker run command, but we don't have such access when launching app engine flexible apps.

推荐答案

A:否。

不幸的是,appengine尚无法(目前?)。有很多人遇到了这个问题。出于某种原因,/ dev / shm的容器默认值太小了。

Unfortunately this isn't possible (yet?) with appengine. More than a few people have run into this issue. For some reason, the container default for /dev/shm is crazy small.

...但是还有其他选择

如果要运行的进程能够配置其使用的tmpfs的位置,则可以创建一个tmpfs 并将其指向该位置。 铬无法做到这一点。

If the process you want to run has the ability to configure the location of the tmpfs it uses, then you can create a tmpfs and simply point it there. Chromium can't do this.

选项1

如果您要将容器部署到Google Cloud,一种选择是使用容器引擎。然后,您可以像这样将tmpfs卷安装到您的Pod:

If you want to deploy a container to google cloud, one option is to use container engine. You can then mount a tmpfs volume to your pods like this:

spec:
  volumes:
  - name: dshm
    emptyDir:
      medium: Memory
  containers:
  - image: gcr.io/project/image
    volumeMounts:
      - mountPath: /dev/shm
        name: dshm

Kubernetes的学习曲线相当陡峭,但是会允许您取消对/ dev / shm的限制。

Kubernetes has a fairly steep learning curve, but it will allow you to uncap the limit on /dev/shm.

选项2

有一项新功能,可让您部署容器以计算引擎,但它目前处于Alpha状态,您需要申请将该项目列入白名单才能使用此功能。

There is a new feature that will allow you to deploy containers to compute engine, but it's currently in alpha and you will need to apply to have your project whitelisted to use this feature.

选项3

当然,您可以通过使用 COS(容器优化的操作系统)

Of course, you could deploy containers to GCE in a more manual fashion by creating a GCE instance using COS (container optimized os)

从speedplane的评论中更新

Update from speedplane's comment

选项#4

如果目标是在App Engine flexible上运行完整的浏览器,那么新版本的Firefox在Docker中就可以正常运行了。

If the goal is to run a full browser on app engine flexible, then the new versions of Firefox run in headless just fine in Docker.

这篇关于如何在App Engine Flexible中更改/ dev / shm的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆