Configuring Swappiness and Caching on Linux. Operation "Optimization". Tips to speed up Ubuntu Speed ​​up ubuntu 16.04

This article will provide a list of tips for optimizing Ubuntu 14.04 after it is installed. The purpose of which is to increase the speed of its work and the convenience of its use.

Configuring startup programs in Ubuntu 14.04

Ubuntu, for a long time, has a graphical interface for managing startup programs. This is the Startup Applications program ( gnome-session-properties). You can find it in the main Dash menu. However, there is some problem - this program does not display all automatically launched programs. 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 that, all the shortcuts from the startup folders will be visible in the "Startup Applications" applet:

Disable programs carefully. If you do not know the purpose of the program you want to disable, read about it in advance.

Note on startup programs

In general, Ubuntu has two startup systems:

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

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

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

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

You can copy the shortcuts of the required programs into these folders, even manually. Shortcuts for all available programs are located in the folder / usr / share / applications(Dash takes them from this folder). However, copying the shortcut is not enough, you need it for the property " X-GNOME-Autostart-enabled"specify the value true.

Preloading programs at the start of Ubuntu

There are special programs that control the order in which binary modules are loaded in the process of starting the operating system. They arrange the placement of the loaded binaries in such a way as to reduce their fragmentation within file system... And by reducing fragmentation, speed up their loading from disk.

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, out of the box, another program is installed in Ubuntu for the same task - ureadahead... You just need to enable its autorun.

Note

The use of these 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.

Reduce the size of Ubuntu system logs

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

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

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

It is more correct to do this through setting up a special program. logrotate... This program deletes archived copies of logs at the specified frequency. Program settings are stored in the folder /etc/logrotate.d... Each file in this folder defines the management of the logs for a particular program. For example file /etc/logrotate.d/rsyslog it is syslog management. To reduce the size of the stored logs, you need to specify the parameters in these files rotate 0 and daily... You can also add a limit on the size of the log, 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 the global settings for the program logrotate, via file /etc/logrotate.conf.

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

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

Tmp folder in 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 of your programs can store data that they use after restarting the system.

In general, first examine the contents of this folder on the disk and then make the decision to transfer it to RAM.

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 the RAM is 40% or more busy. 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

Vm.swappiness = 10 specifies that disk swap will be used when filling random access memory by 90%.

Changing disk write caching options

Ubuntu caches (to RAM) all disk writes. And executes them in deferred mode. By controlling the settings of the write cache, you can speed up the system with the risk of data loss, or vice versa, slow down the work, reducing the risk of data loss. There are several options for caching disk writes that you can use to get different effects.

Main parameters:

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

Auxiliary parameters:

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

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 size of the write cache:

  • 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.

Be careful when changing these parameters. By clearly understanding their mutual influence, their relationship with the size of RAM, as well as possible side effects.

For example, increasing the size of the cache or increasing the time intervals can result in the loss of large amounts of data during a power outage or a critical system crash.

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

Dash Menu Speed ​​Up

You can turn off Internet searches (wikipedia) when you write something in search bar Dash menu. Via the graphical interface: "Settings - Protection and Privacy - Search: Display Internet Search Results".

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

In addition, you can turn off the search for 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 "krakozyabr", when opening Windows text files, 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 "]"

Unity's traditional 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, user-friendly MP3 player for Ubuntu

The rhythmbox music player is installed out of the box in Ubuntu. He's pretty monstrous. You can remove it and install a more sane player.

sudo apt-get remove rhythmbox

sudo apt-get install Audacious

Audacious is a small player without unnecessary bells and whistles:

sudo apt-get install qmmp

Adding keyboard shortcuts to launch programs

Regularly 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 shortcuts" section, you can add your own launch commands and associate them with keys.

The command is added first. Then, in the list of commands, click on the required line with the mouse 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 using 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 "Settings - Appearance - Mode" graphical applet:

