Anyone know if there is a way to submit one batch request with multiple instances inserts via the Python API for Google Compute Engine?

The instances.insert() request is only for 1 instance at a time, so I am currently just multithreading the group of requests to get a speed up. The gcutil code also uses an internal thread pool so I am guessing no batch request exists, but thought I'd check here first.

有帮助吗?

解决方案 2

I'll answer my own question here: BatchHttpRequest is the way to go.

It provided only a small speed up over the multiprocessing code I'd already written, but the big benefit is that it simplifies the design a bit - especially important when we are bringing up thousands of nodes at once.

其他提示

I have looked into this in the past myself, to see if this is possible, and found that it is not.

The only way to create multiple instances at the same time is to run multiple insert commands on different threads within your app.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top