问题
There's very little information about the /tmp/ folder which App Engine can use to write files. https://cloud.google.com/appengine/docs/standard/java/runtime-java8#Java_The_sandbox
The main question is if this is isolated per instance? And if an instance saves a file, starts a push queue, will the push queue be ran by the same instance and able to read the file?
Thanks
回答1:
The /tmp
directory actually exists in memory, so it is local to each GAE instance. From the doc you quoted:
Files in
/tmp
will consume the memory allocated to your instance.
Typically the execution of a push queue task is not guaranteed to happen on the same instance that enqueued the task.
This guarantee can only exist in a very specific, rather not typical case: you use manual scaling with exactly one instance running and that instance both enqueues the task and (later) processes it.
来源:https://stackoverflow.com/questions/53375467/is-google-app-engine-tmp-folder-isolated-per-instance