Keyboard shortcut Ctrl + Win + D, in my opinion, uncomfortable. Windows uses 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 have virtual sex, I can recommend a couple of programs.

gsettings

Console program. Allows you to change a large number of system parameters. Settings are organized in the form of a tree - schemas, in schemas, keys to which you can assign values.

Installed out of the box. The gsettings help command will list the options. For example gsettings list-recursively gives a general list of schemas, keys and current values.

dconf

Graphic program. Also allows you to change system settings. You need to install ( sudo apt-get install dconf).

Basically, using these two programs, you can stick your hand up to the elbow in Ubuntu's anus :) But be careful, she may not like it :)

If you found it useful or just liked this article, then do not hesitate - financially support the author. This is easy to do by throwing money on Yandex Wallet No. 410011416229354... Or on the phone +7 918-16-26-331 .

Even a small amount can help you write new articles :)

SHITTY CONTENT ALERT This is an obsolete article. Perhaps you will find something useful here, but the local brownie advises not to embark on this slippery path.

You can make Ubuntu run faster on a relatively weak computer different ways... Some of them, especially if used incorrectly, can disrupt the performance of the system. Here is a list of some very safe methods and tricks to do this.

1. Improving the use of system memory (RAM)

There are three ways you can improve your memory usage:

Reducing the paging file size

When using a small amount of RAM (usually less than 1 GB), the system dumps some of the information into the swap file (SWAP-file), also called "Virtual memory". Excessive use of the paging file can slow down the system.

In Ubuntu, the swappiness parameter determines the aggressiveness of the swap file. The lower the number, the longer it takes Ubuntu to boot. The default value of 60 is fine for servers, but too much for a home computer.

You can find a detailed description

Solution:

Launch terminal and enter the following command: sudo apt-get install gksu leafpad. Press Enter and enter your password. Keep in mind that the password will be hidden, not even asterisks.

2. Now let's check the value of the swap file.

To do this, enter the command in the terminal: cat / proc / sys / vm / swappiness and press Enter. The result is likely to be 60.

3. Now, to change the value, run the command: gksudo leafpad /etc/sysctl.conf

Scroll to the bottom of the file and override the default swappiness. To do this, copy the following:

# Decrease swap usage to a more reasonable level vm.swappiness = 10

Save the file, close and reboot. After reboot, check the swappiness value in the terminal: cat / proc / sys / vm / swappiness. It should now be 10.

For 1GB RAM or more

If you have 1 GB of RAM or more, it makes sense to shrink the inode cache. This is possible on computers with at least 1 GB of RAM, as some system resources can remain in memory for a long time, which reduces the total amount available to the user.

Solution:

1. Applications such as gksu and leafpad must be installed first.

Launch terminal and run: sudo apt-get install gksu leafpad. Press Enter and enter your password. Note that the password you type will remain invisible, not even asterisks will be shown.

2. Then execute in the terminal (you can copy the text and paste it into the console): gksudo leafpad /etc/sysctl.conf

Hit Enter. Scroll to the very bottom of the file and add your cache settings instead of the default settings, to do this, insert the following lines there:

# Improve cache management vm.vfs_cache_pressure = 50

3. Close the file, save it and restart your computer.

For 786 MB RAM or less

Even if you change the swappiness value for a machine with a small amount of memory (less than 786 MB), the problem with performance may still remain.

In this situation, you can get better results if you enable the experimental zRam kernel module. This module creates a compressed swap file in RAM. Compression is a key factor here, which makes the memory size seem to "grow".

But the inclusion of this module will lead to an increase in the load on the processor. he will need to constantly deal with compression and decompression. It is best to use zRam in combination with a swappiness value reduced to 5.

Solution:

Launch terminal and enter sudo apt-get install zram-config.

Press Enter and confirm the action by entering the password. Remember that characters will not be replaced with asterisks, but will be invisible.

