Ideas.  Interesting.  Public catering.  Production.  Management.  Agriculture

US Central Intelligence Agency. Russian hackers are helping Trump

July 15, 2015

List of optimization tips for Ubuntu 14.04. The purpose of which is to increase the speed of its operation and ease of use.

Autoloading programs in Ubuntu 14.04

For a long time now, Ubuntu has had a graphical interface for managing startup programs. This is the Startup Applications program ( gnome-session-properties). You can find it in the Dash main menu. But this program does not display all automatically launched programs. Some of them are hidden. To fix this you need to run two commands in the terminal:

sudo sed -i "s/NoDisplay=true/NoDisplay=false/g" /etc/xdg/autostart/*.desktop

sed -i "s/NoDisplay=true/NoDisplay=false/g" ~/.config/autostart/*.desktop

After this, all automatically launched programs will be visible in the "Automatically launched applications" program:

Disable programs carefully. If you don't know the purpose of the program you want to disable, find information about it and read it before disabling it.

Note on startup programs

Ubuntu uses two types of startup:

  1. Autoload together with a graphical shell (Unity, GNOME, etc.).
  2. Autoload together with the system kernel, in text mode.

Startup Applications manages the first type of download. Physically, such a download is performed through a .desktop program file (analogous to Windows shortcuts), which is placed in one of two folders:

  1. /etc/xdg/autostart
  2. ~/.config/autostart

From the first folder the program will be launched for any user. From the second folder, the program will be launched only for the user in whose home folder the program shortcut will be placed.

You can copy shortcuts to these folders necessary programs even manually. Shortcuts to all available programs are located in the folder /usr/share/applications(Dash takes them from this folder). After copying the shortcut, you need for the property " X-GNOME-Autostart-enabled" set the value to true.

Pre-loading programs at Ubuntu startup

There are special programs that control the order in which programs are loaded during the operating system startup process. They organize the placement of downloaded binary program files in such a way as to reduce their fragmentation within the file system. Reducing fragmentation speeds up the OS startup time.

Many Ubuntu optimization tips mention the program preload. Its installation can be done through the terminal:

sudo apt-get install preload

sudo touch /var/lib/preload/preload.state

sudo chmod 644 /var/lib/preload/preload.state

/etc/init.d/preload restart

However, right out of the box in Ubuntu another program is installed for the same task - ureadahead. You just need to enable its autorun.

Note

Using such programs makes sense only if a mechanical (HDD) disk is installed on the computer. If the disk is electronic (SSD), then there is no point in these programs, since on SSD disks, file fragmentation has very little effect on their loading speed.

Reduce the size of system logs (logs) of Ubuntu

Ubuntu keeps a whole bunch of logs. Both system and logs of individual programs and services.

Typically, all these logs are stored in the folder /var/log. If this folder is located on the root partition (/), then in some cases it is possible that the size of this folder will increase so much that all the free space on the root partition will be filled, up to the impossibility of starting the operating system. This is not a typical situation, but it happens.

Therefore, it is better to configure the log storage system in such a way as to reduce the amount of information stored.

It is better to do this by setting up a special program logrotate. This program deletes archived copies of logs at a specified frequency. The program settings are stored in the folder /etc/logrotate.d. Each file in this folder defines log management for a specific program. For example file /etc/logrotate.d/rsyslog This is syslog management. To reduce the size of stored logs, you need to specify parameters in these files rotate 0 And daily. You can also add a log size limit, for example size 10M(10 megabytes).

sudo gedit /etc/logrotate.d/rsyslog

And then edit this file. You can do the same with other files in this folder. You can change global settings for the program logrotate, via file /etc/logrotate.conf.

After changing the log rotation settings, you can delete all old logs. Command in terminal:

sudo find /var/log -type f -name "*.gz" -delete

Tmp folder to RAM

You can move the temporary files folder to RAM. By editing the fstab file:

sudo gedit /etc/fstab

and add the line tmpfs /tmp tmpfs defaults,noexec,nosuid 0 0

However, this must be done with caution.

Secondly, in this folder some programs can store data that they use after the system is restarted.

Using swap on disk

You can change the conditions under which the system starts using disk swap. By default, Ubuntu starts using disk swap when RAM is 40% occupied or more. You can change this behavior.

sudo gedit /etc/sysctl.conf

and add the line to the end of the file: vm.swappiness=10

Then reload the parameters: sudo sysctl -p

The parameter vm.swappiness=10 specifies that disk swap will be used when full random access memory by 90%.

Changing disk write caching settings

Ubuntu caches (in RAM) all disk writes. And then executes them in deferred mode. By managing the write cache settings, you can speed up the system at the risk of data loss. Or vice versa, slow down work, reducing the risk of data loss. There are several disk write caching options that can be used to achieve different effects.

Main parameters:

  • vm.dirty_background_ratio- the size of RAM to accommodate cache pages prepared for writing.
  • vm.dirty_ratio- the size of RAM to accommodate the shared write cache.

Auxiliary parameters:

  • vm.dirty_expire_centiseconds- indicates the time interval that cache pages prepared for writing are in memory.
  • vm.dirty_writeback_centisecs- specifies the time interval after which the system process that flushes the cache to disk wakes up from sleep mode and checks the need to perform cache flush operations.

All these parameters are written to a file sudo gedit /etc/sysctl.conf.

Example 1. Increasing the size of the write cache (speeding up the system):

  • vm.dirty_background_ratio = 50
  • vm.dirty_ratio = 80

Example 2: Reducing the write cache size:

  • vm.dirty_background_ratio = 5
  • vm.dirty_ratio = 10

You can find out the current values ​​of these parameters with the command sysctl -a | grep dirty.

Change these settings with caution. Clearly understanding their mutual influence, their relationship with RAM size, and possible side effects.

Increasing cache size or timing may result in data loss during a power outage or critical system failure.

A large cache size combined with a large volume of write requests can periodically create a situation where write requests are blocked for a long time, since the system will need to flush a large amount of data from a full cache to disk.

Speeding up the Dash menu

You can disable searching online sources when you type something in the search bar of the Dash menu. Via the graphical interface: "Settings - security and privacy - search: display Internet search results."

Or via terminal: gsettings set "com.canonical.Unity.Lenses" remote-content-search none.

In addition, you can disable search commercial offers in online stores. Command in terminal:

gsettings set "com.canonical.Unity.Lenses" disabled-scopes "["more_suggestions-amazon.scope","more_suggestions-u1ms.scope","more_suggestions-populartracks.scope", "music-musicstore.scope","more_suggestions -ebay.scope", "more_suggestions-ubuntushop.scope","more_suggestions-skimlinks.scope"]"

Add Windows encoding to Gedit text editor

To avoid “cracking”, when opening text files in Windows, you need to add the Windows-1251 encoding in the Gedit editor. Command in terminal:

gsettings set org.gnome.gedit.preferences.encodings auto-detected "["UTF-8", "WINDOWS-1251", "CURRENT", "ISO-8859-15", "UTF-16"]"

Traditional-looking Unity scrollbars

By default, in Unity, scrollbars are hidden. But you can make them visible all the time. Command in terminal:

gsettings set com.canonical.desktop.interface scrollbar-mode normal

Simple MP3 player for Ubuntu

Rhythmbox music player is installed out of the box in Ubuntu. It is quite large and not particularly comfortable, there is a lot of unnecessary stuff in it. You can remove it and install a simpler and more convenient player.

sudo apt-get remove rhythmbox

sudo apt-get install Audacious

Audacious small player without unnecessary bells and whistles:

sudo apt-get install qmmp

Adding keyboard shortcuts to launch programs

Frequently used programs, such as Nautilus, can be launched from the keyboard by assigning a keyboard shortcut. This is done through the graphical applet "Settings - Keyboard - Keyboard shortcuts":

In the "Additional Combinations" section you can add your own launch commands and associate them with keys.

First the command is added. Then, in the list of commands, click on the desired line and press the desired key combination.

Minimize all windows (Open Desktop) in Ubuntu

In Ubuntu 14.04, by default, you can minimize all open windows from the keyboard: Ctrl+Win+D. In addition, you can add a button to the launcher that will perform the same action. This is done through the graphical applet "Settings - Appearance - Mode":

Keyboard shortcut Ctrl+Win+D, in my opinion, inconvenient. On Windows it is used Win+D(this combination was also in 11 versions of Ubuntu). In order to change this combination you need to install the program compizconfig-settings-manager. Then run it and in the "Desktop" section open " Ubuntu Unity Plugin". Parameter " Show desktop" defines the keyboard shortcut for this action:

For enthusiasts

For those who like to go deeper into settings, I can recommend a couple of programs.

gsettings

Console program. Allows you to change a large number of system parameters. The settings are organized in the form of a tree - a diagram, in the diagrams there are keys to which values ​​can be assigned.

The gsettings help command will display a list of settings. For example gsettings list-recursively gives a general list of schemes, keys and current values.

dconf

Graphics program. Also allows you to change system settings. This program needs to be installed ( sudo apt-get install dconf).

In general, Linux users enjoy a faster operating system than Windows users. However, if you are using a heavyweight environment like Unity, your Ubuntu 16.04 may be slow. This post lists 4 simple advice, which you can apply to speed up your Ubuntu 16.04 system. You will see an increase in speed on low-end hardware and in Virtualbox. This also helps even if you installed Ubuntu on a solid state drive.

By the way, we have already written about how to significantly speed up the speed and performance of Ubuntu in VitrualBox on our website. If you use the system through this program, then you will be interested.

Let's get a look, how to make Ubuntu 16.04 faster!

  1. Disable unnecessary startup apps to make Ubuntu boot faster.

During boot, Ubuntu launches many applications that you may not need. To make Ubuntu 16.04 boot faster, you can disable some of them. However,

Most launcher apps are hidden. To display them, run the following command:

sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop

Then launch the launcher app from Unity Dash.

To disable a boot app, simply uncheck it.

Here are some applications that you may find objectionable.

Speeding up Ubuntu: Availability Profile Manager

It is used to display an icon in the accessibility area on the login screen. If you don't need the on-screen keyboard, use a screen reader, then disable it.

Backup monitor

This is a deja-dup monitor. If you don't want to copy anything with deja-dup, disable it.

Speeding up Ubuntu: Caribou

Disable it if you don't need the on-screen keyboard.

Desktop sharing

This is for VNC connection. Disable it if you don't need anyone to remotely control your Ubuntu system. You still have the ability to remotely control others' computers via VNC.

Gnome Software

Disable it if you want to install software in the terminal and not use Gnome software.

Orca Screen Reader

Disable this if you want to speed up Ubuntu.

Speeding up Ubuntu: File Sharing

Disable it if you don't use bluetooth to share files.

Update Notifications

Disable it if you do not want to be notified when updates are available software.

Another way to speed up the Ubuntu boot process is to disable some systemd services. You can view additional startup applications by running the following command in a terminal.

systemctl list-unit-files | grep enabled

Included indicates that the service is automatically started when Ubuntu boots. To disable the service to start automatically, use the following command:

sudo systemctl disable

For example, my computer does not have bluetooth, so I can disable the bluetooth service.

sudo systemctl disable bluetooth.service

I don't have a printer, so I might as well disable cups.service.

sudo systemctl disable cups.service

Attention. Before you disable it, make sure you know what the service does.

  1. Adjust Swappiness

Speeding up Ubuntu 16.04 requires an integrated approach. Therefore, this option will also come in handy.

We all know that RAM is much faster than a hard drive.

Let's experiment a little: boot the Ubuntu 16.04 system, open a few applications like Firefox, LibreOffice, Mozilla Thunderbird, Evince document viewer, and then do nothing with it. Do not pause or not sleep mode. Then after a few hours, return to your Ubuntu 16.04. You will find that these applications do not respond well to your mouse clicks because they have been sitting idle and being paged out to your hard drive.

You may find in System Monitor that Ubuntu is using page file space even though you have enough free physical memory.

This is due to the default swappiness value for Ubuntu. Swappiness is a Linux kernel setting that controls how often Linux dumps idle processes into swap space on your hard drive.

The swappiness value is between 0 ~ 100. A lower value means Linux will use less swap space, while a higher value causes Linux to use swap space more often. The default value for Ubuntu is 60, which means that if your computer is using up to 40% of its physical memory, the Linux kernel starts swapping. That is, you can speed up Ubuntu simply by adjusting this function correctly.

You can use the following command to check the current value.

cat /proc/sys/vm/swappiness

sudo sysctl vm.swappiness=10

Do not add spaces before or after the equal sign. This command tells the Linux kernel to use swap space when 90% or more of physical memory is used. This setting is not permanent.

To make it persistent across reboots, you need to edit the file.

sudo nano /etc/sysctl.d/99-sysctl.conf

At the end of this file, add the following line.

Save and close this file. (Press Ctrl+O to save, press Ctrl+X to exit). This tip also applies to your Ubuntu 16.04 server.

The following advice will help significantly speed up Ubuntu on any device configurations.

  1. Pre-load frequently used apps

Are you unhappy with the launch speed of Firefox or other slow applications? Here's a little piece of software called preload that remembers which apps you use most often and loads associated libraries and binaries into memory so those apps can launch faster. This can significantly speed up Ubuntu and all the programs you most often use on your device.

Install preboot on Ubuntu 16.04 using this one-line command.

sudo apt install preload

After installing and “mounting” the pre-boot, the process will automatically start. You can check this:

systemctl status preload

If it is not running, start it with the following command:

sudo systemctl start preload

Now you can forget about preloading and do other work. Speeding up Ubuntu includes another method that many consider to be very effective. Especially on devices with mobile video cards.

  1. Disable additional effects

The fancy effects are eye candy, but they can slow down your computer. We can use compizconfig-settings-manager to disable them.

sudo apt install compizconfig-settings-manager

Start it with Unity Dash. Then click the Effects tab on the left and turn off the effects you don't like. You can turn off all effects if you wish.

You can also disable Unity Dash background blur using the Unity Tweak tool to make Dash more responsive.

sudo apt install unity-tweak-tool

Then open it, select the search tab, and set the Background Blur option to Off.

Some people like a transparent background. Which one do you prefer? And how helpful this method was to speed up Ubuntu on your system.

After

Speeding up Ubuntu, as we have already said, requires a variety of methods to perform well on the device.

You can find out which service is taking how long to finish starting by entering the following command in the terminal.

As you can see from the above screenshot, mnt-pi.mount and vboxadd.service are the culprits on my computer. I know mnt-pi.mount is responsible for installing NFS from my Raspberry Pi, but I don't need NFS anymore, so I can safely remove the NFS mount from the /etc/fstab file. I also know that the vboxadd service is only useful for virtual machines, so I can disable this service on my physical machine.

sudo systemctl disable vboxadd.service

To find out the loading time, run:

After

Other ways to speed up Ubuntu 16.04

Translation of an article from an excellent English resource LinuxBabe.

I hope these performance tweaks helped you make Ubuntu 16.04 faster. Do you know other ways which can speed up Ubuntu 16.04? Share your tips in the comments below. If you found this post useful, subscribe to our free newsletter or share the link on Google+, Odnoklassniki, Twitter, VKontakte or, for example, Facebook.

If you find an error, please highlight a piece of text and click Ctrl+Enter.

Before we move on to speeding up Ubuntu, let's figure out why the system becomes slower over time. There may be several reasons for this. You may have a weak computer with a normal configuration. You might have installed several applications that eat up resources during system startup. In fact, the reasons are endless.

Below are various tricks that will help speed up Ubuntu a little. These are some of the best options, which can be done to make the system work more smoothly and efficiently. You can follow all of the tips presented or just some of them. When using them, Ubuntu speed increases noticeably.

I used these tricks with an older version of Ubuntu, but I think they can be used on other versions as well as other Linux distributions that are based on Ubuntu: Linux Mint, Elementary OS Luna, etc.

Reduce the loading time of the selection screen.

This screen gives you 10 seconds to select your operating system, enter recovery mode, etc. I think this is too much time. If you follow this system, you need to sit next to your computer and press the right key to log into Ubuntu as quickly as possible. It takes a while, doesn't it? The first trick is to change the timing of this selection screen. If you're more comfortable using a GUI tool, you can read about changing the boot time and order in Grub Customizer.

Everyone else can simply enter the following command to open the boot screen configuration settings:

Sudo gedit /etc/default/grub &

You need to replace GRUB_TIMEOUT=10 with GRUB_TIMEOUT=2 . Then the loading time will be 2 seconds. It is better not to select 0 seconds, because then you will not be able to choose between entering the OS and recovery mode. After changing the configuration, enter the following command, which will commit the changes:

Sudo update-grub

Set up auto-start applications.

Over time, you start installing applications. Some of them run every time the OS boots. Of course, running these applications takes resources.

The result: the computer slows down for a long period of time after startup. Go to Unity Dash and find Startup Applications there:

There you will see all startup applications. Think about whether there are applications there that you do not need when starting the OS? They can be removed from this list.


What if you don’t want to turn off autoloading? For example, if you installed some kind of indicator application for Ubuntu, you will want it to automatically launch when you start your computer.

In this case, you can delay the launch of applications. Then you will free up a certain amount of resources that are used when loading the OS, and after some time the necessary applications will be launched automatically. On the screen from the previous picture, click the “Edit” button and change the start time using the sleep option.

For example, if you want to delay the launch of the Dropbox indicator for, say, 20 seconds, you just need to add this to the existing command:

Sleep 10;

Then the dropbox start -i command changes to sleep 20; dropbox start -i. This means that Dropbox will now launch with a 20-second delay. Similarly, you can change the start time of other applications.


Install preload for applications to speed up their launch.

Preloading is a background process that analyzes user behavior and loads applications frequently. Open a terminal and enter the following command to install preboot:

Sudo apt-get install preload

After installation, restart your computer and forget about this process. It will work in the background.

Choose the best mirrors for updates.

It's a good idea to make sure you're using the best mirror versions to update your apps. The software repository is “mirrored” around the world in the case of Ubuntu. Optimization is to use a server that is geographically closer to you. Thanks to this, the system will be updated faster, because the time it takes to send packets to the server is reduced.

IN Software & Updates -> Ubuntu Software tab -> Download From select Other, and then click on Select Best Server:


After this, a check will start and you will be offered the best mirror. Usually it is already installed, but it is better to double-check just in case. If the mirror that contains the repository is not updated frequently, then system updates may be delayed. This tip will be useful for people with relatively slow Internet speeds.

For faster updates, use apt-fast rather than apt-get.

Apt-fast is a shell script for apt-get. It improves the speed of updating and downloading packages, since it downloads packages simultaneously across multiple connections. If you frequently use the terminal and apt-get to install and update these packages, consider trying apt-fast. It can be installed from the official PPA using the following commands:

Sudo add-apt-repository ppa:apt-fast/stable sudo apt-get update sudo apt-get install apt-fast

Remove ign from apt-get updates, which refers to languages.

Ever notice what sudo apt-get update says? It contains three types of strings: hit, ign, get. If you look at the ign strings, you will notice that they are mainly related to language translation. If you use applications and packages in one language, you do not need translation into the same language.

If you remove language-related updates from apt-get, apt-get's speed will increase slightly. To do this, open the following file:

Sudo gedit /etc/apt/apt.conf.d/00aptitude

Add the following line at the end of this file:

Acquire::Languages ​​"none";

Reduce overheating.

Overheating is a common problem that occurs in most computers. An overheated computer is quite slow. Opening a program takes centuries, with the CPU fan spinning at Usain Bolt speeds. There are 2 ways to reduce the degree of heating, and therefore increase the efficiency of Ubuntu, optimization will also be better. These are TLP and CPUFREQ.

To install and use TLP, enter the following commands into the terminal:

Sudo add-apt-repository ppa:linrunner/tlp sudo apt-get update sudo apt-get install tlp tlp-rdw sudo tlp start

Once installed, you don't need to do anything. TLP runs in the background.

To set the CPUFREQ indicator, use the following command:

Sudo apt-get install indicator-cpufreq

Restart your computer and turn on power saving mode:


Customize LibreOffice to make these programs run faster.

If you use office programs frequently, then you might want to set up LibreOffice to speed up your work. Memory will be configured here. Open LibreOffice, go to Tools -> Options. There, from the left column, select Memory and enable Systray Quickstarter, increase memory allocation.


If possible, use a lighter interface.

If you're using the regular Unity or GNOME interface, you might be interested in switching to simpler interfaces like Xfce or LXDE.

These interfaces use less RAM and waste less CPU power. They also have small programs that can also speed up Ubuntu.

Of course, these interfaces may not look as modern as Unity or GNOME. This is the compromise you will have to make.

Use lighter-sized versions of applications.

This is rather just a suggestion, so this question depends on personal preferences. Many standard or popular applications consume a lot of resources and may not be suitable for a low-power computer. In this case, you should look for alternatives to such applications. For example, you can use AppGrid instead of Ubuntu Software Center. Gdebi is suitable for installing packages. Instead of LibreOffice Writer, you can use AbiWord.

This concludes the collection of tips that will help make Ubuntu 14.04, 16.04 and other versions stronger. I am sure that by performing these tricks the system will work much better.

Linux provides many benefits to its users. For example, it can be considered virus-free because there are very few of them. For many, it is very important that no one except you will control what you do in the system. Free software sounds very attractive in light of recent events when we learned last year that big companies like Microsoft and Apple are spying on their users.

Free software becomes very relevant if you don't want to pay to use it yourself. new version operating system.

Many people remember that by double-clicking on a shortcut in Windows, you have to wait quite a long time for the program to start. Here Linux also has an advantage - it is much faster. And this applies to everyone who uses a computer with a brand new eight-core processor, and those who have an old laptop from the last century. If you want more high speed on Linux, follow the instructions in this article. Next we will look at how to speed up Linux. We'll focus primarily on Ubuntu, but all of these tips can be applied to other distributions as well.

Some of the tips given here include modifying system files as root user. With this type of editing, there is always a chance of accidentally breaking something and rendering your computer inoperable. Therefore, it is better to make a backup copy of all the files that you will work with, so that later, if necessary, you can restore the old settings.

It's even better to experiment with a virtual machine first. This way you can do whatever you want and then just roll back to the last working snapshot.

1. Accelerate Grub boot loader

If you have two operating systems installed, then you are probably familiar with this boot menu. But what you probably didn't notice is the countdown at the very bottom, under the input area. This is the amount of time the system will wait before starting to load the default distribution.

For example, in Ubuntu it is 10 seconds. Usually you can press Enter, but if you are far from the car, it may be more prudent to set the interval shorter, such as 3 seconds. This will be quite enough to choose an OS.

To speed up Linux boot time, open the /etc/default/grub file as root. Change the value of GRUB_TIMEOUT = 10 to 3. And then update the Grub configuration. Here:

sudo vi /etc/default/grub

sudo grub-update

sudo grub2-mkconfig -o /boot/grub/grub.cfg

2. Disable services

When the system boots, there is a huge difference between booting the kernel and having the desktop ready. The fact is that the system loads a very large number of services, and not all of them you need.

In the sysvinit-based init system, all services are located in the /etc/init.d folder and you can stop those that you do not need. You can view the status of all services with the command:

service --status-all

You can disable the service with the command:

update-rc.d -f service remove

sudo systemctl disable service

You can determine which services are needed and which are not, simply by searching on the Internet. Many distributions have graphical applications for managing services, for example, in Ubuntu you will have to use the service console utility for this, this will help greatly speed up the operation of Linux. Also, by disabling unnecessary services, you can greatly speed up Linux loading.

3. Speed ​​up Nautilus file manager

By default, Gnome's file manager does a quick scan of all files when you open each folder to show thumbnails and Additional information. In principle, this is a quick scan, but in a folder with a large number of files, this process will not be fast at all.

To stop wasting CPU time on this task, go to the menu Edit, Preview in Nautilus and change the setting from Always or Local files only on Never.

You will see that Nautilus is now much faster.

4. Load reduction

For older equipment, as a rule, we specifically choose lightweight distributions. The reason that VectorLinux and other similar distributions are so good on low-end hardware is that they don't require a lot of system resources.

Of course, if you want to speed up Linux on your machine, you can reduce its load yourself, or you can simply install a ready-made distribution. If you're willing to experiment, try one of the lightweight distributions. They will work much faster.

5. Use a faster window manager

If you don't want to completely change your distribution, there are still many improvements that can be made by integrating some of the features of such distributions. The window manager is one of them. If you use heavy window managers like KDE or Gnome, try something simpler. This will give a significant performance boost.

The most important job of a window manager is to manage windows and give you enough control over them. But they can perform many more functions than you need.

If you click on the top bar of the window in KDE and see what options there are, you'll see what I'm talking about. Another window manager might be faster and less distracting.

Perhaps the most popular is Openbox, and it can be installed on a large number of distributions.

After installation, to launch the window manager, type:

openbox --replace

After a few seconds, you will see that the window style has changed. This is Openbox. Using the context menu, you can move windows, dock them, or stack them on top of others. But nothing else. Your windows now move faster.

6. Speeding up KDE

If you are using the KDE desktop environment, then you have a great chance of getting a Linux boost. Although Plasma is quite fast if you have a modern machine, it is a complex software stack. Each KDE component can be configured to run more efficiently. We have already looked at it, read about this in detail in a separate article.

7. Block ads

When viewing web pages, you will notice that the site does not load immediately, it waits until all components of the page are loaded, including advertisements. Flash animation very annoying when there are a lot of blocks on the page, so you can block it (no need to do this on our site, we are white and fluffy).

For most popular browsers - Chromium, Firefox, Opera there is Adblock extension, which does this function perfectly. The program uses a database to block the most popular ad sources.

8. Use keyboard shortcuts

This may seem obvious to some. Working only with the keyboard is much faster than moving from the mouse to the keyboard and back. Many functions can be done using the keyboard. For example, the standard copy and paste commands from the edit menu.

It's worth creating keyboard shortcuts for all frequently used actions. For example, switching between applications and desktops. You can go even further and use vim and emacs as text editors.

The Alt+F2 application launcher can do much more. For example, you can dial shutdown to turn off or lock to lock the screen. You can perform simple calculations by starting an expression with an = sign. There are many more similar features depending on the plugins. Type a sign? and press the right arrow for more details.

9. Patch the kernel

If you want maximum software performance, there are many fixes that can be made to the kernel. Optimizing the Linux kernel can have a great effect. You can optimize the kernel yourself, but there is an easier way. You can use the kernel compiled by Con Koliva, it includes great amount performance patches. The kernel patchset is called -ck and it was compiled with a focus on performance.

To install it, you need to download the source code of the kernel, the version for which these patches are designed. Then download the patch itself and run the command in the kernel source folder:

$patch -p1< patch-3.*-ck1

Now build the kernel according to the instructions from your distribution. This is easier said than done, but there are a lot of instructions on the Internet, including on our website -.

10. Overclock your Nvidia graphics card

This item is only suitable if you are using an older video card. Will not work for new models. Here you can increase the power of your equipment.

No need to use BIOS, just NVIDIA Control Panel. Before these options appear, you need to add a line to the X server configuration file. This file is no longer used on most distributions, but the NVIDIA Configuration Utility can generate it.

Just run it, go to the tab X server configuration and click on the button Save to the X configuration file.

Once the /etc/X11/xorg.conf file has been created, open it in text editor with root rights, find the Device section that describes your graphics card and add the line at the end: Option "Coolbits" "5". Restart the X server.

Now, after launching the NVIDIA setup utility, you will see an additional page with clock speed settings. Click the Enable Overclocking button and accept the disclaimer. You can now adjust the running frequency for 2D and 3D rendering. It's best to regulate them at the same time.

Every time you change the parameters, the heat dissipation changes. Make sure the temperature remains within reasonable limits. In addition, from the same page you can adjust the fan speed. Once you've set up the configuration you want, save your settings and make sure the NVIDIA tool loads these settings the next time you start it.

11. Overclocking equipment

Overclocking and various tricks with increasing parameters above the recommended speeds and temperatures can damage your data and lead to breakdown of your hardware and this is a very good linux acceleration. But many components are now designed to handle greater loads than their standard configuration. This stock leaves a lot of room for experimentation.

Many motherboards include default options to improve system speed without requiring much computer knowledge.

You can configure all of this in your BIOS. To access it, use the F2 or Del keys. You may find options there to speed up the processor, increase the frequency of RAM, etc.

12. Improve network performance

Linux has supported ipv6 for a very long time, but if you don't use it, disabling it can improve network performance, thereby speeding up Linux's networking experience. The easiest way to do this is through NetworkManager.

If you're using Gnome, open the Network Connections applet. and select Edit for the connection you are using. On the ipv6 tab, select disable.

If you have KDE without NetworkManager, you can set the global environment variable KDE_NO_IPV6=1:

export KDE_NO_IPV6=1

To save changes after reboot, you can add a command to the /etc/profile file.

You can also disable the kernel module responsible for ipv6; to do this, add it to the file: /etc/modprobe.d/blacklist

The Firefox browser also allows you to disable ipv6. Just type about:config in the address bar and activate the \network.dns.disableIPv6 item.

If you are working on a small network, you can disable arp in DHCP and configure static IP addresses. Add the noarp line to the /etc/dhcpd.conf configuration file and restart the system. Addresses should now be distributed faster.

13. Static linking

Many programs load libraries dynamically for their work, while the program is running. This does not take very much time, but if the applications are large and load a lot of libraries, then static linking can give excellent Linux speedup. The preload and prelink utilities are used for this.

Prelink converts executables so that they load as many libraries as possible. Preload monitors the system and keeps frequently used programs in memory. After a little calibration, Linux optimization feels good.

First let's install Prelink:

sudo apt-get install prelink

Then run the utility to process all executable files:

sudo prelink --all

To run prelink periodically so that Linux is optimized for new files, open the /etc/default/prelink file and replace the line PRELINKING=unknown with yes:

sudo gedit /etc/default/prelink

Let's install Preload:

sudo apt-get install preload

You just need to install this program; it does not require any configuration after installation.

14. Use ZRAM

If you don't have enough RAM, you can very easily increase its amount by 25 or even 50% using. This is a kernel module that allows you to compress the contents of RAM on the fly, so the RAM capacity remains increased, but the speed remains the same. This will give a good boost to Linux for older computers.

15. Reduce hard drive activity

The system is very active in writing and reading files from the /tmp directory. This is a directory for temporary files and can be used by a large number of programs at the same time. It will be better if the contents of this directory are in RAM. To speed up Linux, add this line to the /etc/fstab file:

$ sudo vi /etc/fstab

tmpfs /tmp tmpfs defaults,noexec,nosuid 0 0

First, make sure that the tmp folder is not already mounted in RAM by running the mount command. Many distributions have this linux optimization enabled by default.

But that is not all. Not all systems make efficient use of swap space on the hard drive. By default, vm.swappiness is set to 60, so if (100-60) 40% of RAM is occupied, the system will start flushing data to the hard drive. This is true for systems with a small amount of RAM, 1-2 GB, but if you have 10 GB, then loading the hard drive when you only have 4 GB occupied is not serious. To change this, run the command.

Let's change Ubuntu's behavior regarding RAM usage and swap (swap partition). There is a parameter called vm.swappiness, which has a default value of 60, and controls the percentage of free memory at which active dumping of pages into the swap partition will begin. In other words, at 100-60=40% of occupied memory, Ubuntu will already start using the swap partition. If there is a lot of RAM in the computer, it is better to change the vm.swappiness parameter to 10 and thereby tell Ubuntu not to use swap until the used RAM reaches 100-10=90%. Let's set the value to 10 instead of 60. In the console, enter the following command:

Echo 10 > /proc/sys/vm/swappiness

Sysctl -w vm.swappiness=10

To save the setting after a reboot, add the following line to the end of the /etc/sysctl.conf file:

Vm.swappiness=10

To immediately apply the setting:

Sysctl -p

In addition, we can talk about several more parameters.
The pseudo-file vfs_cache_pressure stores a value - the level of memory allocated for the cache. Default value: 100. Increasing this parameter causes the kernel to more actively dump unused memory pages from the cache, i.e. The amount of RAM allocated to the cache will grow more slowly, which in turn will reduce the likelihood that the swap partition will be used. By decreasing this parameter, the kernel, on the contrary, will keep memory pages in the cache longer, including in swap. This makes sense when there is a small amount of RAM, for example, if we have 512 MB of memory, then the vfs_cache_pressure parameter can be set to 50. This will reduce the number of disk operations in the swap partition, so that unused pages will be removed less frequently.Reducing this parameter further may lead to memory shortage.
If you want to speed up the system and you have enough RAM (2 GB or more), then change the system value like this: swappiness = 10, vfs_cache_pressure = 1000 (default 100), add the following line to the /etc/sysctl.conf file:

Vm.vfs_cache_pressure=1000

or on the fly:

Sysctl -w vm.vfs_cache_pressure=1000

Caching in Linux

When data is written to disk (by any program), Linux caches this information in an area of ​​memory called Page Cache. Information about this memory area can be viewed using the free, vmstat or top commands. Complete information about this memory area can be viewed in the /proc/meminfo file. Below is an example of this file on a server with 4 GB RAM:

MemTotal: 3950112 kB
MemFree: 622560 kB
Buffers: 78048 kB
Cached: 2901484 kB
SwapCached: 0 kB
Active: 3108012 kB
Inactive: 55296 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 3950112 kB
LowFree: 622560 kB
SwapTotal: 4198272 kB
SwapFree: 4198244 kB
Dirty: 416 kB
Writeback: 0 kB
Mapped: 999852 kB
Slab: 57104 kB
Committed_AS: 3340368 kB
PageTables: 6672 kB
VmallocTotal: 536870911 kB
VmallocUsed: 35300 kB
VmallocChunk: 536835611 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB

The Page Cache size is shown in the "Cached" parameter, in this example it is 2.9 GB. As pages are written to memory, the size of the "Dirty" parameter increases. When you start writing to disk, the "Writeback" parameter will increase until the recording ends. It is quite difficult to see the "Writeback" parameter high, since its value only increases during polling, when input/output (I/O) operations are queued but not yet written to disk.
Linux typically writes cache data to disk using the pdflush process. At any moment, there are from 2 to 8 pdflush threads running on the system. In the file /proc/sys/vm/nr_pdflush_threads you can see how many this moment active threads. Every time all existing pdflush threads are busy for at least 1 second. New threads try to write data to free device queues, so that for each active device there is 1 thread flushing data from the cache. Every time a second passes without any activity from pdflush, 1 thread is removed. In Linux, you can configure the minimum and maximum number of pdflush threads.

Setting up pdflush
Each pdflush thread is controlled by several parameters in /proc/sys/vm:

  • /proc/sys/vm/dirty_writeback_centisecs (default 500): in hundredths of seconds. This setting indicates how often pdflush resumes to write data to disk. By default, 2 threads are resumed every 5 seconds.
    There may be an undocumented behavior that thwarts attempts to reduce dirty_writeback_centisecs to allow the pdflush process to cache data more aggressively. For example, in early versions of the 2.6 Linux kernel, the mm/page-writeback.c file included logic that said "if disk writes take longer than the dirty_writeback_centisecs parameter, then set the interval to 1 second." This logic is described only in the kernel code, and its operation depends on the version of the Linux kernel. Since this is not very good, you will therefore be protected from reducing this parameter.
  • code>/proc/sys/vm/dirty_expire_centiseconds (default 3000): in hundredths of seconds. This parameter specifies how long data can remain in the cache before it must be written to disk. The default value is very long: 30 seconds. This means that during normal operation, until enough data has been written to the cache to call another pdflush method, Linux will not write data to disk that has been in the cache for less than 30 seconds.
  • /proc/sys/vm/dirty_background_ratio (default 10): The maximum percentage of RAM that can be filled by the page cache before data is written to disk. Some versions of the Linux kernel may set this parameter to 5%.
    Most documentation describes this setting as a percentage of total RAM, but according to the Linux kernel source code, this is not the case. Looking at meminfo, the dirty_background_ratio parameter is calculated from the value MemFree + Cached - Mapped. So for our demo system, 10% is a little less than 250MB, but not 400MB.

When does pdflush start recording?
In the default configuration, data written to disk remains in memory until:

If write operations occur frequently on the server, then one day the dirty_background_ratio parameter will be reached, and you will be able to see that all writes to the disk go only through this parameter without waiting for the dirty_expire_centiseconds parameter to expire.

Page writing process
The parameter /proc/sys/vm/dirty_ratio (default 40) is the maximum percentage of total RAM that can be allocated to the page cache before pdflush writes data to disk.

Note: While writing to disk, all writing processes are blocked, not just the one that has filled the write buffer. This can cause one process to block all I/O operations on the system.

Best practices for optimizing Linux for write-intensive operations
Usually, when trying to increase the performance of the disk subsystem, they encounter the problem that Linux buffers too much information at once. This is especially noticeable for operations that require file system synchronization using fsync calls. If during such a call there is a lot of data in the cache, then the system may freeze until this call ends.
Another common problem occurs because too much needs to be written before the physical disk is written to, causing I/O operations to occur more frequently than normal operation.

  • dirty_background_ratio: Basic tuning tool. Usually this parameter is reduced. If your goal is to reduce the amount of data stored in the cache, so that data is written to disk gradually rather than all at once, then reducing this parameter is the most effective way. The default value is most suitable for systems with a lot of RAM and slow disks.
  • dirty_ratio: The second most important parameter to configure. If this setting is significantly reduced, applications that need to write to disk will be blocked all together.
  • dirty_expire_centisecs: Try reducing this parameter, but not too much. It allows you to reduce the time that pages spend in the cache before being written to disk, but on the other hand, this will significantly reduce the average write speed to disk, which will be especially noticeable on systems with slow disks.

As a result we get
In the /etc/sysctl.conf file we add:

Vm.dirty_background_ratio = 10 vm.dirty_ratio = 40

Then we synchronize the cache and disk data, clear the cache and save the parameters:

Sync; echo 3 > /proc/sys/vm/drop_caches; sysctl -p

To reduce the number of disk write finalizations, you need to adjust:

Vm.dirty_writeback_centisecs = 15000

Loading...