Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Speeding up portage with cdb -- UPDATE
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
cazort
Guru
Guru


Joined: 19 Sep 2004
Posts: 343
Location: Lancaster, PA

PostPosted: Fri Mar 24, 2006 3:42 am    Post subject: Reply with quote

OK...what I don't understand is why this has been known for well over a year, and yet, it's not integrated into the basic portage yet, whereas developers have engaged (and succesfully, with beautiful results) in much bigger, more complex projects such as the kde split ebuilds.

Why can't this be integrated into the main portage tree? I'm a little bit reluctant to use something like this that is still experimental and "unsupported" on a production server...and yet on this very server it takes FOREVER to emerge sync...really ridiculous. It's taking almost an hour, and using most of the server's resources, on a celeron-2.0ghz machine.

I dunno? It just seems like...this should be integrated into the main portage thing? Portage just keeps getting slower and slower as it grows...and this "solution" remains unsupported and out of the mainstream.

Is there something holding it back?
_________________
Alex Zorach | Teacology | RateTea | Why This Way
Back to top
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Fri Mar 24, 2006 7:25 am    Post subject: Reply with quote

cazort wrote:
Is there something holding it back?
http://gentoo-wiki.com/TIP_speed_up_portage_with_cdb#Why_NO_cdb.3F
Back to top
View user's profile Send private message
cazort
Guru
Guru


Joined: 19 Sep 2004
Posts: 343
Location: Lancaster, PA

PostPosted: Wed Mar 29, 2006 4:50 pm    Post subject: Reply with quote

Ok...read that part...damn...hmm...

There has to be a way around this? Obviously, we are lightyears ahead of many other OS's, especially a particular one that is not worthy of being named. However...we need to think up a creative solution. Portage keeps growing...the rate at which it is slowing down seems to be exceeding the rate at which the hardware is getting faster. Portage used to sync faster on my old boxes than it does on my newer one now...and like I said, the sync speed is so slow as to make the system unusable.

What other options are there?

Here's a really simple solution (feel free to point out my stupidity if there is a basic reason why it wouldn't work):

Anything that depends on the external module written in C, it could run as a separate process? This is how most UNIX applications work anyway. What would be the problem with that? If it segfaults, then it would not segfault the portage process. You could then write error-handling code to fall back on a safer mechanism in the case that the database part of it broke. It seems like all this would not be terribly difficult to do either.

Am I missing something?
_________________
Alex Zorach | Teacology | RateTea | Why This Way
Back to top
View user's profile Send private message
cazort
Guru
Guru


Joined: 19 Sep 2004
Posts: 343
Location: Lancaster, PA

PostPosted: Wed Mar 29, 2006 4:54 pm    Post subject: Reply with quote

maybe I just need to play around with 2.1...it seems that maybe they've solved the speed problem some other way?

:-)
_________________
Alex Zorach | Teacology | RateTea | Why This Way
Back to top
View user's profile Send private message
wah
Guru
Guru


Joined: 25 Feb 2005
Posts: 453
Location: Raleigh, NC, USA

PostPosted: Wed Mar 29, 2006 6:43 pm    Post subject: Reply with quote

Just a "hey, I like it" post:

Pre-cdb:
Code:

belisarius ~ # time emerge -s mozilla > /dev/null

real    0m2.844s
user    0m1.956s
sys     0m0.216s


Post-cdb, 3 instances:
Code:

belisarius ~ # time emerge -s mozilla > /dev/null

real    0m1.113s
user    0m0.984s
sys     0m0.076s

belisarius ~ # time emerge -s mozilla > /dev/null

real    0m1.113s
user    0m0.964s
sys     0m0.100s

belisarius ~ # time emerge -s mozilla > /dev/null

real    0m1.073s
user    0m0.912s
sys     0m0.112s

Tested on a Dell D600 Pentium-M 1.6Ghz, 1GB RAM
Thanks! Can't wait to put this on some of my older b0xen!

Cheers,
Wah
_________________
- AMD64 3000+, MSI K8N-SLI, Nvidia Geforce 6600 PCIE, 2GB OCZ Dual-Channel PC3200,2x160GB SATA
- Registered Linux User #418541
Back to top
View user's profile Send private message
binaural
Tux's lil' helper
Tux's lil' helper


Joined: 02 Dec 2004
Posts: 138

