HTTP 413/Request Entity Too Large

1,007 views
Skip to first unread message

Aaron Siladi

unread,
Oct 1, 2014, 1:54:44 PM10/1/14
to google-doubleclick...@googlegroups.com

Dear DFP API Support,

I would like to know the size of HTTP request that will trigger HTTP 413 error.  We often receive this error when attempting to bulk update our large line items, and the recommended approach of DFP to deal with this is inefficient, which I will demonstrate below using the results of some tests I ran yesterday.      

Initially, I attempted to update 5000 big line items using a chunk size of 150, which is around 1/3 the chunksize that works fine for normal-sized line items (500 items)

The majority of these requests generated HTTP 413 and were cut in 3 pieces and resubmitted.  Some of the 50 item chunks also triggered HTTP 413 and needed to be split.  This initial attempt using 150 as the starting size, was on schedule to take 4.5 hours to complete, due to all the retries, and phantom concurrent_mod errors.

(side note: it seems this kind of big request may trigger a DFP bug where concurrency_modification error is incorrectly returned after an excessively long wait period.  I sent another note about this) 

After trying initial chunksize of 150, I reduced it to 50.  Some of these requests also generated HTTP 413 and needed still to be broken down smaller still.  This completed in 1h 24 min

After that, I reduced the size to 10.  This completed in 68 min without any HTTP 413. 

So as you can see the request size matters a lot when updating items.  But if I just program the chunksize of 10 items, I’m penalizing users most of the time, because the majority of our line items are not that large to require that.  If I start with a bigger size, like 150 (let alone something bigger which actually is fine the majority of the time), then when large items do come through, the retries make it end up taking over 4 times longer to update them.

I know DFP is always trying to improve user experience and make the system easier to work with, so I was thinking it would be incredibly useful if you determined the HTTP request size limit from your Frontend network team and publicized it on your “Systems Maximums and Limits” page: https://support.google.com/dfp_premium/answer/1628457?hl=en

With this information, we could measure out exactly the right number of line items per request without generating HTTP 413, and always perform our updates in the quickest possible amount of time.

Thanks!!!!

Aaron

Vincent Tsao (DFP API Team)

unread,
Oct 2, 2014, 3:16:46 PM10/2/14
to google-doubleclick...@googlegroups.com
Hi Aaron:

I sent you a message.

Thanks,
Vincent Tsao, DFP API Team

Luis Santos

unread,
Jun 22, 2016, 4:00:33 PM6/22/16
to Google's DoubleClick for Publishers API Forum
Hi guys,

Would you mind sending us the solution?
We are facing the same issue...

Thanks.

Vincent Tsao (DFP API Team)

unread,
Jun 22, 2016, 4:05:29 PM6/22/16
to Google's DoubleClick for Publishers API Forum
Hi Luis:

What entities are you creating in DFP that is causing this? And how many are you creating at the same time? Basically you will need to create less entities at the same time to avoid this.

Thanks,
Vincent Tsao, DFP API Team

Luis Santos

unread,
Jun 22, 2016, 4:48:58 PM6/22/16
to Google's DoubleClick for Publishers API Forum
Hi Vincent, thanks for the quick response.

We are using the following service:

 com.google.api.ads.dfp.axis.v201605.CreativeServiceInterface createCreatives(Creative[] creatives)

Just like in Aaron's case, it is not a specific error scenario. The fact is that we need to send 50-100 creatives per request and (sometimes) we receive a different exception (HTTP 413/Request Entity Too Large  |  Connection has been shutdown. Broken pipe).

Should we set any other specific parameter in the opened session? Is there a limit creatives per request that we should consider?

Regards,
Luis

Vincent Tsao (DFP API Team)

unread,
Jun 22, 2016, 5:27:12 PM6/22/16
to Google's DoubleClick for Publishers API Forum
Because some creatives require assets (e.g., images), and the assets are encoded as a base64 string, if the assets are large, then your SOAP payload is going to be very large and is exceeding the maximum allowed size. Either you should flag large creatives on your end and send them one by one for creation, or you can write logic to reduce the batch size when you get this error and retry with half the size each time until it works. So if 100 creatives don't work, then reduce to trying to create 50 creatives at the same time.

Thanks,
Vincent Tsao, DFP API Team

Luis Santos

unread,
Jun 22, 2016, 6:40:01 PM6/22/16
to Google's DoubleClick for Publishers API Forum
Great Vincent. 
We will go back to the drawing board and check which is the best approach.
Thank you once again for the attention.
Regards,
Luis
Reply all
Reply to author
Forward
0 new messages