Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Slow to Verify Portage Unverified-download-quaranti
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Kellerkalt
n00b
n00b


Joined: 22 Dec 2020
Posts: 36

PostPosted: Sun Apr 18, 2021 4:43 pm    Post subject: [SOLVED] Slow to Verify Portage Unverified-download-quaranti Reply with quote

I've noticed that portage takes a very long to verify the unverified download quarantine after an "emerge --sync" on my i7-5820K @ 3.30GHz computer, but portage performs the same task much much faster on an old laptop with a Core2 Duo CPU T7250 @ 2.00GHz. I haven't timed it, but it is very clear that the old laptop is more than twice as fast as the i7 at this task.

Code:
Verifying /var/db/repos/gentoo/.tmp-unverified-download-quarantine ...


Is there possibly a specific CPU flag that I've failed to enable that would keep portage from running faster on the i7 than it does on the Core2 Duo?


Last edited by Kellerkalt on Mon Apr 19, 2021 7:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9690
Location: almost Mile High in the USA

PostPosted: Sun Apr 18, 2021 7:04 pm    Post subject: Reply with quote

Is the process CPU (R) or I/O (D) bound?
Perhaps fragmentation is bad if you have rust spinners?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Sun Apr 18, 2021 7:45 pm    Post subject: Reply with quote

Is /var/db/repos/gentoo on a local disk? Or is it on an NFS or SAMBA share?
Back to top
View user's profile Send private message
Kellerkalt
n00b
n00b


Joined: 22 Dec 2020
Posts: 36

PostPosted: Sun Apr 18, 2021 11:51 pm    Post subject: Reply with quote

eccerr0r - Neither the process CPU or I/O are bound or adjusted in any way at all.

mike155 - /var/db/repos/gentoo is on the / (root) partition for each computer.

It's worth noting that I also run a Gentoo lab KVM VM on the i7 computer and the process takes longer in that VM on the i7 host than it does on the Core2 Duo as well and it's been allocated 6 cores as well. I'm not running "emerge --sync" at the same time on the i7 host and the VM at the same time though.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9690
Location: almost Mile High in the USA

PostPosted: Sun Apr 18, 2021 11:57 pm    Post subject: Reply with quote

I didn't ask whether they were throttled, rather was the process using CPU at 100% ("cpu bound") or waiting for disk ("i/o bound").

Also the check is single threaded last I checked, and thus core counts don't matter. Need raw CPU single thread performance.

KVM incurs CPU penalty on i/o operations.

So you have a Core2 Duo with 6 cores? If you do, you don't have a core2 duo. If you don't, this is why English sucks.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Kellerkalt
n00b
n00b


Joined: 22 Dec 2020
Posts: 36

PostPosted: Mon Apr 19, 2021 12:18 am    Post subject: Reply with quote

Sorry eccerr0r, I misunderstood. The i7 isn't doing too much else at the same time and I/O overhead isn't very heavy, but I didn't check to see if that particular thread is hitting 100% but I guess that is possible for the core being used for the single core check. The Core2 Duo is just a standard old 2 core T7250 CPU.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9690
Location: almost Mile High in the USA

PostPosted: Mon Apr 19, 2021 2:34 am    Post subject: Reply with quote

T7250 is 2GHz 2C2T for reference.

Yes this should be slower for all intents and purposes unless you were running instruction level (versus processor virtualization) emulation on the i7. I don't even think instruction optimization would make much of a difference either. However disk i/o through the emulator could be very expensive and that may explain the difference.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Kellerkalt
n00b
n00b


Joined: 22 Dec 2020
Posts: 36

PostPosted: Mon Apr 19, 2021 3:19 am    Post subject: Reply with quote

Thanks for the insight eccerr0r. I guess I'll chalk it up to a win at the finish line for the old Core2 Duo!
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 727
Location: /home

PostPosted: Mon Apr 19, 2021 4:56 am    Post subject: Reply with quote

Swith to git syncing,
Code:

[DEFAULT]
main-repo = gentoo

[gentoo]
location = /var/db/repos/gentoo
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo
auto-sync = true
sync-depth=1
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9690
Location: almost Mile High in the USA

PostPosted: Mon Apr 19, 2021 7:03 am    Post subject: Reply with quote