PostPosted: Tue Apr 04, 2006 11:29 pm    Post subject: Reply with quote

I'm with wahman... this really kicks ass, it's pretty much the standard "Thing I do for all my gentoo boxes" now
_________________
Happy vimming!
Back to top
View user's profile Send private message
behd
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 155

PostPosted: Tue Apr 11, 2006 8:15 am    Post subject: Reply with quote

w0000t... well done, great job !

another satisfied customer :P

(only downside, being a hypothetically risk of segfault once in a while ?!?
with all the time saved by your code, I could probably afford this risk, and
spend a bit time if it ever happen).
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Tue Apr 11, 2006 12:03 pm    Post subject: Reply with quote

behd wrote:
w0000t... well done, great job !

another satisfied customer :P

(only downside, being a hypothetically risk of segfault once in a while ?!?
with all the time saved by your code, I could probably afford this risk, and
spend a bit time if it ever happen).


Been using this lil' workaround for months now, no segfaults.... no problems.
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Fri May 05, 2006 1:04 pm    Post subject: Reply with quote

Hmm, on one system, it works well, but on another system, I always get:

Code:

gollum ~ # emerge metadata
skipping sync

>>> Updating Portage cache:   93%
!!! Failed to open the dbmodule for eclass caching.
!!! Generally these are permission problems. Caught exception follows:
!!! (2, 'No such file or directory')
!!! Dirname:  /var/cache/edb/dep//usr/portage/
!!! Basename: x11-misc-eclass


What's going wrong here?
_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Fri May 05, 2006 4:53 pm    Post subject: Reply with quote

Code:
emerge metadata

====================================
Error: Failed to import module 'portage_db_cdb.database'

  File "/usr/lib/portage/pym/portage.py", line 1386, in load_best_module
    mod = load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 145, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 17, in ?
    import portage_db_template
No module named portage_db_template
====================================


What have I done wrong??
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Fri May 05, 2006 4:57 pm    Post subject: Reply with quote

