📜 ⬆️ ⬇️

Optimize your favorite Ubuntu / Gnome / software

Original vasilisc.com/speedup_ubuntu

While I mastered Ubuntu, I read many articles about accelerating Ubuntu, both in terms of loading and working in general.


1) Add lines to the ~ / .gtkrc-2.0 file to reduce latency.
gtk-menu-popup-delay = 10
gtk-menu-popdown-delay = 10
gtk-menu-bar-popup-delay = 10

Menus quickly open
')
2) via gconf-editor
# ,
gconftool-2 --type bool --set /apps/metacity/general/reduced_resources true
#
gconftool-2 --type bool --set /apps/panel/global/enable_animations false
#
gconftool-2 --type bool --set /desktop/gnome/interface/accessibility false
# =
gconftool-2 --type string --set /apps/panel/global/panel_animation_speed panel-speed-fast

# ,
# , , auto_raise_delay
# .
gconftool-2 --type integer --set /apps/metacity/general/auto_raise_delay 100


3) accelerating the launch of KDE programs (Qt) in Gnome. This is a rare piece of advice that I found only in an English-language resource and I really liked its efficiency.

To speed up the launch of KDE programs in the Gnome environment, you need
System => Parameters => Launched at startup (System ---> Preferences ---> Sessions)
Add the path / usr / bin / kdeinit called FastQt

Greater speed is achieved by pre-running KDE libraries
My favorite SMPlayer video player on Qt really starts faster.

4) Installed preload seems to help and set "so that it was"
sudo aptitude install preload

5) The / etc / hosts 127.0.0.1 file should indicate not only localhost, but also the name of the machine selected during installation. They say less tupit Gnome, hi with him
root@vasilisc:/etc# cat hosts
127.0.0.1 localhost vasilisc
127.0.1.1 vasilisc


6) Disable IPv6 in Ubuntu older than 9.04
rule /boot/grub/menu.lst
parameter to kernel ipv6.disable = 1

7) Accelerate programs that use Sqlite to store information. Acceleration is achieved by re-indexing and deleting empty entries. You can make a script and periodically run with closed programs.
#
find ~/.mozilla/ -name '*.sqlite' -print -exec sqlite3 {} "VACUUM; REINDEX;" \;
#
find ~/.gnome2/epiphany/ -name '*.sqlite' -print -exec sqlite3 {} "VACUUM; REINDEX;" \;
# RSS Liferea
sqlite3 ~/.liferea_1.6/liferea.db "VACUUM; REINDEX;"


8) we launch the Epiphany browser into memory in advance so that repeated launches are faster. Meaning as in p.3
System => Parameters => Launched at startup (System ---> Preferences ---> Sessions)
Add the command /usr/bin/epiphany --no-window to the name FastEpiphany

