{"action":"closed","issue":{"url":"https://api.github.com/repos/freedombox/Plinth/issues/106","labels_url":"https://api.github.com/repos/freedombox/Plinth/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/freedombox/Plinth/issues/106/comments","events_url":"https://api.github.com/repos/freedombox/Plinth/issues/106/events","html_url":"https://github.com/freedombox/Plinth/issues/106","id":57615648,"number":106,"title":"High CPU usage even when idle","user":{"login":"SunilMohanAdapa","id":1535496,"avatar_url":"https://avatars.githubusercontent.com/u/1535496?v=3","gravatar_id":"","url":"https://api.github.com/users/SunilMohanAdapa","html_url":"https://github.com/SunilMohanAdapa","followers_url":"https://api.github.com/users/SunilMohanAdapa/followers","following_url":"https://api.github.com/users/SunilMohanAdapa/following{/other_user}","gists_url":"https://api.github.com/users/SunilMohanAdapa/gists{/gist_id}","starred_url":"https://api.github.com/users/SunilMohanAdapa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SunilMohanAdapa/subscriptions","organizations_url":"https://api.github.com/users/SunilMohanAdapa/orgs","repos_url":"https://api.github.com/users/SunilMohanAdapa/repos","events_url":"https://api.github.com/users/SunilMohanAdapa/events{/privacy}","received_events_url":"https://api.github.com/users/SunilMohanAdapa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/freedombox/Plinth/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T15:56:57Z","updated_at":"2015-07-07T08:34:54Z","closed_at":"2015-07-07T08:34:54Z","body":"Currently (FreedomBox 0.3 build images) Plinth is consuming 30-40% percent CPU each with 2 threads even when it is not serving any request.  Apart from being wrong, this is bad for small hardware devices which are already starved for CPU power.\r\n\r\nAfter a bit of investigation, I narrowed down the problem to this:\r\n```python\r\nimport cherrypy\r\nfrom cherrypy import _cpserver\r\n\r\nfrom django.utils.six.moves import xrange\r\n\r\nserver = _cpserver.Server()\r\nserver.socket_host = '127.0.0.1'\r\nserver.socket_port = 52854\r\nserver.subscribe()\r\n\r\ncherrypy.engine.start()\r\ncherrypy.engine.block()\r\n```\r\nThe above code takes up high CPU (30-40%) and without the Django import it only takes 1-2% CPU (still bad)."}}