How to Change the Size of /dev/shm in App Engine Flexible

流过昼夜 提交于 2019-12-04 14:57:16

A: No.

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.

...but there are other options

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.

Option 1

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 has a fairly steep learning curve, but it will allow you to uncap the limit on /dev/shm.

Option 2

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.

Option 3

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


Update from speedplane's comment

Option #4

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.

This is the answer I received from Google Support (support ID 13757624):

I understand that you have inquiry if it would be possible to increase the size of /dev/shm in App Engine Flex.

Unfortunately, this isn't possible. Since Flex is managed VM the default value is maintained. You may try to create manually a command on your dockerfile to change the shared cache via 'sudo' but there's no guarantee so I can't say that it will possibly work, still worth a try given that you are using custom runtimes otherwise, there's no other way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!