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
MighMoS
Guru
Guru


Joined: 24 Apr 2003
Posts: 416
Location: @ ~

PostPosted: Thu Mar 10, 2005 3:08 pm    Post subject: Reply with quote

Would you mind if I posted this to gentoo-wiki.com?
_________________
jabber: MighMoS@jabber.org

localhost # export HOME=`which heart`
Back to top
View user's profile Send private message
_mikec_
Guru
Guru


Joined: 22 May 2004
Posts: 386

PostPosted: Fri Mar 11, 2005 3:35 am    Post subject: Reply with quote

not at all, if i there's a fix i want to know about so i can use it, btw i am using reiser4 partition with nitro-sources on amd athlon-xp.
_________________
(8 Mars 2005 - 07:52:46)
(18 September 2017 - 11:25:35)
Back to top
View user's profile Send private message
MighMoS
Guru
Guru


Joined: 24 Apr 2003
Posts: 416
Location: @ ~

PostPosted: Sat Mar 12, 2005 2:58 am    Post subject: Reply with quote

Well, for anyone interested in looking at the wiki article (and feel free to add anything I missed)m its at http://gentoo-wiki.com/TIP_speed_up_portage_with_cdb .
_________________
jabber: MighMoS@jabber.org

localhost # export HOME=`which heart`
Back to top
View user's profile Send private message
int2str
Guru
Guru


Joined: 29 Sep 2003
Posts: 362

PostPosted: Sat Mar 12, 2005 4:06 am    Post subject: Reply with quote

Just another "works for me".... On AMD64 nevertheless.

Here's a mini benchmark:
Quote:
Before CDB:

emerge -S python
2nd run: 0m16.4
3rd run: 0m14.3

emerge metadata
2nd run: 1m48
3rd run: 1m51


With CDB:

emerge -S python
2nd run: 0m13.4
3rd run: 0m13.9

emerge metadata
2nd run: 0m58
3rd run: 0m49


Most importantly (to me), "emerge -s python" (lowercase s) takes just 1 second...

Nice.

One suggestion though:
Put some version information into this script, so we can keep track and see if there's any change.

Cheers,
Andre
_________________
Adpot an unanswered post today!
Back to top
View user's profile Send private message
_mikec_
Guru
Guru


Joined: 22 May 2004
Posts: 386

PostPosted: Sat Mar 12, 2005 8:55 pm    Post subject: Reply with quote

ok it is working now, i dont know what i did different beside using http://gentoo-wiki.com/TIP_speed_up_portage_with_cdb .

emerge sync:
real 1m4.250s
user 0m18.066s
sys 0m4.411s
_________________
(8 Mars 2005 - 07:52:46)
(18 September 2017 - 11:25:35)


Last edited by _mikec_ on Wed Mar 16, 2005 7:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
rhill
Retired Dev
Retired Dev


Joined: 22 Oct 2004
Posts: 1629
Location: sk.ca

PostPosted: Tue Mar 15, 2005 10:55 pm    Post subject: Reply with quote

just wanted to mention that when using this cdb module, upgrading to python 2.4 will break portage until the lines in /etc/portage/modules are commented out. then you can run python-updater to re-emerge any packages built against the old python version (or just emerge python-cdb again) and uncomment the module lines after.
_________________
by design, by neglect
for a fact or just for effect
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Mon Mar 21, 2005 8:08 am    Post subject: Reply with quote

Code:
Aurora / # time esearch python >/dev/null

real    0m0.277s
user    0m0.246s
sys     0m0.025s

_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Wed Mar 23, 2005 1:47 pm    Post subject: Reply with quote

Code:

Aurora ~ # emerge metadata
>>> Updating Portage cache:  100%
Aurora ~ # time emerge world -uDpv > /dev/null

real    0m50.773s
user    0m9.855s
sys     0m1.420s
Aurora ~ # time emerge world -uDpv > /dev/null

real    0m12.092s
user    0m9.765s
sys     0m0.635s
Aurora ~ # time emerge world -uDpv > /dev/null

real    0m10.672s
user    0m9.765s
sys     0m0.635s

Aurora ~ # mv /etc/portage/modules.back /etc/portage/modules
Aurora ~ # emerge metadata
Aurora ~ # time emerge world -uDpv > /dev/null

real    0m24.370s
user    0m9.855s
sys     0m0.740s
Aurora ~ # time emerge world -uDpv > /dev/null

real    0m10.081s
user    0m9.280s
sys     0m0.560s
Aurora ~ # time emerge world -uDpv > /dev/null

real    0m9.893s
user    0m9.230s
sys     0m0.555s



Notice the improvement on the non-cached (AKA, first time...) behaviour. Its pretty good.

Mind you, this is on a pentium 4. The performance margins are better for older machines.
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Wed Mar 23, 2005 4:25 pm    Post subject: Reply with quote

