View previous topic :: View next topic |
Author |
Message |
FonderiaDigitale Veteran


Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Sat May 15, 2004 9:00 am Post subject: [HowTo] Velocizzare download in emerge:Axel e mirrorselect |
|
|
EDIT: (15-05-2004) aggiunto tip per mirrorselect, ripulito un po'.
EDIT: (23-05-2004) aggiunto esempio di file di configurazione per axel
- Probabilmente sarete insoddisfatti di wget per scaricare i pacchetti durante i merge.
- Eventualmente molti di voi non hanno la fibra di fastweb e vogliono ottimizzare al meglio la banda che usano.
- Sicuramente i piu' smaliziati di voi avranno capito che, anche se usano prozilla per il download, questo apre diverse connessioni si, ma alla stessa fonte: cosa abbastanza inutile, visto che in questo modo, se un sito va offline, non funziona piu' nulla.
- Per di piu', tanti di noi saranno stanchi di aver talvolta iniziato dei lunghi merging di un treno di pacchetti, per vederselo interrompere da una fonte non disponibile!
- A volte capita che usando ~x86, in alcuni mirror non siano ancora disponibili i tarball dei sorgenti dei pacchetti. Questo sistema risolve anche questa eventualita'
Ecco che allora entra in gioco axel: e' un download manager come gli altri, ma e' leggero e pare nato apposta per portage.
Come funziona: una volta che voi iniziate il download, axel cerca altri mirror, anche fuori da quelli specificati in emerge, per il dato file, e ne spezza lo scaricamento.
Questo meccanismo e' efficientissimo nei merge di pacchetti grossi (come kernel, openoffice, xfree, gcc), un po' meno per pacchetti molto piccoli.
Personalmente lo uso non tanto per portare all'estremo l'uso della banda, quanto per la ridondanza (se una fonte non funziona, ne cerca un'altra)
Usare axel al posto di wget per scaricare i files
Code: | emerge axel
nano /etc/make.conf |
modificate o aggiungete queste due righe:
Code: | FETCHCOMMAND="/usr/bin/axel -a -S10 \${URI} -o \${DISTDIR}"
RESUMECOMMAND="/usr/bin/axel -a -S10 \${URI} -o \${DISTDIR}"
|
Quello che segue e' un file di configurazione, /etc/axelrc, necessario per evitare che alcuni download si inchiodino quando le fonti non sono disponibili o sono lente.
Quello che includo vale per una connessione di 640k/1mbit circa, ma adattatelo alle vostre esigenze se credete (facendo delle prove); per i significati delle variabili, vedete il file di configurazione originale.
Code: | reconnect_delay = 5
# max_speed = 0
num_connections = 5
connection_timeout = 5
# http_proxy =
# no_proxy =
# strip_cgi_parameters = 1
# default_filename = default
# save_state_interval = 10
# verbose = 1
search_timeout = 5
search_threads = 5
search_amount = 10
search_top = 4
|
Esempio di un merge usando axel:
Code: | # emerge ngrep
Calculating dependencies ...done!
>>> emerge (1 of 1) net-analyzer/ngrep-1.41 to /
>>> Downloading http://easynews.dl.sourceforge.net/sourceforge/ngrep/ngrep-1.41.tar.bz2
Initializing download: http://easynews.dl.sourceforge.net/sourceforge/ngrep/ngrep-1.41.tar.bz2
Doing search...
Testing speeds, this can take a while...
10 usable servers found, will use these URLs:
URL Speed
ftp://ftp.uni-kl.de/pub/linux/gentoo/distfiles/ngrep-1.41.tar.bz2 854
http://easynews.dl.sourceforge.net/sourceforge/ngrep/ngrep-1.41.tar.bz 858
ftp://ftp.man.szczecin.pl/disks/disk0/gentoo/distfiles/ngrep-1.41.tar. 928
ftp://ftp.man.szczecin.pl/disks/disk0/NetBSD/packages/distfiles/ngrep- 934
ftp://ftp.man.szczecin.pl/disks/disk0/security/packet-capture/ngrep/ng 957
ftp://ftp.freenet.de/pub/.disk0/ftp.snt.utwente.nl/pub/os/linux/gentoo 1018
ftp://ftp.chg.ru/.8/sourceforge/n/ng/ngrep/ngrep-1.41.tar.bz2 1505
ftp://ftp.chg.ru/.2/Linux/gentoo/distfiles/ngrep-1.41.tar.bz2 1662
ftp://ftp.tpnet.pl/d1/ftp.pld-linux.org/distfiles/by-md5/b/9/b9bf857c6 2319
ftp://ftp.gw.com/pub/distfiles/ngrep-1.41.tar.bz2 7777
File size: 520209 bytes
Opening output file /home/portage/distfiles/ngrep-1.41.tar.bz2
Starting download
Connection 0 finished ]
Connection 2 finished ]
Connection 3 finished ]
[100%] [..................................................] [ 81.5KB/s] [00:00]
Downloaded 508.0 kilobytes in 6 seconds. (81.49 KB/s)
>>> md5 src_uri ;-) ngrep-1.41.tar.bz2
>>> Unpacking source...
[...]
|
Scegliere i mirror piu' veloci con mirrorselect
Cosa fare se le fonti per un dato file non sono poi tante o non sono disponibili?
Una opzione e' specificare dei mirror quanto piu' possibile vicini e performanti specificatamente per la connessione che usate.
Per questo usiamo mirrorselect, un programma che fa il test delle connessioni e calcola la velocita' effettiva, scegliendo il miglior mirror.
Consiglio caldamente di interrompere eventuali trasferimenti di file durante il test, altrimenti non dara' un risultato preciso.
Code: | emerge mirrorselect
mirrorselect -a -D -s3 -b10 |
.. e il gioco e' fatto. vi troverete una riga in /etc/make.conf che sara' pressapoco cosi':
Code: | GENTOO_MIRRORS="http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ http://darkstar.ist.utl.pt/gentoo/ http://ftp.easynet.nl/mirror/gentoo/" |
Questo ovviamente, funziona anche se usate il solito wget al posto di axel.
Usare il nostro server italiano:
buona norma sarebbe anche usareil nostro server rsync (forniti dal buon lcars):
Code: | SYNC="rsync://rsync1.it.gentoo.org/gentoo-portage" |
ed eventualmente, se ancora non lo avete fatto, il mirror di portage:
Code: | GENTOO_MIRRORS="http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ ...(quello che avevate prima)..." |
ricordate che la gentoo-etiquette vuole che sia buona norma syncare non piu di una volta al giorno! (Di piu', raramente serve)
ora potete emergere quello che volete. buon lavoro  _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
Last edited by FonderiaDigitale on Sun May 23, 2004 7:17 am; edited 3 times in total |
|
Back to top |
|
 |
HunterD Apprentice


Joined: 10 Mar 2004 Posts: 165
|
Posted: Sat May 15, 2004 9:20 am Post subject: |
|
|
Grazie ! Ottimo tip ! Hai risolto un problema che stavo per presentare ! Il fatto cioè che per emerge corposi ( vedi kde ) o numerosi in termini di pacchetti talvolta mi beccava dei mirror down e per forza di cose dovevo interrompere a manina e ridare l'emerge !! |
|
Back to top |
|
 |
stuart Guru


Joined: 27 Apr 2003 Posts: 552
|
Posted: Sat May 15, 2004 9:34 am Post subject: |
|
|
effettivamente risolve un bel pò di problemi in certi emerge di pacchetti non proprio diffusissimi
grazie _________________ Pochissime persone crescono. La maggior parte della gente invecchia. |
|
Back to top |
|
 |
micron Guru


Joined: 23 Jul 2003 Posts: 411 Location: Bergamo, Italy
|
Posted: Sat May 15, 2004 11:57 am Post subject: |
|
|
Ottimo tip, complimenti!
Risolve un po' di situazioni fastidiose! _________________ ~ "Progress is merely a realisation of utopias" ~ |
|
Back to top |
|
 |
Josuke Veteran


Joined: 07 May 2003 Posts: 1175 Location: Italy - Bolzano
|
Posted: Sat May 15, 2004 1:11 pm Post subject: |
|
|
ma c'è molta differenza con prozilla? _________________ fletto i muscoli...e sono nel vuoto |
|
Back to top |
|
 |
HunterD Apprentice


Joined: 10 Mar 2004 Posts: 165
|
Posted: Sat May 15, 2004 1:19 pm Post subject: |
|
|
Quote: |
Sicuramente i piu' smaliziati di voi avranno capito che, anche se usano prozilla per il download, questo apre diverse connessioni si, ma alla stessa fonte: cosa abbastanza inutile, visto che in questo modo, se un sito va offline, non funziona piu' nulla. |
Mi sembra una differenza non da poco... |
|
Back to top |
|
 |
Benve l33t


Joined: 13 Mar 2003 Posts: 897 Location: Italy Romagna
|
Posted: Sat May 15, 2004 2:23 pm Post subject: |
|
|
Mi pareva dovesse esistere un programma che facesse cio!
Grazie mille |
|
Back to top |
|
 |
Josuke Veteran


Joined: 07 May 2003 Posts: 1175 Location: Italy - Bolzano
|
Posted: Sat May 15, 2004 2:25 pm Post subject: |
|
|
si sono un monega non avevo letto bene sorry  _________________ fletto i muscoli...e sono nel vuoto |
|
Back to top |
|
 |
zUgLiO l33t


Joined: 12 Aug 2003 Posts: 754 Location: Ferrara (Italy)
|
Posted: Sat May 15, 2004 2:38 pm Post subject: |
|
|
Grande,utilissimo
P.S.
Complimenti per il nuovo avatar,è bellissimo  _________________
voglio poi dire che il tempo mi avrà fatto abituare,
ma io non trovo nemmeno brutta la stiva buia di questa nave
|
|
Back to top |
|
 |
ema Guru


Joined: 27 Aug 2003 Posts: 380
|
Posted: Sat May 15, 2004 3:28 pm Post subject: |
|
|
grande! finalmente un post chiarissimo su come usare axel in emerge!
ben fatto! |
|
Back to top |
|
 |
f0llia l33t

Joined: 22 Apr 2003 Posts: 873
|
Posted: Sat May 15, 2004 3:39 pm Post subject: |
|
|
Ottimo post, è utilissimo
Grazie  |
|
Back to top |
|
 |
MyZelF Bodhisattva


Joined: 25 Feb 2003 Posts: 2010 Location: Venice, Italy
|
Posted: Sat May 15, 2004 4:59 pm Post subject: |
|
|
Tip AWARD!  _________________ "Larry the Cow was a bit frustrated at the current state of Linux Distributions..." |
|
Back to top |
|
 |
FonderiaDigitale Veteran


Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Sat May 15, 2004 7:46 pm Post subject: |
|
|
Grazie
per l'occasione, ho aggiunto due righe su come usare mirrorselect. _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
 |
FonderiaDigitale Veteran


Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Sun May 23, 2004 7:18 am Post subject: |
|
|
aggiornato di nuovo, con /etc/axelrc incluso. _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
 |
fabel n00b

Joined: 27 Jun 2004 Posts: 6
|
Posted: Sun Jun 27, 2004 2:34 pm Post subject: Re: [HowTo] Velocizzare download in emerge:Axel e mirrorsele |
|
|
Quote: | modificate o aggiungete queste due righe:
Code: | FETCHCOMMAND="/usr/bin/axel -a -S10 \${URI} -o \${DISTDIR}"
RESUMECOMMAND="/usr/bin/axel -a -S10 \${URI} -o \${DISTDIR}"
|
|
A me finche non ho modificato le 2 righe come segue:
(ignorate pure -v e -S4)
Code: |
FETCHCOMMAND="/usr/bin/axel -v -a -S4 -o \${DISTDIR}/\${FILE} \${URI}"
RESUMECOMMAND="/usr/bin/axel -v -a -S4 -o \${DISTDIR}/\${FILE} \${URI}"
|
non ha funzionato. A voi funzionava comunque? magari ho capito male qualcosa.
ciao |
|
Back to top |
|
 |
FonderiaDigitale Veteran


Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Sun Jun 27, 2004 10:55 pm Post subject: |
|
|
si, a me funziona comunque. hai fatto bene a indicarlo, in ogni caso  _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
 |
fabel n00b

Joined: 27 Jun 2004 Posts: 6
|
Posted: Mon Jun 28, 2004 9:46 pm Post subject: |
|
|
c'è qualcosa che non mi funziona nella mia installazione, capita che il download si blocca dopo la ricerca, ad esempio:
Code: |
Calculating system dependencies ...done!
>>> emerge (1 of 4) net-misc/iputils-021109-r3 to /
>>> Downloading ftp://gentoo.inode.at/source/distfiles/iputils-ss021109-try.tar.bz2
Initializing download: ftp://gentoo.inode.at/source/distfiles/iputils-ss021109-try.tar.bz2
Doing search...
Testing speeds, this can take a while...
4 usable servers found, will use these URLs:
URL Speed
ftp://gentoo.inode.at/source/distfiles/iputils-ss021109-try.tar.bz2 1295
ftp://ftp.tpnet.pl/d2/ftp.slackware.com/slackware-current/source/n/tcp 1356
ftp://ftp.tpnet.pl/d2/ftp.slackware.com/slackware-9.1/source/n/tcpip/i 1895
ftp://ftp.tpnet.pl/d1/ftp.pld-linux.org/distfiles/by-md5/d/d/dd10ef3d7 3941
|
e rimane qui indefinitivamente
le entry in make.conf
Code: |
FETCHCOMMAND="/usr/bin/axel -v -S4 -o \${DISTDIR}/\${FILE} \${URI}"
RESUMECOMMAND="/usr/bin/axel -v -S4 -o \${DISTDIR}/\${FILE} \${URI}"
|
e il file di configurazione riporta:
Code: |
reconnect_delay = 15
connection_timeout = 25
search_timeout = 5
search_threads = 3
search_amount = 15
search_top = 4
|
vi viene in mente da cosa possa dipendere? _________________ Don't throw anything out of the windows,
but throw Windows out of everything! (abel) |
|
Back to top |
|
 |
FonderiaDigitale Veteran


Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Mon Jun 28, 2004 10:37 pm Post subject: |
|
|
prova a usare axel con quelle opzioni come se fosse wget, scaricando una iso (ad esempio).... funziona? _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
 |
fabel n00b

Joined: 27 Jun 2004 Posts: 6
|
Posted: Wed Jun 30, 2004 10:16 pm Post subject: |
|
|
non ho ancora isolato il problema, per esempio oggi ha funzionato, se ricapita che si blocchi indago meglio.
ciao _________________ Don't throw anything out of the windows,
but throw Windows out of everything! (abel) |
|
Back to top |
|
 |
FonderiaDigitale Veteran


Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Wed Jun 30, 2004 10:23 pm Post subject: |
|
|
credo dipenda piu che altro dalla tua rete.
prova ad abbassare il numero di thread e ricerche contemporannee e diminuire i timeout _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
 |
Raffo Veteran


Joined: 23 Apr 2004 Posts: 1019 Location: Berlin
|
Posted: Thu Jul 01, 2004 10:42 am Post subject: |
|
|
ho provato a emergere vim e mi da questo errore: Code: | Calculating dependencies ...done!
>>> emerge (1 of 3) dev-util/ctags-5.5-r1 to /
>>> Downloading ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/distfiles/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://gentoo.tiscali.nl/gentoo/distfiles/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/distfiles/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://heanet.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://aleron.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://keihanna.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://switch.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://umn.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://cesnet.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://unc.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://easynews.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://belnet.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
>>> Downloading http://osdn.dl.sourceforge.net/sourceforge/ctags/ctags-5.5.tar.gz
Error in /etc/axelrc line 10.
!!! Couldn't download ctags-5.5.tar.gz. Aborting.
|
come lo risolvo? |
|
Back to top |
|
 |
randomaze Bodhisattva


Joined: 21 Oct 2003 Posts: 9985
|
Posted: Thu Jul 01, 2004 12:10 pm Post subject: |
|
|
Raffo wrote: | Error in /etc/axelrc line 10.
|
Direi che hai cpiato male l'axelrc suggerito da FonderiaDigitale.
Edita il file e correggi la linea 10! _________________ Ciao da me! |
|
Back to top |
|
 |
Raffo Veteran


Joined: 23 Apr 2004 Posts: 1019 Location: Berlin
|
Posted: Thu Jul 01, 2004 12:21 pm Post subject: |
|
|
randomaze wrote: | Raffo wrote: | Error in /etc/axelrc line 10.
|
Direi che hai cpiato male l'axelrc suggerito da FonderiaDigitale.
Edita il file e correggi la linea 10! |
si ma la linea 10 è questa "reconnect_delay = 5 "....nn capisco cosa ci possa essere di sbagliato.... ho provato anche a cambiare il numero, a mettere 15 o 20 al posto di 5 ma mi da sempre errore.... |
|
Back to top |
|
 |
Raffo Veteran


Joined: 23 Apr 2004 Posts: 1019 Location: Berlin
|
Posted: Thu Jul 01, 2004 6:26 pm Post subject: |
|
|
ho provato a commentare la linea 10 e così mi da errore alla linea 22. poi ho commentato la linea 22 e mi da errore alla linea 27. praticamente mi da come errate tutte le linee che nn sono commentate...qualcuno ha qualche idea? |
|
Back to top |
|
 |
raino n00b

Joined: 08 Nov 2002 Posts: 14 Location: Italy
|
Posted: Thu Jul 01, 2004 6:48 pm Post subject: |
|
|
Non ci devono essere spazi all'inizio della riga
edit: ora che guardo bene alla fine del comando prima delle " c'e uno spazio...mi sa che è quello
Almeno a me dava lo stesso errore, ho tolto lo spazio che c'era all'inizio del file di conf e ora è tutto ok...
ciao |
|
Back to top |
|
 |
|