Task size too large

1,107 views
Skip to first unread message

Deepak Singh

unread,
Apr 26, 2012, 5:37:06 PM4/26/12
to google-a...@googlegroups.com
Hi,

I have a deferred task and am doing database insertion in task queue defined as below,

 <queue>
    <name>dbinsert</name>
    <rate>20/s</rate>
    <bucket-size>100</bucket-size>
    <max-concurrent-requests>10</max-concurrent-requests>
    <retry-parameters>
      <task-retry-limit>7</task-retry-limit>
    </retry-parameters>
  </queue>


Since i am uploading files in task, most often i get the exception "Task size too large".

What can i do to avoid this ?



thanks 
Deepak Singh

Deepak Singh

unread,
Apr 26, 2012, 6:50:41 PM4/26/12
to google-a...@googlegroups.com
Any Suggestion pls...
--
Deepak Singh

Dale Humby

unread,
Apr 27, 2012, 8:19:48 AM4/27/12
to google-a...@googlegroups.com
Passing the contents of a file around within a task is not really correct. Rather store the file in the blobstore (or the datastore) first and then pass a reference to the location of the file as a parameter to the task. 

Deepak Singh

unread,
Apr 27, 2012, 2:46:46 PM4/27/12
to google-a...@googlegroups.com
But my objective to use the task is only to insert the file in datastore.
its an uploaded file by user.

I want to put this operation in task to just make the instance free and insertion should happen in background.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/bP6mraNokV0J.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Deepak Singh

Jeff Schnitzer

unread,
Apr 27, 2012, 3:10:17 PM4/27/12
to google-a...@googlegroups.com
You cannot. You could stash the data in memcache, but at the risk the
data will disappear before your task executes.

This sounds like premature optimization. You're still in the learning
stage. Start by writing the simplest program that could possibly
work, then figure out how to optimize it later.

Jeff

Deepak Singh

unread,
Apr 27, 2012, 3:24:48 PM4/27/12
to google-a...@googlegroups.com
Thanks Jeff.
yes i am in learning stage now.
Will it be better to use the url based task options instead of DeferredTask for this scenario ?
--
Deepak Singh

Jeff Schnitzer

unread,
Apr 27, 2012, 3:41:06 PM4/27/12
to google-a...@googlegroups.com
It's best to just write your data directly to the datastore.

Jeff

Deepak Singh

unread,
Apr 27, 2012, 4:00:04 PM4/27/12
to google-a...@googlegroups.com
So Will that not consume more instance hours ?

Jeff Schnitzer

unread,
Apr 27, 2012, 4:18:48 PM4/27/12
to google-a...@googlegroups.com
Stop trying to optimize until you have a working application.

Jeff
Reply all
Reply to author
Forward
0 new messages