Operations number - threshold to go for batching

30 views
Skip to first unread message

Vitaly Dukhota

unread,
Dec 12, 2018, 7:01:09 AM12/12/18
to AdWords API and Google Ads API Forum
Hi, my understanding is that there is an overhead associated with batching operations. It probably doesn’t make sense to submit a batch if I only want to perform one or two operations – it will probably be quicker to just call the appropriate services directly and submit each operation separately. My question is – where is the threshold where it starts to make sense to go batching? I understand for most of these question the answer will be “it depends”, but because to answer it I will have to implement the same functionality twice (as batches and as single operations), I would like to ask for your opinion – maybe even just a gut feeling – would it be possible to at least give an order of magnitude? Does it make sense to batch 10, 50, 100, 500, or 1000 operations? 

To be even more specific, here is my typical scenario: a managed customer has 5-10 campaigns, each campaign has 5-10 adgroups, each adgroup has 5-10 ads. The customer makes an update to their account, which will result in deletion of 1 campaign, mutations of 5-10 adgroups in another campaign (in terms of adding/removing some of their keywords, etc.), and creation of one campaign with its 5-10 adrgroups and 30-90 ads; in total that would often be around 100-200 operations. Would you use batching for this scenario? What if it was 50 operations? 500 operations?

So to summarize my question, for a typical create/update scenario, where is a (VERY) approximate threshold in terms of orders of magnitude of number of operations, where I should switch to batching as opposed to single operations?

Teja Makani

unread,
Dec 12, 2018, 2:41:25 PM12/12/18
to AdWords API and Google Ads API Forum
Hello Vitaly,

As you suspected, there isn't a threshold based on which you can choose either. "The main reasons for using batch processing are to minimize the number of API requests and retry operations that fail due to transient errors. This doesn't guarantee improved performance resulting in higher throughput or quicker job completion. You need to experiment with different combinations of batch and non-batch processing to determine the optimal solution for your circumstances."

There is no limit on the number of operations that can be performed in a single batch job as long as the overall size of the pending batch job requests does not reach 1GB for account. You could refer this guide to know more about the limitations of BatchJob and this guide for best practices while working with BatchJob. Also BatchJob supports only the operations specified here. You could also refer to the general limitations on the operations allowed per request here. Please let me know if you have any further questions.

Regards,
Sai Teja, AdWords API Team
Reply all
Reply to author
Forward
0 new messages