question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

runserver_plus constantly uses about 30% of one CPU

See original GitHub issue

Hey there,

I’m really pleased with runserver_plus but found today that it uses 30% of one CPU (according to top & htop)

When I run strace on the process, I see thousands of stat calls. I guess it’s checking all my files (even libraries) for changes.

I’m on Linux – Ubuntu 14.04 “trusty”. Is there any way to enable an alternative to this exhaustive polling on my platform, other than --noreload?

Thanks! Evan

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ezheidtmanncommented, Feb 19, 2015

I think I may have answered my own question: The problem lies in werkzeug, which once supported inotify but no longer does.

In the 0.10 release notes, this is the latest mention of inotify:

Version 0.7.1 (bugfix release, released on July 26th 2011)

Fixed a problem with newer versions of IPython. Disabled pyinotify based reloader which does not work reliably.

http://werkzeug.pocoo.org/docs/0.10/changes/

0reactions
sbnbcommented, Feb 27, 2015

Thanks a lot trbs.

Passing ‘–reloader-interval N’ works as expected.

as does putting RUNSERVERPLUS_POLLER_RELOADER_INTERVAL = 5 in the settings file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RunServerPlus — django-extensions 3.2.1 documentation
To get started we just use the runserver_plus command instead of the normal runserver command: $ python manage.py runserver_plus * Running on ...
Read more >
django-extensions Documentation - Read the Docs
This is a handy command to generate a new password which can be used for a user password. This uses Django core's default...
Read more >
django development mode runserver --noreload hits 100 ...
i tried on a quad core machine it gets to 30 percent cpu usage too. i guess the runserver is not very effective...
Read more >
Best Open Source Django Packages of 2020 - Crowdbotics
It simply uses a regular function-based view if you don't need the more powerful features. It has very good documentation. Django-rest-framework ...
Read more >
Django app on production consistently taking up CPU. - Reddit
13 votes, 14 comments. I have been running a production Django application in a virtual machine for 4-5 months now. One thing I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found