Linux Format - UK (2019-12)

(Antfer) #1
http://www.techradar.com/pro/linux December 2019 LXF257 35

Lightweight Linux


settings. Remember however that increasing the
amount of RAM will not have any impact on the
performance of the office suite unless you are working
on a document with loads of objects.
Another frequently used app is Firefox and one of the
most common reasons for its bloat are add-ons. Add-
ons slow the browser and a malfunction in one can also
adversely affect the browser as well. So review the
number of add-ons you have installed and deactivate or
better still uninstall any add-ons you don’t need.
The browser also caches data to the disk by default,
which reduces its speed. You can increase its
performance by asking Firefox to save data to RAM
instead. In the URL bar type about:config and accept
the warning to view all the advanced settings. In the
Search bar type browser.cache.disk.enable and
double-click it to change its value to false. This stops
Firefox from writing the cache to disk. Next, type
browser.cache.memory.enable in the Search bar and
make sure the value is true to ensure that the browser
saves cache to RAM.
You’ll also have to make sure the feature has enough
RAM to cache effectively. Right-click a blank area and
head to New > Integer. Name the variable browser.
cache.memory.capacity and add an adequate cache in
kilobytes. We advise a value of 300000 (which equals
300MB), which is usually more than enough. Note that
if you don’t have much memory in the first place,
getting Firefox to grab a chunk of it for caching might
actually slow things down in the long run.

Streamlining Evolution
Another internet app that can help you save some
resources is Evolution. This email client is so tightly
integrated into some distros like Ubuntu that you’ll find
several running processes for the app, even when you
use something else like Thunderbird! Take a look
yourself. Fire up the System Monitor app, switch to the
Processes tab and search for evolution , which will
return a bunch of processes that are unnecessarily
gorging on the computer’s resources.
However, because these processes are so tightly
coupled with the desktop, uninstalling them will break
your installation. Instead a clever workaround is to take
away their execution privileges with:
sudo chmod -x /usr/lib/evolution/evolution-
addressbook-factory

sudo chmod -x /usr/lib/evolution/evolution-calendar-
factory
sudo chmod -x /usr/lib/evolution/evolution-source-
registry
If you’re feeling a little adventurous, you can tweak
the underlying filesystem to make your distro run
faster. A majority of distros use the ext4 filesystem,
which can be tweaked for performance. The journalling
file system supports three modes, with most distros
defaulting to the ordered mode that offers the best
safety-to-speed ratio. However, the Writeback mode is
the fastest, because it does the least amount of
journalling (keeping track of what file is where). This
also means that it comes with a risk of data loss in the
case of a power failure, for instance. If performance is
more important to you, then assuming your root
partition is /dev/sda1, change its mode with:
sudo tune2fs -O has_journal -o journal_data_writeback
/dev/sda1
You’ll then have to edit /etc/fstab to add a boot
option to use writeback mode. While we’re here, we’ll

add some more options to increase the performance of
the filesystem. Open the file in a text editor and find the
line that corresponds to the / partition and add the
following boot options:
data=writeback,noatime,barrier=0
We use the data=writeback option since we’ve just
changed it into the writeback journalling mode. The
noatime asks the filesystem to not log access of files
and directories. The barrier=0 option disables the write
barriers. These enforce proper on-disk ordering of
journal commits, but come at the cost of a performance
hit. Save the file and restart your computer for the
filesystem changes to take effect.

It’s a good idea to periodically defrag your EXT4 partitions with the
e4defrag utility.

Used without caution, Bleachbit can destabilise your installation. Make sure you use the Preview
button to review files before removing them for good.

WHAT’S SLOWING YOU DOWN?


“If you are on an underpowered


machine, it’s a good idea to disable


the file-indexing service.”


3332Decmbr rb2c0194b095678 December 2019LXF257 35


Lightweight Linux