9) Creation of caches
#!/bin/sh
#
for d in ~/.icons/*; do gtk-update-icon-cache -f $d; done
#
for d in /usr/share/icons/*; do sudo gtk-update-icon-cache -f $d; done
#
sudo fc-cache -fv

10) The system menu opens a long time for the first time, after rebooting the computer. We treat crutch.
we put xmacro
sudo apt-get install xmacro
create an executable file ~ / bin / fast_menu.sh with contents
#!/bin/sh
echo "Delay 1\nKeyStrPress Alt_L\nKeyStrPress F1\nDelay 2\nKeyStrRelease Alt_L\nKeyStrRelease F1\nKeyStrPress Escape\nKeyStrRelease Escape"|xmacroplay ":0.0"
exit 0

Note: the line beginning with echo should be placed on one line completely.
Go to System => Options => Run at startup (System ---> Preferences ---> Sessions)
Add a path to the file fast_menu.sh called FastMenu

11) Set the localepurge, which will remove extra locale and thereby free up space. Now, when installing the software, there will be no extra Zulu and papua-new-guinea locales.
I strongly recommend to put in the console, calling:
sudo aptitude install localepurge
I advise you to select the following locales:
en
en_GB
en_GB.ISO-8859-15
en_GB.UTF-8
en_US
en_US.ISO-8859-15
en_US.UTF-8
ru
ru_RU
ru_RU.CP1251
ru_RU.KOI8-R
ru_RU.UTF-8

At any time, you can re-select the locale by calling:
dpkg-reconfigure locales
If there are any problems, then look towards
/usr/share/doc/localepurge/reinstall_debs.sh and /etc/locale.nopurge


12) Cache symbol tables
Create an empty directory
$ mkdir ~ / .compose-cache

Your Qt / GTK programs will start a little faster and consume less memory, thanks to the fact that libX11 will create ~ / .compose-cache caches of parsed information and reuse it.

13) Priority Xorg
The Council allows you to speed up the work in Ubuntu by increasing the priority of Xorg. The board is suitable for both Ubuntu (Gnome) users and kUbuntu (KDE). The priority is changed by the renice command. It must be remembered that from 0 to -19, the priority increases, and from 0 to +19 decreases. In our case, we change the priority of Xorg from 0 to -5

sudo renice -n -5 $ (pidof X)

If you want that after rebooting the PC, Xorg was already with a higher priority, then you can put gksu / path / to / script in Gnome and kdesudo / path / to / script in KDE into Startup.
Or add the renice -n -5 $ (pidof X) command to /etc/rc.local, and it will be executed as root and after Xorg is loaded.

14) Disable Anti-Phishing to speed up Mozilla Firefox
ATTENTION!!! If you do not understand what phishing is and how to defend against threats on the Internet, then you should NOT read further and apply this advice! Phishing is a way of deceiving you when you are given a direct link to a site that is externally indistinguishable from the present or a link that looks like a known resource. Once on this site, the user can give the fraudsters valuable information that allows them to access their accounts and bank accounts. To protect against phishing, manufacturers of major Internet browsers have agreed to use the same methods of informing users that they have opened a suspicious website, which may belong to fraudsters. New versions of browsers already have this feature, which is accordingly referred to as “anti-phishing”.
Anti-phishing is a defense that is never superfluous. Phishing is extra care for you. But if you control the situation, for example, you have installed the NoScript plugin for Firefox, which protects you on unknown sites. Or you yourself observe network security, then you may want to speed up Firefox, at the cost of disabling Anti-Phishing and reducing security.
Acceleration is achieved due to the fact that each URL is not checked on the basis of Phishing addresses. To speed up Firefox, by disabling Antiphishing, do the following:
1) In Firefox in the menu Edit - Settings - Protection. Uncheck "Block sites suspected of attacks" and "Block sites suspected of fraud." Save the changes.
2) Close Firefox. Now we need to delete a large file-base of addresses, after removing Firefox will create it small and fast. Launch the Terminal and command

ls -laF ~ / .mozilla / firefox / *. default / urlclassifier *
rm -i ~ / .mozilla / firefox / *. default / urlclassifier *

3) Start Firefox and check its operation and start time and responsiveness in work. Check in the terminal team

ls -laF ~ / .mozilla / firefox / *. default / urlclassifier *

that the file was created smaller than before. Read the above tip “Total Sqlite Reindexing and Reindexing”.

Cons: you delete the Firefox file in your home directory and it is advisable to backup your Firefox profile.

15) File System Acceleration
In this tip, we will change the settings relating to file systems. This advice is strongly recommended to be used ONLY by owners of an uninterruptible power supply (UPS).
In Linux, you can use many file systems and each has its own parameters that affect performance. Specify the parameters you need, you need to carefully edit the file / etc / fstab, making a preliminary copy of it.
File system options to improve performance:
ext4 acceleration
barrier = 0 The file system code is required to make sure that all transaction information is logged before creating a commit record [log]. Just making a record in the right order is not enough; modern drives have a large cache and change the write order to optimize performance. Therefore, the file system must explicitly tell the disk to write all log data to media before creating a commit record; if a commit record is first created, the log may be corrupted. The blocking system of input-output of the kernel provides such an opportunity due to the use of the mechanism of “barriers” (barriers); in other words, the “barrier” forbids the recording of any blocks sent after it, until such time as everything that was sent before the “barrier” will be transferred to the carrier. When using barriers, the file system can guarantee that everything that is on the disk is complete at any time. By disabling the barrier = 0 barrier, we speed up write operations to ext4 partitions.

noatime, nodiratime - disable recording the last access time (for files / directories). Or relatime - the access time attribute (atime) is updated, but only if the file data has changed (mtime attribute) or its status (ctime attribute). I recommend using relatime.

commit - the time between flushing buffers to disk. I recommend commit = 100

data = writeback . By default, the journaling mode for ext4 is data = ordered mode. The file system only logs metadata, data and metadata are grouped into one module - a transaction. This mode, although not guaranteed, protects data during an unexpected reboot. In data = writeback mode, the file system does not perform any data logging. If the system reboots unexpectedly, it may cause data loss in the updated files. This mode provides the highest performance ext4. To change the ordered mode to a less secure, but high-speed writeback, you MUST unmount the partition and execute sudo tune2fs -O has_journal -o journal_data_writeback / dev / SECTION NAME. It is advisable to check the partition for errors sudo fsck / dev / SECURITY NAME. This article does not discuss and does not recommend changing the logging mode for the root partition /.

btrfs acceleration
nobarrier The file system code is required to make sure that all transaction information is logged before creating a commit record. Just making a record in the right order is not enough; modern drives have a large cache and change the write order to optimize performance. Therefore, the file system must explicitly tell the disk to write all log data to media before creating a commit record; if a commit record is first created, the log may be corrupted. The blocking system of input-output of the kernel provides such an opportunity due to the use of the mechanism of “barriers” (barriers); in other words, the “barrier” forbids the recording of any blocks sent after it, until such time as everything that was sent before the “barrier” will be transferred to the carrier. When using barriers, the file system can guarantee that everything that is on the disk is complete at any time. By disabling the nobarrier barrier, we speed up writing operations to btrfs partitions.

noatime, nodiratime - disable recording the last access time (for files / directories). Or relatime - the access time attribute (atime) is updated, but only if the file data has changed (mtime attribute) or its status (ctime attribute). I recommend using relatime.

nodatacow — When the copy-on-write mechanism is enabled, there are additional costs and we disable this feature in the nodatacow parameter, which is rarely used on a desktop computer.

vm.dirty_writeback_centisecs . Increase the time between resetting vm.dirty_writeback_centisecs dirty buffers in /etc/sysctl.conf. I recommend vm.dirty_writeback_centisecs = 15000

Minus syslog . The syslog logging daemon (as well as its replacement rsyslog) writes logs in the / var / log / directory and, adding one line, performs a sync operation that negates the disk cache and a longer reset of buffers. You can change the behavior of the daemon and specify not to sync after each addition. Find the daemon configuration file, usually /etc/syslog.conf or /etc/rsyslog.d/ and change all paths like / var / log / change something by adding a minus sign ("-") before the paths. For example, there was a string
mail.err /var/log/mail.err
has become
mail.err - / var / log / mail.err

Source: https://habr.com/ru/post/57758/


All Articles