# High CPU usage invoking pkg_add after upgrading to 9.0 RC1



## YZMSQ (Oct 26, 2011)

Hello, there:
Well, I'm not sure if it's only my own problem, specifically. After upgrading my box to 9.0 RC1, I'm surprised to see the high CPU usage of pkg_add when installing packages from network, which hasn't been encountered while involving 8.2 before. I captured it to the image below:







So, I'm curious to glean that, need I do some tweek after upgrade or anything else? Thx.


----------



## jb_fvwm2 (Oct 26, 2011)

You may want to check your GENERIC file (if you have sources ) for the "debug" line and the paragraph below it (the WITNESS stuff iirc) and rebuild a commented-out one. Howsoever, it could also be due to a very large packages or set-of-packages having a lot of huge tarfiles to unpack.  (Another issue I may have forgotten, but less probable)


----------



## YZMSQ (Oct 26, 2011)

jb_fvwm2 said:
			
		

> Howsoever, it could also be due to a very large packages or set-of-packages having a lot of huge tarfiles to unpack.


Well, it might be the very reason leading to the quirk, I suppose. Thank you.


----------



## YZMSQ (Oct 26, 2011)

jb_fvwm2 said:
			
		

> You may want to check your GENERIC file (if you have sources ) for the "debug" line and the paragraph below it (the WITNESS stuff iirc) and rebuild a commented-out one. Howsoever, it could also be due to a very large packages or set-of-packages having a lot of huge tarfiles to unpack.  (Another issue I may have forgotten, but less probable)


One more question: Do you mean pkg_add is unpacking the tarfiles while downloading, even if the process of download hasn't completed? :r


----------



## da1 (Oct 26, 2011)

No, that's done AFTER the download is complete.


----------



## Beastie (Oct 26, 2011)

But I doubt pkg_add would be wasting so much CPU time unpacking as it's the job of bsdtar.


----------



## da1 (Oct 27, 2011)

Spot on.


----------



## YZMSQ (Oct 27, 2011)

Beastie said:
			
		

> But I doubt pkg_add would be wasting so much CPU time unpacking as it's the job of bsdtar.


Yep. When I'm with 8.2, pkg_add works like a charm without such a high CPU usage, indeed.


----------



## YZMSQ (Oct 27, 2011)

So, is this a problem encountered by me only? Well, I upgrade my box to 9.0 RC1 via the freebsd-update utility rather than source or CD-ROM.


----------



## AVL (Oct 27, 2011)

YZMSQ said:
			
		

> So, is this a problem encountered by me only? Well, I upgrade my box to 9.0 RC1 via the freebsd-update utility rather than source or CD-ROM.



I've noticed this problem as well, in a fresh install of 9.0-RC1 i386 in a VirtualBox VM. [cmd=]pkg_add -r xorg[/cmd] never completes because pkg_add is hanging with 100% CPU.


----------



## overmind (Nov 3, 2011)

I understand you have a high CPU usage but the process is faster?

I ask that because bsdtar only uses one Core of the CPU.

I for example would like a higher CPU usage but a faster time for adding packages.

Still, in your case chances are to be a bug or a debug option enabled in Kernel.


----------



## YZMSQ (Nov 4, 2011)

overmind said:
			
		

> I understand you have a high CPU usage but the process is faster?
> 
> I ask that because bsdtar only uses one Core of the CPU.
> 
> ...


Hi, the CPU in my box has one Core only, and, the high CPU usage seems no effect on the performance of the process, as I see.


----------



## YZMSQ (Nov 14, 2011)

Hi, all, after changing my PACKAGESITE from my previous one to this mirror site, the quirk described above has passed away, so strange. Well, maybe it's the specific mirror that accounts for this high CPU usage?


----------



## YZMSQ (Nov 14, 2011)

Well, I've no idea what happened, but the problem described above is missing, to my surprise (Maybe the modify from packages-9-current to packages-9-stable accounts for it?).


----------

