{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/3061","repository_url":"https://api.github.com/repos/syncthing/syncthing","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/3061/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/3061/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/3061/events","html_url":"https://github.com/syncthing/syncthing/issues/3061","id":153679822,"number":3061,"title":"syncthing uses a lot of CPU","user":{"login":"keltia","id":142030,"avatar_url":"https://avatars.githubusercontent.com/u/142030?v=3","gravatar_id":"","url":"https://api.github.com/users/keltia","html_url":"https://github.com/keltia","followers_url":"https://api.github.com/users/keltia/followers","following_url":"https://api.github.com/users/keltia/following{/other_user}","gists_url":"https://api.github.com/users/keltia/gists{/gist_id}","starred_url":"https://api.github.com/users/keltia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keltia/subscriptions","organizations_url":"https://api.github.com/users/keltia/orgs","repos_url":"https://api.github.com/users/keltia/repos","events_url":"https://api.github.com/users/keltia/events{/privacy}","received_events_url":"https://api.github.com/users/keltia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-08T21:59:58Z","updated_at":"2016-05-10T09:23:53Z","closed_at":"2016-05-08T22:28:24Z","body":"Every 30s, syncthing wakes up and does its bookkeeping things and eats up a lot of CPU (around 102-105% most of the time). Sometimes it is using so much CPU that music and movie playing are affected.\r\n\r\n```\r\nroberto         47850   0.1  0.7 573447840  59492   ??  S    10:32AM 168:50.69 /usr/local/opt/syncthing/bin/syncthing -no-browser -no-restart\r\n```\r\n\r\nI know this is only the Virtual size and it is usual for OS X apps to have a big one but 546 GB?\r\n\r\nIn the following snapshot, all the peaks you see in CPU time are due to syncthing.  I also have Dropbox running and it is using less memory and less CPU.\r\n\r\n![screenshot 2016-05-08 23 51 28](https://cloud.githubusercontent.com/assets/142030/15100646/dbad99ea-1577-11e6-936d-83adcd7a28b4.png)\r\n\r\nI don't have that may files in the Sync directory:\r\n```\r\n354 [23:58] roberto@rron-2-1:~/Sync> find . |wc -l\r\n   91851\r\n```\r\n### Version Information\r\nSyncthing Version: v0.12.22\r\nOS Version: OS X 10.11.4 on Macbook Air mid-2012, 8 GB, 512 GB SSD\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/218104612","html_url":"https://github.com/syncthing/syncthing/issues/3061#issuecomment-218104612","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/3061","id":218104612,"user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T09:23:53Z","updated_at":"2016-05-10T09:23:53Z","body":"Well, we do a certain amount of filesystem walking and database calls, so it'll use 100% of CPU for a while (as anything that uses the CPU does), the only question is for how long. Usually this is a quick process - i.e. in my laptop it's usually done in a few fractions of a second. If the rescan does take a long time, due to being low on memory for caches or having slow CPUs etc it can certainly help to use inotify because it removes the need to periodic scans as often, as Audrius says."}}