On Saturday 11 March 2017 21:29:10 Vijay Khemlani wrote: > "But the CPU usage and time taken are high" <- I'm assuming high > enough to be problematic for OP. > > I'm seriously not following. Why are people suggesting reporting and > export software when OP hasn't even described the problem in detail.
Several reasons. Some chime in without reading the entire thread (cause OP already stated he's using Celery and displaying a notice when report is done). Another is that, as you've said, there's not enough detail to get to the root cause, but you gotta start somewhere. Another is that the question is two-fold: 1) What causes CPU to spike 2) How can I scale this better >From personal experience, I find that displaying a notice "job is scheduled. >It's estimated to be done at h:m and you will be notified by email" instills a calmness on project owners, that would otherwise make them adjust project requirements, cause they're biting their nails looking at a progress bar. > It's not even clear whether the high cpu and time taken are due to the > basic query ("Model.objects.all()") or the further processing of the > report. Agreed. But none the less, offloading to other hardware frees up webserver resources and scales better. In fact, I would stop investigating if there's other things to finish, get the budget for the second machine and pick this up again in final stages to see if there's something that can be done. > It could easily be a missing "select_related" which causes thousands > of joins inside a for loop. Good one. Takes a few seconds to check if not move on. -- Melvyn Sopacua -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1678874.4jI55StGvn%40devstation. For more options, visit https://groups.google.com/d/optout.