Scheduler - limit on how large the result can be?

35 views
Skip to first unread message

Andre Kozaczka

unread,
May 12, 2016, 10:03:54 AM5/12/16
to web2py-users
This question is in reference to Brad's post a couple years ago:

https://groups.google.com/forum/#!searchin/web2py/scheduler$20results/web2py/WM7cyrUV5-U/49JVuq5uL0wJ

Is there a limit on how large a "result" from a scheduled task can be? If so, how are folks working around this? My site parses some data for the user and generates a table which can be fairly large. I was thinking the scheduled task could save the table into a database and pass back an id so the user can access it.

-Andre

Alfonso Serra

unread,
May 12, 2016, 11:44:53 AM5/12/16
to web2py-users
A Task's run_output and run_result fields types are mapped to LONGTEXT if you are using mysql, this is 4gb storage capacity. Python strings should be around 3Gb depending on your system's ram amount.


Niphlod

unread,
May 12, 2016, 3:32:12 PM5/12/16
to web2py-users
this has been solved recently (the result couldn't be larger than 64k on most platforms). Right now it has no limitations, although its surely finite. 
Please do keep in mind that (on top of your task being forced to pass around big chunks of data) result is always json string. 
Whenever you need to save and load a result, you convert back and forth to/from json.

If your "thing to do" its in the form of a series of zillions of rows that needs to stored properly, you'd waste far less "energy" just making your scheduled task saving the result in the "final" table rather than returning the result and then having another piece that fetches the result from the scheduled task and translates the result to the table.

Andre Kozaczka

unread,
May 12, 2016, 10:37:48 PM5/12/16
to web2py-users
Ah, well by "recently" I'm guessing you mean within the last 6 months. I just did an update and works now :)

Thanks for the additional advice - I will have the scheduled task return a TABLE(). Now I need to take a closer look at your w2p_tvseries code to get the PeriodicalUpdater to work.

-Andre
Reply all
Reply to author
Forward
0 new messages