Re:Facebook hit git performance issue on large repository
by pdw on Friday February 03, 2012 @07:14PM
(#3549697)
Because you can
echo 3 | sudo tee /proc/sys/vm/drop_caches
but sudo echo 3 > /proc/sys/vm/drop_caches
won't work.
Re:Facebook hit git performance issue on large repository
by julian37 on Friday February 03, 2012 @07:34PM
(#3549748)
Right, that's what I was missing. That makes sense, and come to think about it, is a very useful addition to my toolbox. Thanks pdw and jochu!
Re:Facebook hit git performance issue on large repository
by tmhedberg on Saturday February 04, 2012 @11:21AM
(#3551310)
You can also accomplish the same thing with:
sudo sysctl -w vm.drop_caches=3
Re:Facebook hit git performance issue on large repository
by jochu on Friday February 03, 2012 @07:19PM
(#3549708)
Aside from reasons you mentioned, I can imagine it being because it easily allows one to add a sudo or being habit because of it. For example:
echo 3 | sudo tee /proc/sys/vm/drop_caches
Will allow you to write as root and sudo echo 3 > /proc/sys/vm/drop_caches
Will be a permission error. It executes the echo as root and the write as the user
I'm just wondering if this is an idiom with a deeper meaning that I'm not aware of.
EDIT: I'm guessing that when you run it in a script (without set -x), rather than on the command line, you can see in the log what it is you sent?