Dropbox is terrible with CPU usage. This is something I reported to them several times, but it seems they don't really care.
Last I tested, Dropbox consumed CPU for ANY changes ANYWHERE in your filesystem, not just within the Dropbox folder. So its (slow) code processed changes even when you untarred a large set of files somewhere in /tmp.
I also stopped using Dropbox for storing my code because of that — it's nearly useless, as it consumes so much CPU and eats so much battery life, that it simply isn't worth the effort.
Another problem with Dropbox is that upon login it indexes the entire Dropbox, which if you have an HDD basically kills the machine for several minutes, e.g. you can't do anything else. That happens to me on a Mac Pro. On an SSD-equipped MacBook things are better, but it's still a monstrous operation.
And to everyone that says you should not store code in dropbox: a) there are good and legitimate reasons for doing so, b) dropbox could work a little more on optimizing CPU usage instead of adding "save your photos to Dropbox" features.
> Another problem with Dropbox is that upon login it indexes the entire Dropbox
I haven't used Dropbox in a while as a local client for other reasons but I think people need to appreciate this is the payoff for having the convenience? How can one expect it to sync changes if it never scans or detects changes? People seem to want a magical product where it never uses any HD throughput or CPU to index/scan/upload megabytes of data, sure it can look for changes less often but that decreases the usefulness of the product.
As a sidenote, surely all the dropboxers use dropbox for everything (they have unlimited accounts) so they must be 100% aware of this? in which case there must be concrete reasons for this!?
That finding might be quite interesting and all... but I'm thoroughly confused about that guy always quoting power consumption in mAh (which is the unit for electrica charge).
I'd also check if that guy's dropbox daemon(s) are stuck in an obvious loop. I'm logged on in my private server, and when it's idle there's hardly any activity on the dropbox threads, the main CPU consumer is one servicing what I suspect to be the main select() loop. And that thread basically stat()ing the .dropbox/config.dbx file every 2 seconds, and reads 16 bytes out of it. That should hardly be measureable in terms of power consumptions on a modern CPU.
i actually do the same as the op and i really like to have a seperate backend up copy of the code in dropbox BEFORE i commit to git. Furthermore i dont really want to commit only because i am changing machines, but if i have something significant and non breaking to commit. This is less of a problem with git as you can just work in your own branches very easily, but still, working on code on multiple machines is just seamless with dropbox.
I store a lot more than just a git repo in Dropbox. I also use it to share files, etc. But yes, I'm starting to look at alternatives. Maybe I'll develop a small utility to push/pull/share files from my home NAS upon request rather than having a continuous process running in the background.
I had this happen in the past too and found it to be the result of two issues:
1) Using dropbox to house a very large git repo with massive changes and tons of branches... Every time I switched branches, the hundreds of files would change and obviously kick off a major sync job.
2) There were a few files in a folder than had the owner set to the wrong owner and Dropbox couldn't get permission to access them. This caused it to get stuck in a loop trying to sync those files and Dropbox ended up running my CPU up to over 100% load.
Fix those issues and you shouldn't see it causing any more problems with your battery life.
Try this: separate out the git directory from the working directory so that the working directory is not in dropbox but the git directory is. That might solve some of your problems.
> Using dropbox to house a very large git repo with massive changes and tons of branches... Every time I switched branches, the hundreds of files would change and obviously kick off a major sync job.
I really have to say honestly: no shit. Sorry if i sound crass but really? When you use an arbitrary piece of software to automatically modify 100s of files the piece of software designed to detect that exact event has do do work and you are complaining? The mind boggles
If you are going to use git/Dropbox like that (and I can't say I really recommend it in the first place) then you should keep a bare repo in dropbox and use it as a local 'remote' (check out working repos from it on each computer that you are working on, and push/pull to/from the bare repo in Dropbox).
The only takeaway is that his power usage shouldn't be that high with Dropbox idling/paused. But given that he's
* surprised at it using a lot of power when doing the initial sync
* decided to have a git repo inside Dropbox (just don't do it, you will run into trouble; and it will cause heavy sync activity, thus waking CPU and wifi)
* using a unit of capacity to express power consumption
I'm not sure I trust his methods.
I regularly turn off Dropbox on and off when switching between mobile broadband and wifi, and haven't seen any difference in power consumption. That's on Ubuntu 13.04 @ Thinkpad T530.
My method is not scientific at all, I agree with that BUT the facts remain: without dropbox on (even after full sync and supposedly idle), my battery life is multiplied by nearly 3.
As a side note, Dropbox behaves differently on OS X. I've never noticed this issue on Windows 8 machines.
One solution to the whole "storing source in dropbox" problem that I liked to use previously (using bitbucket now instead) is just to have a bare git repo in dropbox + the real checkout somewhere else and just push commits to the bare dropbox repo whenever I'm about to switch machine. Could even be set up to happen more automagically since the repo isn't shared.
Syncing binaries (I mainly work in C#) and lots of small changes seems silly to me.
I switched from Dropbox to SpiderOak recently, and they're a bit better, but feels so clunky. I'm just about fed up with all of them. I use CrashPlan for backups and they're at least good for CPU usage because they have a preference -- max CPU (%) when you're at the computer, and max CPU when you're away, which really does help.
Those who are using Dropbox may find something like cpulimit[1] useful. This limits the CPU usage of any process by repeatedly sending SIGSTOP and SIGCONT signals to your process. It's on homebrew for OS X. I think there're some other alternatives available too but can't remember off hand. But if the article's accurate, Dropbox has issues even when it's not indexing heavily.
A non-open-source OS X app called AppTamer can be very handy for managing battery life. You can set process priority and automatically pause non-foreground GUI apps. So when you switch away from your CPU chewing IDE, it'll get SIGSTOP'd.
"I just have to change my habit of having it constantly on while working. Turn Dropbox on and sync before starting to work and then turn it off."
Hohoho. Allow me to suggest a solution. Suppose that you would be ok with having Dropbox sync files every five minutes. Let's suppose that 10 seconds is usually more than enough to do whatever syncing is necessary. Well, then:
$ while :; do killall -STOP Dropbox; sleep 300; killall -CONT Dropbox; sleep 10; done
I do things like this to throttle the CPU usage and, in some cases, the power consumption of applications that really don't need what they're using. This really should be a feature provided by the operating system, but in the meantime, I resort to ridiculous hacks of this sort. (Note that, if you ^C the above loop, Dropbox will likely be still STOPped and you'll have to CONT it again. It is possible to write a more sophisticated program to address this problem.)
The Dropbox daemon wakes up every 10-15 seconds, uses 15% of the CPU then goes back to sleep. All this without any files changed or the index being affected. On 10.8, 10.9 with official versions and betas. Noticeable because I am on an older C2D MacBook Pro.
Wondering whether it's a side effect of something else installed e.g. iStat Menus.
This is interesting, I've also got a 2013 MBA and use DropBox but I've not seen a big dip in battery usage. I might do a bit more testing this week and see whether it has had an impact and I've just not realised, and/or I've put it down to the code-compile-simulator cycle.
I see this problem happening only to me when it's used as code repository. Which is what he is doing. I had that for one project because the client didn't want to use git, but it's horrible. So, logically, when you have a lot of files changing all the time (compiling (xcode, eclipse), adding libraries (node, RoR)) you'll see dropbox taking over your computer. For all other uses it seems fine.
Note also that when you have the issue with a lot of small files, during/after dropbox is done, Finder / mds will jump to the top of your top indexing the files. I disabled mds in my projects directory and will never place active source directories in dropbox again.
Can anyone confirm his findings? I imagine that if this is real, then this is a problem for all MacBook owners not just the latest MacBook Air.
I have a 13" MacBook Air, medio 2011. I bought it almost right after it was released and have used it as my only computer almost every day since. I have the Dropbox agent running all the time.
While working last Sunday I got 5.5 hours of battery life out of it and I've never taken good care of the battery. I never drain it unless I'm not near a power outlet, in which case I just have it plugged in all day.
My current battery health information shows:
Cycle Count: 253,
Condition: Normal
I have a cron script running on my MacBook to make sure the Dropbox client priority is always set to 20 (lowest). I also pause the client manually when moving to battery power. I really wish there was a better solution, like switching to a similar service that offers decent (or at least acceptable) software, but almost everyone else uses the same setup with terrible 'universal' Java/Python/etc-based clients that absolutely suck at synchronizing large amounts of data.
OS X 10.9 does show battery use per app in the Activity Monitor. It also shows a short list of battery-draining apps right in the battery menu at the top of the screen.
Open Dropbox when you need to sync, then quit the process. Make sure it doesn't run at OS X start up. I don't see why most of the users want to have a perfect sync all day long since it doesn't happen in real time (large files, slow network, etc.)
Oh if only it was one App that killed the battery on the last laptop I bought. Before nuking the default windows install, I did a quick test, with all the crapware that comes as standard, it managed about 4 hours. Fresh install 6.5 hours.
Since I'm stuck using an old computer I made a small script that turns Dropbox on every few hours and kills it after 10 minutes. I don't sync data all the time so this solution works well for me and I save system resources.
I push to a bare repo in a dropbox folder because I can't for the life of me get a secure connection through the work firewalls / proxy so I don't bother and let dropbox deal with it.
[+] [-] jwr|12 years ago|reply
Last I tested, Dropbox consumed CPU for ANY changes ANYWHERE in your filesystem, not just within the Dropbox folder. So its (slow) code processed changes even when you untarred a large set of files somewhere in /tmp.
I also stopped using Dropbox for storing my code because of that — it's nearly useless, as it consumes so much CPU and eats so much battery life, that it simply isn't worth the effort.
Another problem with Dropbox is that upon login it indexes the entire Dropbox, which if you have an HDD basically kills the machine for several minutes, e.g. you can't do anything else. That happens to me on a Mac Pro. On an SSD-equipped MacBook things are better, but it's still a monstrous operation.
And to everyone that says you should not store code in dropbox: a) there are good and legitimate reasons for doing so, b) dropbox could work a little more on optimizing CPU usage instead of adding "save your photos to Dropbox" features.
[+] [-] davedx|12 years ago|reply
I'm genuinely curious: why do this, as opposed to using a DVCS like git?
[+] [-] cones688|12 years ago|reply
I haven't used Dropbox in a while as a local client for other reasons but I think people need to appreciate this is the payoff for having the convenience? How can one expect it to sync changes if it never scans or detects changes? People seem to want a magical product where it never uses any HD throughput or CPU to index/scan/upload megabytes of data, sure it can look for changes less often but that decreases the usefulness of the product.
As a sidenote, surely all the dropboxers use dropbox for everything (they have unlimited accounts) so they must be 100% aware of this? in which case there must be concrete reasons for this!?
[+] [-] wslh|12 years ago|reply
[+] [-] cnvogel|12 years ago|reply
I'd also check if that guy's dropbox daemon(s) are stuck in an obvious loop. I'm logged on in my private server, and when it's idle there's hardly any activity on the dropbox threads, the main CPU consumer is one servicing what I suspect to be the main select() loop. And that thread basically stat()ing the .dropbox/config.dbx file every 2 seconds, and reads 16 bytes out of it. That should hardly be measureable in terms of power consumptions on a modern CPU.
[+] [-] nicoschuele|12 years ago|reply
[+] [-] omarrr|12 years ago|reply
I'd suggest you invest in a hosted git repo.
[+] [-] adamors|12 years ago|reply
[+] [-] kayoone|12 years ago|reply
[+] [-] nicoschuele|12 years ago|reply
[+] [-] InclinedPlane|12 years ago|reply
[+] [-] mariusmg|12 years ago|reply
[+] [-] bherms|12 years ago|reply
1) Using dropbox to house a very large git repo with massive changes and tons of branches... Every time I switched branches, the hundreds of files would change and obviously kick off a major sync job.
2) There were a few files in a folder than had the owner set to the wrong owner and Dropbox couldn't get permission to access them. This caused it to get stuck in a loop trying to sync those files and Dropbox ended up running my CPU up to over 100% load.
Fix those issues and you shouldn't see it causing any more problems with your battery life.
[+] [-] InclinedPlane|12 years ago|reply
E.g.: git --git-dir=/home/me/dropbox/git/proj --work-tree=/home/me/proj init
[+] [-] raverbashing|12 years ago|reply
But yes, the dropbox client devs should go through these bugs and hopefully fix them
[+] [-] easytiger|12 years ago|reply
I really have to say honestly: no shit. Sorry if i sound crass but really? When you use an arbitrary piece of software to automatically modify 100s of files the piece of software designed to detect that exact event has do do work and you are complaining? The mind boggles
[+] [-] jlgreco|12 years ago|reply
[+] [-] maikhoepfel|12 years ago|reply
I'm not sure I trust his methods.
I regularly turn off Dropbox on and off when switching between mobile broadband and wifi, and haven't seen any difference in power consumption. That's on Ubuntu 13.04 @ Thinkpad T530.
[+] [-] threeseed|12 years ago|reply
[+] [-] nicoschuele|12 years ago|reply
As a side note, Dropbox behaves differently on OS X. I've never noticed this issue on Windows 8 machines.
[+] [-] rasmuskl|12 years ago|reply
Syncing binaries (I mainly work in C#) and lots of small changes seems silly to me.
[+] [-] Osmium|12 years ago|reply
Those who are using Dropbox may find something like cpulimit[1] useful. This limits the CPU usage of any process by repeatedly sending SIGSTOP and SIGCONT signals to your process. It's on homebrew for OS X. I think there're some other alternatives available too but can't remember off hand. But if the article's accurate, Dropbox has issues even when it's not indexing heavily.
[1] https://github.com/opsengine/cpulimit
[+] [-] rsanders|12 years ago|reply
[+] [-] waterhouse|12 years ago|reply
Hohoho. Allow me to suggest a solution. Suppose that you would be ok with having Dropbox sync files every five minutes. Let's suppose that 10 seconds is usually more than enough to do whatever syncing is necessary. Well, then:
I do things like this to throttle the CPU usage and, in some cases, the power consumption of applications that really don't need what they're using. This really should be a feature provided by the operating system, but in the meantime, I resort to ridiculous hacks of this sort. (Note that, if you ^C the above loop, Dropbox will likely be still STOPped and you'll have to CONT it again. It is possible to write a more sophisticated program to address this problem.)[+] [-] threeseed|12 years ago|reply
The Dropbox daemon wakes up every 10-15 seconds, uses 15% of the CPU then goes back to sleep. All this without any files changed or the index being affected. On 10.8, 10.9 with official versions and betas. Noticeable because I am on an older C2D MacBook Pro.
Wondering whether it's a side effect of something else installed e.g. iStat Menus.
[+] [-] nicholassmith|12 years ago|reply
[+] [-] tluyben2|12 years ago|reply
Note also that when you have the issue with a lot of small files, during/after dropbox is done, Finder / mds will jump to the top of your top indexing the files. I disabled mds in my projects directory and will never place active source directories in dropbox again.
[+] [-] mtts|12 years ago|reply
And that is, I would say, rather strange.
[+] [-] watson|12 years ago|reply
I have a 13" MacBook Air, medio 2011. I bought it almost right after it was released and have used it as my only computer almost every day since. I have the Dropbox agent running all the time.
While working last Sunday I got 5.5 hours of battery life out of it and I've never taken good care of the battery. I never drain it unless I'm not near a power outlet, in which case I just have it plugged in all day.
My current battery health information shows: Cycle Count: 253, Condition: Normal
[+] [-] da_maire|12 years ago|reply
[+] [-] zurn|12 years ago|reply
[+] [-] 9h1d9j809s|12 years ago|reply
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] lcnmrn|12 years ago|reply
[+] [-] TheAnimus|12 years ago|reply
[+] [-] nicoschuele|12 years ago|reply
For Windows boxes, there's decrapifier.
[+] [-] OrdojanAndrius|12 years ago|reply
[+] [-] Already__Taken|12 years ago|reply
[+] [-] diziet|12 years ago|reply