On Thu, 2009-03-26 at 02:17 -0700, Szymon wrote:
> I've added some syslog stuff to determine when cron job is done...
> and, it's strange. It seems that cron job is done after 5 seconds, but
> commits are done 3 minutes later.
> 
> Mar 26 10:10:01 ns204293 python: Job started
> Mar 26 10:10:05 ns204293 python: Job done
> 
> And then
> 
> Mar 26 10:13:08 ns204293 postgres[10543]: [2-1] [10543]LOG:  duration:
> 2207.464 ms  statement: COMMIT
> Mar 26 10:14:10 ns204293 postgres[10611]: [2-1] [10611]LOG:  duration:
> 1232.730 ms  statement: COMMIT
> Mar 26 10:14:18 ns204293 postgres[10623]: [2-1] [10623]LOG:  duration:
> 2160.053 ms  statement: COMMIT
> Mar 26 10:14:19 ns204293 postgres[10626]: [2-1] [10626]LOG:  duration:
> 1017.767 ms  statement: COMMIT
> Mar 26 10:14:22 ns204293 postgres[10633]: [2-1] [10633]LOG:  duration:
> 1367.446 ms  statement: COMMIT
> Mar 26 10:14:28 ns204293 postgres[10638]: [2-1] [10638]LOG:  duration:
> 1728.915 ms  statement: COMMIT
> Mar 26 10:14:28 ns204293 postgres[10639]: [2-1] [10639]LOG:  duration:
> 1995.378 ms  statement: COMMIT
> Mar 26 10:15:15 ns204293 postgres[10681]: [2-1] [10681]LOG:  duration:
> 2381.933 ms  statement: COMMIT
> 
> It's normal behaviour?

No. Normal code is not going to finish in five seconds and then sit
around for another 175 seconds before committing.

Perhaps you should start reducing your cronjob to the smallest possible
example that reproduces the problem. Start by removing all the lines,
except maybe one database operation and see if that triggers it. Keep
increasing by adding a line or so at a time. It's interesting that there
seem to be eight commits here for a single cronjob. Is that what you
expect? Are you explicitly committing the transaction at the end? Or
closing the connection?

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to