Reboot your computer, and after rebooting, type cat / proc / swaps in the terminal and press Enter. If you receive a message about one or more / dev / zram partitions, then everything went well and no further action is required.

Turning off zRAM after use

Launch terminal and enter sudo apt-get purge zram-config.

Execute the command by pressing Enter and restart your computer.

Now check the status with the following command: cat / proc / swaps. If everything went well, you should no longer receive messages about one or more / dev / zram “partitions”.

2. Disable visual effects by switching to 2D desktop

To display the image on the screen, a video card is used that applies 3D effects by default, which can cause a drop in Ubuntu performance. You can turn them off by switching to the 2D or Xubuntu desktop.

Solution:

1. First, install gnome-session-fallback:

Launch a terminal and type: sudo apt-get install gnome-session-fallback. Press Enter and confirm with a password.

2. Now log off. In the login window, click on the Ubuntu logo.

Now click on GNOME Flashback (Metacity) .

Note: do not choose GNOME Flashback (Compiz) because it also has a lot of 3D effects and you want to get rid of them completely.

3. Go back.

3. Solid State Drive (SSD) should be faster

A solid state drive (SSD) is rarely recognized correctly by the BIOS or UEFI when the BIOS / UEFI AHCI option is enabled for SATA. Do you have an SSD? Then make it run faster.

4. Disable app indexing

Using the apt-xapian-index application indexing improves search speed, but can significantly degrade the performance of older and slower computers. This package is not as necessary, so you can easily get rid of it.

If you have installed Synaptic Package Manager, uninstalling it will remove the quick search bar from the Synaptic panel. This means you have to use the search button (with a magnifying glass icon).

In any case, the search button is more powerful than the Quick search. So her disappearance is kind of an added bonus.

Solution:

Run the command in the terminal: sudo apt-get purge apt-xapian-index. Press Enter and confirm with a password. Then restart your computer.

5. Disable Java in Libre Office

By disabling Java in Libre Office, you automatically significantly improve program performance. However, this leads to the disabling of some functions, but they are not so important and useful.

Solution:

1. Open the Toolbar in Libre Office Writer, then Tools, then Options ...

2. Libre Office -> Advanced -> Java options

3. Uncheck "Use Java Runtime"

6. Disable startup of some of your applications

Turning off some applications provided by Ubuntu will help your computer run faster. This method is comparable to fine tuning msconfig on Windows.

Most of Ubuntu's startup applications are hidden from the prying eyes, so let's find them first.

Solution:

1. Start a terminal and enter: cd / etc / xdg / autostart /. Hit Enter.

2. Now enter in a terminal: sudo sed –in-place ‘s / NoDisplay = true / NoDisplay = false / g’ * .desktop

Press Enter and confirm with a password.

3. Now check Startup Applications:

Click on the gray Ubuntu logo (Dash home). Type "startup" and uncheck those applications that you don't need, and restart your computer (or log out and log in again).