hold on, before giving the c2d a win, do some disk i/o benchmarks on both systems. if the i7 still comes out on top, then there's still something wrong...
I don't have much experience with vm's running on my i7, but definitely notice a bit of disk speed penalty on the VM's running on my core2 machine. I still don't think it should totally explain why it's horribly slow, however...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Kellerkalt
n00b
n00b


Joined: 22 Dec 2020
Posts: 36

PostPosted: Mon Apr 19, 2021 12:41 pm    Post subject: Reply with quote

Juippisi - I'm rsyncing only one machine on the network externally and then the rest of them are rsycning from that machine as the local mirror. I get added to the ban list If I don't do this. Thanks for the git mirror though, it's nice to have another external mirror to point to and I wasn't aware of this one.

eccerr0r - I'll test the disk i/o, but I failed to mention that the Core2Duo laptop has an SSD and the i7 is a standard platter hard drive (and only 7200 RPM) at that. Maybe that would explain the difference in speed?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Apr 19, 2021 2:24 pm    Post subject: Reply with quote

You could turn off tree verification. That's what I do to speed up "emerge --sync":

See: https://forums.gentoo.org/viewtopic-p-8358476.html#8358476
Back to top
View user's profile Send private message
gabrielg
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2012
Posts: 134

PostPosted: Mon Apr 19, 2021 2:55 pm    Post subject: Reply with quote

As it was suggested, I would try to defragment /var/db/repos and see if performance improves.
While by no means I am recommending to rethink your fs, I can tell you that my verification speed went down considerably when I migrated from a RAID 10 md ext4 to a RAID 10 btrfs one, perhaps partly because of lack of fragmentation and some speed gains due to compression (so, more data for less IO).
Ultimately, if this bothers you too much, you could switch to git/turn off verification, as it was suggested as well.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 857

PostPosted: Mon Apr 19, 2021 3:30 pm    Post subject: Reply with quote

Is git syncing that much faster than rsync?
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Apr 19, 2021 4:15 pm    Post subject: Reply with quote

jesnow wrote:
Is git syncing that much faster than rsync?

It's not a problem with rsync. It's a problem with tree verification.

Gentoo developers chose the wrong algorithm. They create a subdirectory (/var/db/repos/gentoo/.tmp-unverified-download-quarantine), and in that subdirectory, they create 160.000 (!) hard links. That takes time of you don't have a lightning-fast file system…
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9690
Location: almost Mile High in the USA

PostPosted: Mon Apr 19, 2021 4:31 pm    Post subject: Reply with quote

Kellerkalt wrote:
eccerr0r - I'll test the disk i/o, but I failed to mention that the Core2Duo laptop has an SSD and the i7 is a standard platter hard drive (and only 7200 RPM) at that. Maybe that would explain the difference in speed?


Finally the revelation. YES THIS IS 100% the reason.

All my "rust spinners" (AKA mechanical hard drives - platters coated with oxides of cobalt or other ferromagnetic compound) take a long time on both the creation of the quarantine and the signature check. Also note that the copy back of the quarantine after it passes signature check happens also takes a long time. This totally explains why it takes so long.

SSD based machines I have are MUCH faster regardless of the CPU. Even my Atom, the slowest computer I update, is fairly snappy at the quarantine and signature checks because it has a SSD.

Switching over to git *may* help as it doesn't do the quarantine and signature check is inherent in the "log". However for the rsync method, the quarantine and the signature check are thousands of random i/o. SSDs excel at random i/o, and thus makes a huge difference.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21703

PostPosted: Mon Apr 19, 2021 5:17 pm    Post subject: Reply with quote

Although it would add complexity, if you have the free memory for it, you might get a major boost by changing your sync process to be:
  • Copy /usr/portage into a tmpfs.
  • Sync and perform tree verification with that tmpfs as your $PORTDIR.
  • On successful sync, rsync that tmpfs back to your persistent storage.
This will allow all the hardlinking to be done in a tmpfs, which should be quite cheap.
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Tue Apr 20, 2021 9:44 am    Post subject: Reply with quote

Another approach: use the portage squashfs snapshots. There's only one file with a single sha512sum, and a single GPG signature to verify. Conversely, only one update a day, and it's not part of emerge --sync / emaint sync.
_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum