Thursday, January 9, 2014

RE: need django.cache advice

Thanks Erick, I was not aware of Varnish.

Erik wrote:

1000 records from 6 tables shouldn't be a problem if your database is properly indexed. Databases are good at caching query results and not doing excess work when the data hasn't changed. Maybe the first request from a terminal will be slow(ish), but the rest should be fast.

Fred: I was unclear. The initial join is 10000 x 1000 x 20 x 100 ... which gets reduced to about 1000 records. A few records are changed every second.

What sort of performance problems are you having? How fast is it now, and how fast do you need it to be? Have you profiled the requests from the terminal and determined that the culprit is indeed the database?

Fred: I suspect (but have not confirmed) that the problem in connection pooling (i.e. lack thereof). Some requests timeout and blank out the web page on the terminal.
The webpage itself is very simple. Part of my "todo" is to put a timing decorator on this view method to confirm the problem. I've increased virtual cpu's and ram on server
Which helped a little but deleting obsolete information helped a lot.

You could go with your own suggestion, you could create a database view, you could cache the result in Varnish if the terminals are doing HTTP requests. But it depends on where in the stack you are wasting time.

Fred:I cannot really cache the page because it should change every few minutes. I can accept a minute or two of delay in getting the latest data but not 5 minutes.
I would probably (ugly) modify the cache and the model so users are not complaining that their changes don't show up.

Erik

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/A179517C-499F-4C28-8B77-101A554B1885%40cederstrand.dk.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/DCD75728F460F14586086EA606E830820111A51205%40ACEVXCHMBX1001.ADVENTISTCORP.NET.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate