Wednesday, November 23, 2011

Re: Large Queryset Calculation In Background?

What database are you using? You should be able to find information in
the documents about the locking behavior for that database. Compare that
with the operations your running and determine whether they would result
in an exclusive lock.

From your pseudocode, it looks like you're performing a possibly-lengthy
select, followed by lengthy calculations (not involving database
operations), and then a (presumably) quick save. AFAIK, databases never
lock when doing selects, so depending on the nature of your
calculations, you should be fine.

Additionally, if in doubt, I recommend running some tests with the same
database used in your production environment.

_Nik

On 11/23/2011 8:23 AM, Nan wrote:
> Thanks, Tim -- that looks handy too.
>
> Can anyone comment on the database locking question?
>
>
> On Nov 22, 10:16 pm, Tim Chase <django.us...@tim.thechases.com> wrote:
>> On 11/22/11 17:04, Nikolas Stevenson-Molnar wrote:
>>
>>> I wouldn't expect it to lock the database (though someone with more
>>> database expertise should address that). I /would/ expect it to consume
>>> significant CPU. If you're on UNIX, you could address this issue by
>>> making your process 'nice'
>> There's also an "ionice" that should make disk (and possibly
>> network) I/O operate in a manner kinder to your machine. You'd
>> launch your cron job with the nice/ionice settings.
>>
>> -tkc

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment