Dropbox will kill your insane MacBook Air 2013 battery
blog.nicoschuele.com
blog.nicoschuele.com
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.
I'm genuinely curious: why do this, as opposed to using a DVCS like git?
Also, in many cases it is easier for a graphic designer or just a customer to put stuff in a Dropbox folder that will sync to their website, than uploading stuff using a web form or learning to use git and X amount of deployment tools.
... unless you're running on batteries.
The way people generally use source control isn't to push every single line added or changed to a remote copy of the repo as soon as it is done. A commit is more tied to completing a task, you need something else to cover you for loss for smaller amounts of code than that if your computer dies.
More specifically to me, it depends on what branch I'm on. If I'm on dev, I have no problem with big commits. (For features I'll often set a bookmark [hg]- maybe even clone and work from the clone if it's risky).
But if I'm on test or hotfixing on stable, I use very small commits so that I can easily graft (backport) back to dev.
But at the very least I have more than one commit message like -FIX blah blah commit so can get from <name of other machine>
I guess you could say Dropbox gives me finer sync granularity than git does.
Dropbox seems like a perfect solution: have a single place where you keep code, develop on two machines, just pick up your laptop and leave whenever you want, without worrying about sync.
Put it another way, I don't understand why you'd use Dropbox at all, after all you could easily version all your files in git, using push/pull/branch/commit/rebase to get your data to your different machines. Git handles this problem very well, after all.
Obviously with regular files, that is not an issue, so Dropbox works well. (unless you're managing them with git, I guess)
If you're willing to accept the "lightness" of git branching and commits, it's possible to "save and sync" your work very quickly. Assuming you're on a dev branch:
git add -A
git commit -m "temp commit 2013-7-3"
git push origin
You can even script this, see for example:
http://stackoverflow.com/questions/8482843/git-commit-bash-s...
Then when you're ready to work on a different machine, you fetch from origin.
If you want to keep your commits meaningful on your dev branch, you can create a temp branch first, then rebase later to get rid of the ugly temp commit.
git checkout -b temp123
Dropbox could help there, but it does not.
That way the client can have programmers/designers change their UI without needing any access into the server. It also allows me to share each site and doesn't bring the entire headache of managing accounts. I simply share the yoursite.com folder to the client. If a client has multiple sites it's just as easy to share all of them.
So I work on a directory that is in dropbox, and in git, and I can instantly shutdown my PC and start writing code on the laptop. Commiting changes is a separate step. It's quite convenient. Also I can test the code by accessing dropbox public link (it's mostly javascript and static websites), and there's no separate "deploy" step - when I save a file on any computer the change is ready to be tested, always at the same place. With git I would need to remember to commit, and update before I test, or I would need to set up a test server on every computer, and depending on where I work I would need to access different address. The difference between 15 seconds and 0 seconds to test small change is VERY significant.
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!?
The indexation doesn't need to happen immediately upon boot. Do one directory every minute or so, let the computer start up and do other things while your background task runs.
Changes are detected because the operating system notifies dropbox of changes made, they're not continuously scanning the drive. From other comments it sounds like dropbox has registered a hook like that for the entire filesystem, instead of just the working folder. That seems unnecessary.
Why can't Dropbox remember the state of the files in your dropbox folder, and upon login, grab state of the files on the Dropbox server and do a simple comparison, without re-calculating hashes for the files on your computer?
I guess the methods I propose will not guarantee proper syncing if for some reason a file has changed but the metadata hasn't...
From my conversations with Dropbox support I understood that Dropbox really can't handle a large number of small files. The large plans are intended for people who store large files, not lots of stuff.
The new battery indicator on the menu bar identifies apps that consume the most energy, and Activity Monitor now details energy consumption per process.
First in list of features: https://developer.apple.com/osx/whats-new/
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'd suggest you invest in a hosted git repo.
Just added some rules so that Dropbox quits when I'm in my "mobile" context, but reopens when I am in my "home" or "office" contexts. Will see whether it works on my commute later.
$ git annex add myfile
$ git annex copy --to=NAS myfile
$ git annex get myotherfile
$ git annex drop --from=NAS myotherfile
If the NAS has rsync support, you can add it with a single command: $ git annex initremote NAS type=rsync \
rsyncurl=rsync://example.com/myrsync encryption=<gpg-email>
http://git-annex.branchable.com/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.
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
E.g.: git --git-dir=/home/me/dropbox/git/proj --work-tree=/home/me/proj init
(2) another solution is to just clone the bare repository in Dropbox to a temp-directory, work there, and push the changes back to the Dropbox'ed repo. Saves you the effort to specify GIT_DIR or --git-dir all the time and is the saner approach if you have to switch back and forth between different repos.
$ GIT_DIR=~/Dropbox/my_repo git init --bare
Initialized empty Git repository in /home/chris/Dropbox/my_repo/
$ git clone ~/Dropbox/my_repo
Initialized empty Git repository in /home/chris/my_repo/.git/
warning: You appear to have cloned an empty repository.
$ cd my_repo ; touch README
$ git add README ; git commit -m "README" ; git push origin master
[master (root-commit) ada37ca] README
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README
Counting objects: 3, done.
Writing objects: 100% (3/3), 213 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /home/chris/Dropbox/my_repo
* [new branch] master -> masterBut yes, the dropbox client devs should go through these bugs and hopefully fix them
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.
sudo fs_usage -w
I've been watching it recently and it seems to touch files that it shouldn't need to. I need to do more investigation. I uninstalled backblaze recently because I discovered that it manually scans the whole filesystem _all the time_.
Out of interest, if you don't mind me asking, how large is your backup, and do you use S3 or Glacier backend?
Indexes are stored in S3, data is on Glacier
~450GB of data stored
316,189 Requests to upload it all (main cost)
$17.39 to upload it all
$5.09 to store it last month (but upload was incomplete)
Expect closer to $6-$7 to store it this month
~$120 to restore it all (that was a back of the napkin figure before I started)
Arq has a number of good things to recommend it. The creator lurks around here, which is always nice to know. The design is very sensible - it's basically a git index on S3 with the data blobs in Glacier. The storage format is open and documented. All the data is encrypted using your own key locally and then pushed to your own AWS account. It works out really cheap if you use Glacier (only planning on restoring in catastrophic circumstances).It all just works. The interface is easy and intuitive. I pushed my data to the EU region since it's closer. The more I think about it the happier I am with my choice at the moment. Even if I changed my mind and stopped using it - it's nice knowing that for a few dollars a month I have a huge snapshot of my data in a reasonable format in my AWS account.
As a side note, Dropbox behaves differently on OS X. I've never noticed this issue on Windows 8 machines.
Syncing binaries (I mainly work in C#) and lots of small changes seems silly to me.
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.
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.
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.
And that is, I would say, rather strange.
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
For Windows boxes, there's decrapifier.
On the other hand, I didn't notice any difference in battery consumption on my Windows 8 laptops. Who knows, maybe OS X Mavericks will change that with the way it handles processes?