10

I have a massive GIT project with several GIT submodules inside. I recursively changed ownership(chown -r) from root to my user for each file in my project.

Now any git command takes a lot of time to complete and seems to use 99% CPU. What is the issue?

I did sudo chown -R my_user my_project/

UPDATE

This seems not to be only GIT related, other terminal commands take a lot of time too. top shows me 100% git usage for like 15 seconds instead of usual 0-1 seconds.

lukas.pukenis
  • 225
  • 2
  • 8

1 Answers1

13

With the command

sudo chown -R my_user my_project/

you have changed all files in a huge (as you said) repository, therefore your KDE/GNOME/Unity file indexer has a lot of work now. Give the process time to complete its work. Go and drink a coffee ;)

To watch what's happening from an Input/output perspective, install iotop via:

sudo apt-get install iotop

and watch the output of:

sudo iotop

A.B.
  • 89,123
  • 21
  • 245
  • 323
  • Why? `git` only check the modes. – muru Oct 02 '15 at 08:43
  • That probably is the reason. Its the only one I can think of too. Also I like coffee so I've already have one made for myself :)) – lukas.pukenis Oct 02 '15 at 08:59
  • @lukas.pukenis What about the coffee and `top`, `htop` response? Who's wasting your resources? :-) Remember that you can always exclude paths from the file indexer, and add again when you will go to eat or to sleep ! – Hastur Oct 02 '15 at 09:35
  • @Hastur when I type like `git status` I have 100% cpu usage for like 15seconds instead of `0..1` seconds. Memory is not an issue and IO activity is low :/ – lukas.pukenis Oct 02 '15 at 09:42
  • 2
    @lukas.pukenis I shouldn't assert it so easily, with no doubt as you do: if there are many other processes that are opening/blocking that files (remember the magic word __massive__ ), you can need more time then before. Please check and update who is using your HDD and your CPU time. None can find from here the answer and it is over there. Good hunt and coffee. BTW if you pause/stop the indexer and when you give the command it's faster you find your guilty. :-) Good hunt and coffee... – Hastur Oct 02 '15 at 09:49