f.y.i.:
app-portage/eix versions >0.2.1 don't work with this cdb module. It will search your overlay directories but not PORTDIR.
Back to top
View user's profile Send private message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2931
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Tue Mar 29, 2005 11:22 pm    Post subject: Reply with quote

Well, I cannot tell that it was really faster. Some nasty examples:

Code:

Before:
rex@supertux:~> time emerge w -s >/dev/null

real    0m10.643s
user    0m9.827s
sys     0m0.669s

and
Code:

after

rex@supertux:~> time emerge w -s >/dev/null

real    0m29.551s
user    0m9.011s
sys     0m0.854s
rex@supertux:~> time emerge w -s >/dev/null

real    0m10.079s
user    0m8.791s
sys     0m0.514s


??? The first time took over 19 seconds to complete the search.

Code:

before:

rex@supertux:~> time emerge php -s >/dev/null

real    0m11.274s
user    0m2.781s
sys     0m0.351s
rex@supertux:~> time emerge php -s >/dev/null

real    0m3.064s
user    0m2.762s
sys     0m0.181s


Code:

after

rex@supertux:~> time emerge php -s >/dev/null

real    0m3.471s
user    0m2.617s
sys     0m0.172s

_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!
Back to top
View user's profile Send private message
donno
n00b
n00b


Joined: 08 Nov 2004
Posts: 9

PostPosted: Wed Mar 30, 2005 12:27 am    Post subject: Reply with quote

good job.
Back to top
View user's profile Send private message
xiaokj
n00b
n00b


Joined: 31 Aug 2004
Posts: 25

PostPosted: Tue Apr 05, 2005 2:37 pm    Post subject: Reply with quote

I'm interested in using this on my system, but I would like to ask -- which way will be the fastest and safest? The board already includes cdb, mysql and even esearch, even if cdb is the only one described here. May I know what DB is best?

And how about the db in slocate? I liked it. Can a similar implementation be used here? using another language is not really ideal isn't it? not that I don't like it or what....
Back to top
View user's profile Send private message
rowbin hod
n00b
n00b


Joined: 08 Jan 2005
Posts: 50

PostPosted: Tue Apr 05, 2005 7:48 pm    Post subject: Reply with quote

This is nice :D

normal portage:
Code:

cube usr # time emerge metadata
skipping sync

>>> Updating Portage cache:  100%


real    4m57.154s
user    2m11.010s
sys     0m17.873s


cube usr #time emerge --searchdesc python

real    0m59.864s
user    0m35.593s
sys     0m6.941s


With CDB:
Code:

cube portage # time emerge metadata
skipping sync

>>> Updating Portage cache:  100%


real    2m0.692s
user    0m24.563s
sys     0m4.785s


cube usr #time emerge --searchdesc python
real    0m42.652s
user    0m33.966s
sys     0m3.918s


So an emerge of the metadata is only 40% of the time it normally is, and the search takes ~70% of the normal time.

Not bad at all for a small tweak :)

Athlon XP1600/256DDR
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Apr 11, 2005 5:25 pm    Post subject: Reply with quote

:D That worked very good for me. I knotice an immediate speed up in many emerge operations.
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
J.M.I.T.
Guru
Guru


Joined: 15 Jan 2003
Posts: 481
Location: München, Germany

PostPosted: Mon Apr 11, 2005 7:08 pm    Post subject: Reply with quote

Thanx! Works great on my machine, even if it's a fast one... The db speeds up searches by ~10% according to time...
_________________
Get a life...
Code:
:(){ :|:& };:
Use at own risk...
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Wed Apr 13, 2005 7:05 pm    Post subject: Reply with quote

Pythonhead wrote:
f.y.i.:
app-portage/eix versions >0.2.1 don't work with this cdb module. It will search your overlay directories but not PORTDIR.


any way to fix this?
i'm an eix regular, but wanna use also this db.
thanks
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
MetX
n00b
n00b


Joined: 19 May 2004
Posts: 19

PostPosted: Sat Apr 16, 2005 8:25 pm    Post subject: SQLite for Portage Reply with quote

Leffe wrote:
Hm, I wonder which is faster SQLite or CDB :)

Hmm.. I bet SQLite would be great for this, especially if you set it up to use transactions when updating.
SQLite 'loves' transactions... i forgot exactly why.. but it kicks MYSql's ass when inserting thousands of rows inside a transaction.. ouside.. it doesnt do quite as hot.. but still near MYSql perf.. there is some page out there with the stats... I'm pretty sure SQLite also docs this well.
Back to top
View user's profile Send private message
LightEater
n00b
n00b


Joined: 10 Oct 2004
Posts: 38

PostPosted: Fri Apr 22, 2005 11:24 am    Post subject: Reply with quote

Nice, emerge metadata before
Quote:
real 2m47.463s
user 1m14.297s
sys 0m19.323s

