Limiting Portage Bandwidth

= Introduction =

Limiting the bandwidth used by Portage may be helpful if Portage's network traffic slows down network usage for other computers on your LAN, or limits the bandwidth for other applications running on your system.

As opposed to other methods [1], the method below avoids editing the /etc/make.globals file, which may get over-written when the 'portage' package is updated.

Similarly, the method below also avoids using /etc/make.conf to completely overwrite variables that are defined in /etc/make.globals. The problem with using make.conf to overwrite make.global variables is that if the make.global variables are updated when a newer version of 'portage' is installed, then make.conf will not be using these updates.

[1]

http://bugs.gentoo.org/show_bug.cgi?id=13305

http://judepereira.com/blog/managing-your-gentoo-sort-of-easily-tips-and-more/

http://forums.gentoo.org/viewtopic-t-793683-start-0.html

http://www.gentoo-wiki.info/TIP_Gentoo_for_dialup_users#Bandwidth_Limiting

= Solution =

Instead, the method below simply appends the bandwidth-limiting text to the end of the appropriate make.global variables. These are the lines to add to your /etc/make.conf file:

PORTAGE_RSYNC_OPTS="${PORTAGE_RSYNC_OPTS} --bwlimit=20" FETCHCOMMAND="${FETCHCOMMAND} --limit-rate=20k" RESUMECOMMAND="${RESUMECOMMAND} --limit-rate=20k" FETCHCOMMAND_RSYNC="${FETCHCOMMAND_RSYNC} --bwlimit=20" RESUMECOMMAND_RSYNC="${RESUMECOMMAND_RSYNC} --bwlimit=20"
 * 1) Limit rsync speed for "emerge --sync"
 * 1) Limit wget speed for the package downloading (when emerging a package)
 * 1) Limit rsync speed for the package downloading (when emerging a package)