Question

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.

Was it helpful?

Solution 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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top