Note: Do not remove applications from the list! Leave it easy to roll back all changes (you can't be sure of anything). If in doubt about the purpose of an application, do nothing, just leave it as it is.

7. Remove unnecessary add-ons and extensions for your web browser

Many browsers like Firefox, Chrome, etc. have a lot of addons and extensions built in. They make your work easier, but at the same time they have a number of disadvantages, as they are "programs in the program".

They can:

  • cause malfunctioning: both each other and the browser itself;
  • slow down the browser, especially if there are a lot of them;
  • carry malicious content.

Thus, do not overload your browser with addons, remove all additional extensions and use only the most important ones.

Addons that seem to be designed to speed up the browser, in practice, on the contrary, slow it down and cause harm.

8. How to increase the speed of wireless Internet

Below is a method to help you increase the speed of your wireless connection on Ubuntu ..

Solution:

1. First, the gksu and leafpad applications must be installed.

Launch terminal and enter the following command: sudo apt-get install gksu leafpad. Press Enter and confirm with a password.

2. Now find out how Ubuntu handles the wireless connection:

Click on the gray Ubuntu logo (Dash home). Type "terminal". Click on terminal and type: iwconfig. Hit Enter. You will see a list of all available wireless connections with a description of power management (on or off). If off then you don't need to do anything else.

Note: The wlan0 connection is used as an example. It is sometimes called something else, such as eth1. In this case, you will need to change the commands in the terminal according to this name.

3. Create an executable text file"Wireless":

Enter the following in the terminal: sudo touch /etc/pm/power.d/wireless. Press Enter and confirm with a password.

Now write: sudo chmod 755 /etc/pm/power.d/wireless and press Enter.

4. Type in a terminal: gksudo leafpad /etc/pm/power.d/wireless.

Hit Enter. This will launch the Leafpad text editor with an empty “wireless” file. Copy the following text into an empty “wireless” file:

#! / bin / sh / sbin / iwconfig wlan0 power off

5. Save and close the file

6. Restart your computer

7. Check in the terminal, using the iwconfig command, if power management is disabled in your wireless device.

9. Clean up your Ubuntu

Cleaning your system regularly will help your Ubuntu run fast and smoothly. Here are some ways you can do it:

  • Clean up leftover trash after uninstalled programs.
  • Remove old kernels.
  • Clear the thumbnail cache.

More detailed information can be found.

Linux users, by definition, have a better performance system than Windows. However, if you use a heavyweight desktop environment like Unity, for example, performance may suffer somewhat.
Everyone prefers that programs and documents open not after 10-20 seconds, but immediately. At the same time, it is desirable that the appearance of the working environment does not resemble the early nineties, because we spend a lot of time in the interface of our system, which means that we should be comfortable inside.
You don't have to go to extremes, completely abandoning beautiful desktop environments in favor of ascetic window managers. Finding a compromise between performance and good looks is not difficult at all.
In this article, we'll take a look at speeding up Ubuntu in four simple ways. While these tips will work for older releases as well, we'll take a look at speeding up Ubuntu 16.04 in particular.
The positive result will be clearly visible on old low-power computers or on VirtualBox. The tips are relevant and effective, even if your Ubuntu is installed on an SSD.

1. Remove unnecessary programs from startup.

Ubuntu 16.04 loads a wide variety of applications at startup, many of which you probably don't need. To speed up Ubuntu, you can simply disable them.
However, many startup programs are hidden, and in order to see them, you need to run the following command:

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

Now open "Launch Apps" from the Unity Dash ...
... and just uncheck unnecessary items.


You can speed up Ubuntu 16.04 by disabling unnecessary features. Here is a list of those services and programs that you probably won't need.
Accessibility Profile Manager(Accessibility Manager).
Used to display the accessibility icon on the login screen. If you don't need the onscreen keyboard and voice assistant, just turn them off.
Backup Monitor(Backup).
Creation backups using deja-dup-monitor. If you do not plan to make backups of any data, feel free to disable it.
Desktop Sharing(Remote Desktop Control).
Designed for incoming VNC connections. If you know that you can cope with your system without anyone's help, then you can turn it off. The ability to act as a remote assistant yourself and control other computers via VNC does not disappear anywhere.
Gnome software(Software Center).
This can be disabled if you prefer to install programs through the terminal, without the help of the GUI Software Center.
Orca Screen Reader (Voice assistant Orca).
If you are sighted, turn it off.
Personal file sharing(Sharing personal files).
Should be left only in case of need to transfer files via Bluetooth.
Update Notifier(Update notification).
If you do not want to receive notifications about available updates, then you can turn it off.

2. Adjust Swappiness.

We all know that the speed of data exchange with RAM is much higher than with a hard drive. How to speed up Ubuntu given this fact?
Let's do a little experiment: start your system, open some programs, say: Firefox, LibreOffice, Mozilla Thunderbird, Evince ... and just leave them open without doing anything. Do not put the system into hibernation or standby mode. Come back in a few hours and notice how clumsy the running programs have become, how slowly they respond to our actions with the mouse. This is because they went into idle (inactivity) mode, and the system sent them to swap, that is, to a specially designated space on the hard disk.
Using the System Monitor (Task Manager), you can detect that Ubuntu is using swap, regardless of the presence of a lot of free RAM.
It's connected with swappiness settings default. Swappiness is a kernel parameter that controls how often Linux will send idle applications to swap, that is, to the hard drive.
The swappiness value can be set in the range from 0 to 100. Low values ​​instruct the swappiness to be used less often, high - more often. The default value in Ubuntu is 60. This means that when the RAM consumption reaches 40%, the Linux kernel will activate swap.
You can check the current value using the command:

cat / proc / sys / vm / swappiness

sudo sysctl vm.swappiness = 10

Do not put spaces before or after the "=" sign. This command tells the kernel to use swap only when memory is 90% occupied. This setting is valid until reboot.
To make the configuration action permanent, you need to edit a special file.

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

Add the following line to the end of this file:

vm.swappiness = 10



Save the file and close the editor (Press Ctrl + O to save and Ctrl + X to exit). All of these steps apply to Ubuntu Server 16.04.Our goal is to make Ubuntu run faster. Who else would love the launch speed of Firefox or other heavy applications? There is a small software tool known as preload, which remembers the programs you use most often, preloads the libraries and executables related to them into RAM, making the launch of these heaviest programs much faster.
You can install preload on Ubuntu 16.04 using the command:

sudo apt install preload

After the installation is complete, the preload daemon will start automatically, you can verify this by running the command:

systemctl status preload



If, for some reason, it is not running, run the command:

sudo systemctl start preload

Now just go about your business - preload will work without your participation.

4. Disable effects.

The effects are undoubtedly pleasing to the eye, diluting a boring workspace. However, they also require valuable system resources to run. How to speed up Ubuntu 16.04? The effects can be turned off using compizconfig-settings-manager, thereby increasing performance.
You can install compizconfig-settings-manager using the command:

sudo apt install compizconfig-settings-manager

Launch it from the Unity Dash, then select the Effects section on the left and disable the ones you don't need. If you want, you can turn off absolutely everything.


You can also turn off background blur in the Unity Dash using the Unity Tweak Tool. This will make the Unity Dash more responsive.
Installing Unity Tweak Tool:

sudo apt install unity-tweak-tool

Once installed, open it and select the Search tab, then toggle the Background blur button to Off. (OFF).


In general, many people like transparent backgrounds, do you?
Before:


After:

Bonus tip: find the main culprit for slow downloads.

You can find out how long it takes for each of the loaded services to start by running the following command:

systemd-analyze blame



As you can see in the snapshot above, the services mnt-pi.mount and vboxadd.service are the very culprits. I know that mnt-pi.mount is responsible for mounting NFS (Network File System) on my Raspberry Pi, but I no longer need it, so I can painlessly remove it from the / etc / fstab file. I also know that the vboxadd.service daemon is needed only for the virtual machine, that is, I, again, unnecessarily.
Disable:

sudo systemctl disable vboxadd.service

Checking the loading time:

systemd-analyze time

Before:

After:

Disable ipv6 ubuntu 16.04

IPv6 is a new technology that provides much larger IP address space, better security and faster performance. But this is all ideally. IPv6 breaks backward compatibility with IPv4 and is now used in most cases the old protocol. We have already examined in great detail how IPv6 differs from IPv4, so we will not repeat everything again.
Since at the moment IPv6 is used quite rarely, this protocol is not fully supported by all equipment. If IPv6 is not supported by your router or ISP, then this will slow down the network, it will take longer to determine the domain names of the sites and will try to obtain an IPv6 address, which will also lead to a delay. In this small post, we will look at how to disable ipv6 on Ubuntu 16.04 or other compatible distributions.

Checking IPv6 support

All modern distributions support IPv6 without exception. But to make sure that your local machine has received an ipv6 address, you can run the command:

In the section for connecting eth0, you will see the address of inet4 and inet6, inet6 will show the address Ipv6, which is assigned to this computer by the router. All addresses starting with fe80 are local area network addresses. But the presence of this address does not mean that it is supported by your ISP. To check this point, you can try to send a ping request to ipv6.google.com:

Speed ​​up ubuntu DOWNLOAD
After the kernel is loaded, the ramdisk image (initial ramdisk, initrd) starts to load in ubuntu. If you unpack this image, you can make sure that there is a lot of unnecessary things and that when unpacked it takes up almost 25 megabytes. Therefore, it is advisable to rebuild all initrd images in the system with only the necessary modules. But everything is not as difficult as it seems. Opening the file:

Sudo nano /etc/initramfs-tools/initramfs.conf

there is a line

MODULES = most

and replace it with:

MODULES = dep

That's it, now you need to run the command:

sudo update-initramfs -k all -u

It will rebuild all found initrd images for all installed kernels. In the future, for a newly installed kernel, the initrd will be generated by itself with these parameters, so it only needs to be done once. Now initrd files will be about 3 megabytes packed and 6-7 megabytes unpacked. This will partially shorten the boot time without negatively affecting the system.

The OS boot speed also directly depends on the file system on which the OS is installed. The point is that the new ext4 and the old reiserfs work better with small files. Actually, the distribution kit contains the most small files. Therefore, I recommend completely switching to ext4 - this will greatly reduce the speed of not only loading the OS, but also the very work with the system, programs and files.

Also, you can turn off the preliminary check of sections. hard disk during OS boot. Journaled file systems have long been safe and it is advisable to check them only after a sufficiently long use, after an unsafe shutdown of the computer, after glitches, and if desired. Disabled in the file “/ etc / fstab”. There are two numbers at the end of each line. We only need the last digit, it is responsible for checking the hard disk during OS startup. We change this figure to zero on the desired file systems. And that's it, you don't need to touch anything else.

When Ubuntu boots, the Ondemand policy is automatically installed - that is, self-regulation using the kernel. Naturally, the processor frequency drops to the minimum, which does not suit completely. But you can by default enable the Performance policy (maximum processor frequency)

The command is executed

Sudo update-rc.d -f ondemand remove

On the atlon64 system. Thunderbird, firefox slowed down. In performance mode, these programs work much faster, taken

++++++++++++++++++++++++++++++++++++++++

INSTALLING prelink TO SPEED UP THE SYSTEM LOADING

Installation:

Sudo apt-get install prelink

Now open the settings file

Sudo nano / etc / default / prelink

and change the value of the "PRELINKING" option from "unknown" to "yes", like this: PRELINKING = yes

The program will also install the prelink daily start script, but the first time you need to run it manually:

Sudo /etc/cron.daily/prelink

then it will be imperceptible, it will turn on automatically and DONE!

++++++++++++++++++++++++++++++++++++++++

OPTIMIZATION of the system when working with MEMORY

Customization / proc / sys / vm / swappiness and / proc / sys / vm / vfs_cache_pressure.
The swappiness pseudo file stores a value (in whole percent), this is the level of free memory at which the system will start actively flushing memory into swap. The default value is 60. The value ranges from 0 to 100.
The pseudo file vfs_cache_pressure stores the value - the level of allocated memory for the cache. The default value is 100. Unfortunately, I don’t know the limits of the value.

If you want to speed up the system (especially those who feel sorry for the unused RAM while the system is running), then change the value of the system, something like this:
swappiness = 10, vfs_cache_pressure = 1000:

Now we will make these parameters apply when the system boots.
Editing the file /etc/sysctl.conf

sudo nano /etc/sysctl.conf

add the lines to the end of the file

vm.swappiness = 10 vm.vfs_cache_pressure = 1000

++++++++++++++++++++++++++++++++++++++++

You can disable booting the system in graphical mode, for ubuntu 9.10 and 10.04

Sudo nano / etc / default / grub

In this file, in this line, this line is reduced to this form

GRUB_CMDLINE_LINUX_DEFAULT = "quiet ipv6.disable = 1"

the word splash is removed and the ipv6 disable is added at system boot, then the command

Sudo update-grub

and you're done.

++++++++++++++++++++++++++++++++++++++++

If / boot is a separate partition, then you can comment out its automatic mounting at system startup in the / etc / fstab file

++++++++++++++++++++++++++++++++++++++++

You can also use the utelite rcconf to manage system daemons
Purpose of services (further information is taken from this site:

acpi-support - mark at the S-level;
acpid is a power management service required for both laptops and desktops. We leave it as it is;
alsa-utils - S-level;
anacron is a cron scheduler subsystem that executes any cron jobs that are not completed in time. Can be turned off;
apmd is an outdated service for the same computers. Disable;
atd is a task scheduler like cron. Disabled;
binfmt-support - kernel support for other binary file formats. Leave it as it is;
bootlogd - leave it as it is;
cron - leave enabled;
cupsys is a printer management subsystem. If you don't have a printer, turn it off;
dbus - Message bus system. Very important service, leave it on;
dns-clean - clean up dns information, relevant for dial-up. It's not a sin to turn it off.
gdm is the Gnome desktop manager. Do not touch;
gpm - console mode mouse support. Enable runlevel 1 and 2 for the service;
halt - do not change;
hdparm - hard drive configuration script. Uncheck runlevels 2, 3, 4, 5, and add S runlevel. The sooner this service is launched, the better.
hotkey-setup - assignment of "hot keys" on laptops. Supported manufacturers: HP, Acer, ASUS, Sony, Dell, and IBM. Whether you need it or not, decide for yourself:
hplip is the HP printing and imaging engine. Can be turned off;
klogd - Leave the service enabled;
linux-restricted-modules-common- check if you have any restricted modules loaded on your system. They can be found in / lib / linux-restricted-modules;
makedev - do not turn off;
module-init-tools - Loads additional modules from the / etc / modules file. You can explore the / etc / modules file to see if there are any modules here that you don't need. Let it be included;
networking - sets up network interfaces and configures dns information at boot time by scanning the / etc / network / interfaces file. Leave on;
powernowd is a client for CPU frequency control (cpufreq). Mainly designed for laptops that support CPU speed stepping technology. It is advisable to leave it as it is;
ppp and ppp-dns - needed to provide a modem connection. If you don't use dial-up, feel free to disconnect it;
readahead is one of the “preloader”. At startup, this service loads some libraries into memory so that some programs start faster. Although, in fact, disabling the service will not affect the operation of the system in any way;
reboot - do not change;
rmnologin - removes nologin if it finds one. In general, a service of little use, we turn it off;
rsync is the rsync daemon. Can be disabled;
sendsigs - sends signals before reboot or shutdown. Leave it as it is;
single - activates single user mode. Leave it as it is;
stop-bootlogd - stops bootlogd at 2,3,4,5 runlevels. Leave it as it is;
sysklogd - do not touch;
udev - support for the userspace dev filesystem. Better to leave the service enabled;
umountfs - leave it as it is;
usplash - "beautiful" boot screen, can be disabled;
vbesave is a BIOS setup tool for a video card. Leave it on. ondemand Controls the processor frequency, in ondemand mode - decreases the frequency when the processor is used weakly and increases it when a load occurs. Because acts with delay - leads to light (or strong) brakes, it is better to leave it off if not a matter of a couple of extra watts of energy.

It is known that in modern operating systems uses technology such as virtual memory, designed for multitasking operating systems.

In the Windows family of operating systems, the file used to store unused RAM in the area of ​​the hard disk is called the "paging file" (pagefile.sys).

Its organization is not implemented in the best way (to put it mildly!). In Linux OS, during installation, a separate swap partition is created - "Swap", which is much better.

The Windows swap file and Linux-swap are located on the HDD (hard disk). When RAM becomes insufficient, pages of memory are swapped out of RAM to the hard disk, and when you access files in the swap partition again, they are loaded back into RAM.

The whole problem is that the read-write speed of the HDD hard disk (even the fastest) FACTOR OF less speed of RAM. This is what leads to a slowdown in the computer and a decrease in performance in general.

There are two ways to solve this problem: use large amounts of RAM or properly configure the system to work with the paging file and swap.

So, in Ubuntu there is such a parameter that controls the percentage of free memory at which flushing of memory pages in swap will start - vm.swappiness.

In Ubuntu, by default, it has a value of - 60. This means that when 40% of the occupied RAM will start an active flushing of memory pages to the swap partition, that is, 100% - 60% = 40%.

You can check what the value of the parameter you have is as follows.

Open the terminal with a key combination Ctrl + Alt + T and execute the command:

cat / proc / sys / vm / swappiness

This parameter value can be useful only for computers with a small amount of RAM (512 -1024 MB).

If you have a modern computer or laptop with a large amount of RAM (4-6, or even 8 GB), then this is unlikely to suit you.

Many Ubuntu forums and blogs recommend setting vm.swappiness = 10 (i.e. 100% - 10% = 90%). But, in my personal experience, if you have 6 GB of RAM, you can behave more aggressively by setting the value to 0. In this case, the system will access the swap section only as a last resort.

I recommend experimenting with this parameter in the current session (after rebooting everything will return to its default value), while changing nothing in the system configuration files, in order to find the most optimal parameter. And here everything is already individual ...

You can do it like this.

Again, open the almighty terminal with the key combination Ctrl + Alt + T and execute the following command in it:

sudo sysctl vm.swappiness =

After the equal sign, set a value from 100 to 0 (depending on the amount of your RAM).

After that, try to "submerge" your system: open several browsers with a large number of tabs, copy large files to external media (by the way, this is a sore point of linux systems - the speed of copying to external media. But more on that next time ) etc.

After you have found the most suitable value for yourself, you need to set the new value as a constant. Copy and execute the following command in the terminal:

sudo gedit /etc/sysctl.conf

The configuration file will open in a text editor. gedit... At the end of this file, insert the following two parameters without a pound in front of them:

vm.swappiness = 0 vm.vfs_cache_pressure = 1000

We save the file. It should look like the screenshot below:

We reboot the computer. After rebooting, execute in the terminal:

sudo sysctl -p

As noted above, I chose the parameter equal to 0, effectively disabling the swap partition, since it turned out to be the most optimal for my computer with six gigabytes of RAM. You can choose the parameter value equal to 10, as recommended in numerous forums.

As an example, I would like to demonstrate loading RAM in Ubuntu 12.10 x64 with 6GB of RAM.
So, I opened three browsers - regular Mazilla Firefox, Opera and Google Chrome with a total of about 40 tabs, Clementine audio player (by the way, quite demanding on computer resources), Skype, qBittorrent torrent client.
And here is a screenshot htop(this is a pretty advanced console process monitor). To install, we type in the terminal

sudo apt-get install htop


I think that everything becomes clear: less than half of the installed RAM is occupied.
Therefore, if you have a lot of RAM, then it makes no sense to use a swap partition. This will only slow down the speed of your computer!
In conclusion, I can say that this is not the only thing that can be done to speed up the work of Ubuntu. More about this in the following articles. Subscribe to the RSS feed!
Great mood, fast computer performance and Happy New Year!
As a pleasant surprise today, a video about how Google employees saw the outgoing year.