11

I recently noticed that Dropbox is taking about 50-90% of my CPU for more than just a few seconds sometimes - mostly when downloading/syncing many or large files.

Still, I guess that even when syncing a lot of data, there's no reason to use that much CPU (perhaps network or disk..)

Any ideas or suggestions? How can I make Dropbox use less CPU?

(running on Ubuntu 12.04 on Lenovo X220 with SSD Drive)

3
  • 1
    One thing I do is start dropbox with a niceness of 18. Perhaps this would help your situation too. – Scott C Wilson Apr 22 '13 at 18:28
  • (ORIGINALLY POSTED BY: @Rafael) Hashing takes often longer than expected because the dropbox cache keeps copies of old files. Check the ./dropbox.cache folder. – BiggJJ Jun 30 '13 at 18:33
  • 2
    This question is referred to in Super User question Dropbox causes high CPU usage on Mac OS X 10.8.2 (Mountain Lion). – Peter Mortensen Nov 24 '13 at 12:24
6

Dropbox computes a hash of all files that it's going to sync, it uses it both to determine if they changed and to avoid uploading content that is already in their cloud (another customer has the same file).

Calculating hashes takes CPU power. It's usually noticeable at login.

3
  • 1
    I see.. I guess that might be the reason - though it's still quite annoying sometimes! Thanks :) – Yoav Feuerstein Oct 26 '12 at 16:54
  • maybe some system way, renice it to 19? – Aquarius Power May 2 '14 at 17:52
  • 3
    you can use cpulimit – Aquarius Power Aug 19 '14 at 22:59
11

Good shout with using cpulimit.

I found this could be simplified (when logged as root) to

cpulimit -e dropbox -l 10

where -l specifies percentage of CPU. Note this is for total CPU over all cores, so a dual core would have a limit of 200

Output:

cpulimit -e dropbox -l 10
Process 2641 detected
2
  • that would require sudo password, tho adding that line to sudoers will do the trick I guess – Aquarius Power Aug 19 '14 at 22:53
  • @AquariusPower If you were not logged in as root then it would indeed require sudo. (I was logged in as root - edited to clarify) thanks – alleyoopster Aug 13 '15 at 9:52
2

Perhaps there is more to it than the problem of hashing.

One thing that I find strange is that with lsof | grep dropbox I do not see many open files under ~/Dropbox for the dropbox process.

What I did was to aptitude purge all packages related to dropbox, rm -r the 3 ~/.dropbo* folders (but not the ~/Dropbox folder), and then enable partner repositories and aptitude install nautilus-dropbox. Whether this procedure is problematic I do not know.

After a while (an hour?) with the new install and with dropbox CPU load I no longer see the load, so apparently the problem is solved. Perhaps the purging has helped or I just had a very large batch of files that needed updating.

2
  • Thanks! I'll give it a try the next time something like this happens again. – Yoav Feuerstein Mar 20 '13 at 22:34
  • I have already nautilus-dropbox and only one ~/.dropbox, my cpu usage and sysload is high :( – Aquarius Power May 2 '14 at 17:52
2

You can limit the cpu usage of any application this way:

#nPidDropbox=`ps -A -o pid,comm |egrep " dropbox$" |sed -r "s'^ *([[:digit:]]*) .*'\1'"`
nPidDropbox=`pgrep dropbox`

renice -n 19 `ps -L -p $nPidDropbox -o lwp |tr "\n" " "`
cpulimit -p "$nPidDropbox" -l 10

The first line of code is just a pid guesser. The 2nd line is to help cpulimiter work better while not requiring sudo.

2

Now, 2019. Dropbox is on version 79. Using it with Debian on a i7 7th gen, it still consumes ~ 15% Cpu when not uploading or downloading files.

In its download page, Dropbox says how to install in a headless environment.

The dropboxd executable always open tray icon when running on X. I found that running it always in headless mode made CPU consumption lower to 1% after few minutes

#!/bin/bash

unset DISPLAY
while : ; do
  rm -rf $HOME/.dropbox/dropbox.pid
  rm -rf /tmp/dropbox*
  ~/.dropbox-dist/dropboxd
  sleep 10
done >> /dev/null

But be aware you can run this only after login on Dropbox

0

This happens to me frequently even when Dropbox is not actually syncing anything (there the hashing answer makes sense to me). My quick solution is to simply set Dropbox to stop syncing. Even tho it isn't actually syncing anything this seems to kill the CPU usage. Just have to remember to turn it back on later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.