settings.Rememberhoweverthatincreasingthe
amountofRAMwillnothaveanyimpactonthe
performanceoftheofficesuiteunlessyouareworking
onadocumentwithloadsofobjects.
AnotherfrequentlyusedappisFirefoxandoneofthe
mostcommonreasonsforitsbloatareadd-ons.Add-
onsslowthebrowserandamalfunctioninonecanalso
adverselyaffectthebrowseraswell.Soreviewthe
numberofadd-onsyouhaveinstalledanddeactivateor
betterstilluninstallanyadd-onsyoudon’tneed.
Thebrowseralsocachesdatatothediskbydefault,
whichreducesitsspeed.Youcanincreaseits
performancebyaskingFirefoxtosavedatatoRAM
instead.IntheURLbartypeabout:configandaccept
thewarningtoviewalltheadvancedsettings.Inthe
Searchbartypebrowser.cache.disk.enable and
double-clickittochangeitsvaluetofalse.Thisstops
Firefoxfromwritingthecachetodisk.Next,type
browser.cache.memory.enableintheSearchbarand
makesurethevalueistrue toensurethatthebrowser
savescachetoRAM.
You’llalsohavetomakesurethefeaturehasenough
RAMtocacheeffectively.Right-clickablankareaand
headtoNew>Integer.Namethevariablebrowser.
cache.memory.capacityandaddanadequatecachein
kilobytes.Weadviseavalueof 300000 (whichequals
300MB),whichisusuallymorethanenough.Notethat
ifyoudon’thavemuchmemoryinthefirstplace,
gettingFirefoxtograbachunkofitforcachingmight
actuallyslowthingsdowninthelongrun.


StreamliningEvolution
Anotherinternetappthatcanhelpyousavesome
resourcesisEvolution.Thisemailclientissotightly
integratedintosomedistroslikeUbuntuthatyou’llfind
severalrunningprocessesfortheapp,evenwhenyou
usesomethingelselikeThunderbird!Takealook
yourself.FireuptheSystemMonitorapp,switchtothe
Processestabandsearchforevolution,whichwill
returnabunchofprocessesthatareunnecessarily
gorgingonthecomputer’sresources.
However,becausetheseprocessesaresotightly
coupledwiththedesktop,uninstallingthemwillbreak
yourinstallation.Insteadacleverworkaroundistotake
awaytheirexecutionprivilegeswith:
sudochmod-x/usr/lib/evolution/evolution-
addressbook-factory


sudo chmod -x /usr/lib/evolution/evolution-calendar-
factory
sudo chmod -x /usr/lib/evolution/evolution-source-
registry
If you’re feeling a little adventurous, you can tweak
the underlying filesystem to make your distro run
faster. A majority of distros use the ext4 filesystem,
which can be tweaked for performance. The journalling
file system supports three modes, with most distros
defaulting to the ordered mode that offers the best
safety-to-speed ratio. However, the Writeback mode is
the fastest, because it does the least amount of
journalling(keepingtrackofwhatfileiswhere).This
alsomeansthatitcomeswithariskofdatalossinthe
caseofapowerfailure,forinstance.Ifperformanceis
moreimportanttoyou,thenassumingyourroot
partitionis/dev/sda1,changeitsmodewith:
sudotune2fs-Ohas_journal-ojournal_data_writeback
/dev/sda1
You’llthenhavetoedit/etc/fstabtoaddaboot
optiontousewritebackmode.Whilewe’rehere,we’ll

addsomemoreoptionstoincreasetheperformanceof
thefilesystem.Openthefileinatexteditorandfindthe
linethatcorrespondstothe/partitionandaddthe
followingbootoptions:
data=writeback,noatime,barrier=0
Weusethe data=writebackoptionsincewe’vejust
changeditintothewritebackjournallingmode.The
noatimeasksthefilesystemtonotlogaccessoffiles
anddirectories.Thebarrier=0optiondisablesthewrite
barriers.Theseenforceproperon-diskorderingof
journalcommits,butcomeatthecostofaperformance
hit.Savethefileandrestartyourcomputerforthe
filesystemchangestotakeeffect.

It’s a good idea to periodically defrag your EXT4 partitions with the
e4defrag utility.

Used without caution, Bleachbit can destabilise your installation. Make sure you use the Preview
button to review files before removing them for good.

WHAT’S SLOWING YOU DOWN?


“If you are on an underpowered


machine, it’s a good idea to disable


the file-indexing service.”

Free download pdf