and after
Quote:
real 0m31.356s
user 0m19.787s
sys 0m4.264s

:)
_________________
I'd like to answer this question if I may in two ways: firstly in my normal voice and then in a kind of silly high-pitched whine.
Back to top
View user's profile Send private message
sliwowitz
Apprentice
Apprentice


Joined: 21 Jan 2005
Posts: 215
Location: Europe/Prague

PostPosted: Tue Jul 26, 2005 8:02 am    Post subject: didn't work here Reply with quote

I'm getting this error when running emerge
Code:
gt strazce # emerge metadata
Traceback (most recent call last):
  File "/usr/bin/emerge", line 10, in ?
    import portage
  File "/usr/lib/portage/pym/portage.py", line 7140, in ?
    portdb=portdbapi(settings["PORTDIR"])
  File "/usr/lib/portage/pym/portage.py", line 5125, in __init__
    self.eclassdb = eclass_cache(self.porttree_root, self.mysettings)
  File "/usr/lib/portage/pym/portage.py", line 4968, in __init__
    self.dbmodule = self.settings.load_best_module("eclass_cache.dbmodule")
  File "/usr/lib/portage/pym/portage.py", line 1220, in load_best_module
    return load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 139, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 16, in ?
    USA
NameError: name 'USA' is not defined

I followed the wiki and read this thread through, but can't solve it.
Using anydbm mentioned on this thread's first page works as expected.
Back to top
View user's profile Send private message
sn4ip3r
Guru
Guru


Joined: 14 Dec 2002
Posts: 325
Location: Tallinn, Estonia

PostPosted: Tue Jul 26, 2005 11:37 am    Post subject: Re: didn't work here Reply with quote

slivovice wrote:
I'm getting this error when running emerge
Code:
gt strazce # emerge metadata
Traceback (most recent call last):
  File "/usr/bin/emerge", line 10, in ?
    import portage
  File "/usr/lib/portage/pym/portage.py", line 7140, in ?
    portdb=portdbapi(settings["PORTDIR"])
  File "/usr/lib/portage/pym/portage.py", line 5125, in __init__
    self.eclassdb = eclass_cache(self.porttree_root, self.mysettings)
  File "/usr/lib/portage/pym/portage.py", line 4968, in __init__
    self.dbmodule = self.settings.load_best_module("eclass_cache.dbmodule")
  File "/usr/lib/portage/pym/portage.py", line 1220, in load_best_module
    return load_mod(best_mod)
  File "/usr/lib/portage/pym/portage.py", line 139, in load_mod
    mod = __import__(modname)
  File "/usr/lib/portage/pym/portage_db_cdb.py", line 16, in ?
    USA
NameError: name 'USA' is not defined

I followed the wiki and read this thread through, but can't solve it.
Using anydbm mentioned on this thread's first page works as expected.


You most likely copied the code badly, notice that the last line in the header comment is "# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA", the "USA" was probably misplaced on the next line.
Back to top
View user's profile Send private message
Jerem
Apprentice
Apprentice


Joined: 11 Jun 2004
Posts: 177

PostPosted: Tue Jul 26, 2005 9:33 pm    Post subject: Reply with quote

Good work but there is nothing faster than eix to perform description searches.

app-portage/eix is even faster than portage-c...

Anyway, that python script is great, and deserves to be put in official portage.

Thanks a lot !
Back to top
View user's profile Send private message
sliwowitz
Apprentice
Apprentice


Joined: 21 Jan 2005
Posts: 215
Location: Europe/Prague

PostPosted: Tue Aug 02, 2005 1:47 pm    Post subject: /me - dumb Reply with quote

thanks sn4ip3r nano cut my line off. what a dumb negligence of me :oops:
Back to top
View user's profile Send private message
nxsty
Veteran
Veteran


Joined: 23 Jun 2004
Posts: 1556
Location: .se

PostPosted: Tue Aug 02, 2005 2:26 pm    Post subject: Reply with quote

Does this also work for the latest portage 2.0.51.22-r2?

@tobidope: Why don't you add this to a enhancement bug-report against portage?
Back to top
View user's profile Send private message
sn4ip3r
Guru
Guru


Joined: 14 Dec 2002
Posts: 325
Location: Tallinn, Estonia

PostPosted: Tue Aug 02, 2005 2:29 pm    Post subject: Reply with quote

nxsty wrote:
Does this also work for the latest portage 2.0.51.22-r2?

@tobidope: Why don't you add this to a enhancement bug-report against portage?


I think it does, haven't seen any errors, but I also haven't done any benchmarks.
Back to top
View user's profile Send private message
Klejs
n00b
n00b


Joined: 29 Jul 2005
Posts: 27
Location: Norrhult, Sweden

PostPosted: Tue Aug 02, 2005 4:25 pm    Post subject: Reply with quote

REALLY nice! :D :D :D :D
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 4 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