cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Extremely slow response times in local dev

Open kanusek opened this issue 5 years ago • 11 comments

What happened?

Average response time is 8000ms or more. Regardless of page.

What should've happened instead?

Previous versions responded in less than 1000ms even with heavy queries.

Additional details

  • Host system configuration:
    • Version of cookiecutter CLI (get it with cookiecutter --version): Cookiecutter 1.7.2
    • OS: OSX 10.15.6
    • Python version: Python 3.8.5
    • Docker versions (if using Docker): Docker version 19.03.12, build 48a66213fe
    • Docker Compose version: docker-compose version 1.26.2, build eefe0d31

I'm using docker-compose to develop and deploy. I have no problems with the production settings.

In settings/local.py with DISABLE_PANELS commented out I'm back to 500ms response times or less.

DEBUG_TOOLBAR_CONFIG = {
    # "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
    "SHOW_TEMPLATE_CONTEXT": True,
}

It could be just me but I wanted to share in case anyone else is having issues.

kanusek avatar Oct 16 '20 13:10 kanusek

Facing same issue, after commenting DISABLE_PANELS response time improves

kaustubhn avatar Oct 17 '20 08:10 kaustubhn

This is a godsend bug report. It literally save me thousands of dollars. My 8 year old macmini was so slow I couldn't bear the development process anymore. I was going to upgrade it immediately. Now things are good. Make development great again.

huydbui avatar Oct 18 '20 04:10 huydbui

Looks like the same issue has been reported to Django Debug Toolbar: https://github.com/jazzband/django-debug-toolbar/issues/1263

Is it the same or a different one? We might want to comment this part of the config for now until it's fixed...

browniebroke avatar Oct 18 '20 10:10 browniebroke

I was encountering the same issue as well, for some reason response was faster when using the node server on port 3000 than the django one at 8000 but this may be irrelevant.

somada141 avatar Oct 19 '20 10:10 somada141

@somada141 Does it help when you're on the admin page? I tried it and I'm still getting 7000ms+ response times there.

kanusek avatar Oct 20 '20 14:10 kanusek

I used to get 14-30 second response times. Something that can help when developing your frontend is to use SHOW_TOOLBAR_CALLBACK:

DEBUG_TOOLBAR_CONFIG = {
    "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
    "SHOW_TEMPLATE_CONTEXT": True,
    "SHOW_TOOLBAR_CALLBACK": "config.utils.toolbar.enable_toolbar",
}

def enable_toolbar(_) -> bool:
    return False

And I would just flip it on and off whenever I actually needed the toolbar.

Andrew-Chen-Wang avatar Nov 02 '20 18:11 Andrew-Chen-Wang

@kanusek yes the responses are far-faster across the board including the admin interface.

somada141 avatar Nov 09 '20 16:11 somada141

Facing same issue, after commenting DISABLE_PANELS response time improves

This worked for me

MJafarMashhadi avatar Dec 29 '20 19:12 MJafarMashhadi

In settings/local.py with DISABLE_PANELS commented out I'm back to 500ms response times or less.

Thanks a lot! It really worked.

baikov avatar Feb 25 '21 19:02 baikov

In settings/local.py with DISABLE_PANELS commented out I'm back to 500ms response times or less.

Thanks a lot! This save me after lots of hours and days of frustration!

jafrancov avatar Sep 14 '21 23:09 jafrancov

This is insane, not only response time is affected but it injects instability as well.

I was getting random 404 responses before commenting out DISABLE_PANELS

ewurch avatar Apr 03 '23 18:04 ewurch