Did you create /usr/lib/portage/pym/portage_db_cdb.py? Do you have portage 2.1 (if yes: http://gentoo-wiki.com/TIP_speed_up_portage_with_cdb)?
_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
optiluca
Guru
Guru


Joined: 16 Jan 2006
Posts: 545
Location: Rivergaro, Italy

PostPosted: Fri May 05, 2006 5:18 pm    Post subject: Reply with quote

portage-2.1_pre10-r2...
And it ISN'T fast...
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Sat May 06, 2006 4:46 am    Post subject: Reply with quote

I get the same error as optiluca with portage-2.1_pre10-r3.
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Mon May 08, 2006 1:07 pm    Post subject: Reply with quote

Eix does not work when I set cdb in eixrc. Is there a known workaround for this? It just does not show any result from the portage directory... only from the overlays, which are not cached.
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
appro
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2003
Posts: 144
Location: Germany/Rosenheim

PostPosted: Thu May 11, 2006 11:55 am    Post subject: Reply with quote

https://bugs.gentoo.org/show_bug.cgi?id=132915
_________________
If a packet hits a pocket on a socket on a port, and the bus is interrupted and the interrupt's not caught, then the socket packet pocket has an error to report.
Back to top
View user's profile Send private message
Phlogiston
Veteran
Veteran


Joined: 27 Jan 2004
Posts: 1925
Location: Europe, Swizerland

PostPosted: Fri May 12, 2006 11:56 am    Post subject: Reply with quote

appro wrote:
https://bugs.gentoo.org/show_bug.cgi?id=132915


Thanks but :(
_________________
Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor
Back to top
View user's profile Send private message
langec
n00b
n00b


Joined: 10 Dec 2004
Posts: 21
Location: Bremen, Germany

PostPosted: Sun May 14, 2006 4:41 pm    Post subject: Thanks! Reply with quote

Thanks a lot for that speedup! :)
Back to top
View user's profile Send private message
Autie
Guru
Guru


Joined: 25 Jul 2003
Posts: 309
Location: Ledegem - Belgium

PostPosted: Sat Jun 10, 2006 9:08 pm    Post subject: Reply with quote

Changed as the bug said:
Code:
 * Running emerge --sync ...

====================================
Error: Failed to import module 'portage_db_cdb.database'

  File "/usr/lib/portage/pym/portage.py", line 1418, in load_best_module
    mod = load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 145, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 17, in ?
    import portage_db_template
No module named portage_db_template
====================================

 * Problems running emerge --sync                                         [ !! ]

====================================
Error: Failed to import module 'portage_db_cdb.database'

  File "/usr/lib/portage/pym/portage.py", line 1418, in load_best_module
    mod = load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 145, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 17, in ?
    import portage_db_template
No module named portage_db_template
====================================


====================================
Error: Failed to import module 'portage_db_cdb.database'

  File "/usr/lib/portage/pym/portage.py", line 1418, in load_best_module
    mod = load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 145, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 17, in ?
    import portage_db_template
No module named portage_db_template
====================================


====================================
Error: Failed to import module 'portage_db_cdb.database'

  File "/usr/lib/portage/pym/portage.py", line 1418, in load_best_module
    mod = load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 145, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 17, in ?
    import portage_db_template
No module named portage_db_template
====================================


Really dunno how to fix this :?
_________________
The capacity to learn is a gift; The ability to learn is a skill; The willingness to learn is a choice.
Back to top
View user's profile Send private message
theoakwise
n00b
n00b


Joined: 15 May 2004
Posts: 37

PostPosted: Sun Jun 11, 2006 5:56 pm    Post subject: Reply with quote

Autie wrote:
Changed as the bug said:
<snip>
Really dunno how to fix this :?


See this post
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Mon Jun 12, 2006 11:56 am    Post subject: Reply with quote

Guh.... back to slow portage again... anyway this could be re-written?
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
monkey prince
n00b
n00b


Joined: 12 Jun 2006
Posts: 2

PostPosted: Mon Jun 12, 2006 12:29 pm    Post subject: Reply with quote

check out the wiki for cdb and portage:

http://gentoo-wiki.com/TIP_speed_up_portage_with_cdb

i had the same error messages until i changed my /etc/portage/modules to say
Code:
portdbapi.auxdbmodule = cache.cdb.database
eclass_cache.dbmodule = cache.cdb.database


which is what the wiki suggests. after that, i did the etc-update, emerge --sync, etc with no issues.

hope that helps.
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Mon Jun 12, 2006 12:54 pm    Post subject: Reply with quote

Doesn't seem to be helping:

Code:
surfer src # emerge --metadata

====================================
Error: Failed to import module 'cache.cdb.database'

  File "/usr/lib/portage/pym/portage.py", line 1418, in load_best_module
    mod = load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 145, in load_mod
    mod = __import__(modname)
No module named cdb
====================================

surfer src # cat /etc/portage/modules
portdbapi.auxdbmodule = cache.cdb.database
eclass_cache.dbmodule = cache.cdb.database
surfer src #

_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
Bigun
Advocate
Advocate


Joined: 21 Sep 2003
Posts: 2196

PostPosted: Mon Jun 12, 2006 12:56 pm    Post subject: Reply with quote

Nevermind:

Somehow I this file had gotten deleted or just wasn't created somehow... I dunno, I got it from the wiki link above:

/usr/lib/portage/pym/cache/cdb.py
_________________
"It's ok, they might have guns but we have flowers." - Perpetual Victim
Back to top
View user's profile Send private message
chl
n00b
n00b


Joined: 13 May 2003
Posts: 72
Location: Munich

PostPosted: Wed Dec 20, 2006 5:31 am    Post subject: Reply with quote

I use the cdb-caching method for a long time.

But since portage 2.1.1 became stable, when syncing or updating the cache with "emerge --metadata" the "Updating Portage cache: " part has become significally slower.

Under portage 2.1 the update of the cache from 0% to 100% took just a few seconds, even if I hadn't synced for a long time. But with portage 2.1.1 it takes up to five minutes.

Even if I run "emerge --metadata" several times, the second and further runs take as long as the first one. This happens also, if I disable the cdb-caching.

This is perfectly reproducible. If I downgrade to portage 2.1-r2 it runs like hell, but with the actual stable version (2.1.1-r2) it's slow as a snail.

What are the reasons and is there any possibility to have the old speed also with portage 2.1.1?

CHL
_________________
The difficulty in designing something completely foolproof, is not to underestimate the ingenuity of complete fools.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Dec 20, 2006 5:52 am    Post subject: Reply with quote

I haven't used the cdb-caching method, although this topic made me want to- until I read the last page! I agree about the speed of portage cache updates; it's definitely got a lot slower.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Page 9 of 10

 
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