- Нехватка оперативной памяти в Linux на рабочем ПК: оптимизация и действия при зависании
- zram и приоритеты свопов
- Быстро вырубить программу, перегружающую ОЗУ. Запас ОЗУ для SSH
- Best Lightweight Linux Distributions For Older Computers
- Best Lightweight Linux distros for old laptops and desktops
- 16. Q4OS
- Minimum Requirements for Q4OS:
- 15. Slax
- Minimum system requirements for Slax:
- 14. Ubuntu MATE
- Minimum system requirements for Ubuntu MATE:
- 13. Zorin OS Lite
- Minimum system requirements for Zorin OS Lite:
- 12. Xubuntu
- Minimum system requirements for Xubuntu:
- 11. Linux Mint Xfce
- Minimum system requirements for Linux Mint Xfce:
- 10. Peppermint
- Minimum system requirements for Peppermint OS:
- 9. Lubuntu
- Minimum hardware requirements for Lubuntu:
- 8. Linux Lite
- Minimum hardware requirements for Linux Lite:
- 7. LXLE
- Minimum hardware requirements for LXLE:
- 6. CrunchBang++
- Minimum hardware requirements for CrunchBang++:
- 5. Bodhi Linux
- Minimum hardware requirements for Bodhi Linux:
- 4. antiX Linux
- Minimum hardware requirements for antiX Linux:
- 3. SparkyLinux
- Minimum hardware requirements for SparkyLinux:
- 2. Puppy Linux
- Minimum hardware requirements for Puppy Linux:
- 1. Tiny Core
- Minimum hardware requirements for Tiny Core Linux:
Нехватка оперативной памяти в Linux на рабочем ПК: оптимизация и действия при зависании
На любой операционной системе часто не хватает оперативной памяти. Рассмотрим, как и сэкономить на увеличении аппаратных ресурсов машины с Linux, и продолжить более-менее комфортно пользоваться компьютером с Linux в условиях нехватки памяти.
Типична такая ситуация: есть своп (swap, раздел подкачки), который начинает использоваться при нехватке оперативной памяти, и размещен он на HDD, то есть жестком диске с низкой скоростью чтения информации. В таких ситуациях операционная система начинает тормозить, подвисает курсор мыши, сложно переключиться в соседнюю tty и т.д. Почему? Потому что планировщик ядра Linux не может выполнить запрос на какое-то действие в запущенной программе, пока не получит доступ к ее оперативной памяти, выполнить следующее действие тоже не может, образовывается очередь из запросов на чтение с диска, и система «подвисает» именно потому, что обработка очереди происходит гораздо медленнее, чем этого хочет пользователь.
Если в такой момент запустить htop или uptime , то показатель Load Average (LA) будет очень высоким, несмотря на низкую загруженность ядер процессора. Сочетание высокого Load Average и низкой загрузки процессора говорят о забитой очереди процессора.
Часто в интернете советуют изменить параметр ядра Linux vm.swappiness . Узнать его текущее значение на вашей системе можно так:
Ответ будет 60 почти наверняка. Это значит, что ядро Linux начинает свопить редко используемые страницы оперативной памяти, когда использование свободной оперативной памяти достигает 100%-60%=40%. Часто встречаются рекомендации поставить, например, vm.swappiness=10, чтобы своп не начинал использоваться, пока загрузка ОЗу не достигнет 90%. На самом деле не нужно трогать vm.swappiness, вы не умнее разработчиков ядра Linux, которые не просто так поставили 60 по умолчанию. Почему?
Представьте, что у вас всего 4 ГБ оперативной памяти, из них прямо сейчас занято 3 ГБ, vm.swappiness=10, своп на жестком диске (HDD) занят на 0%, и вы открываете тяжелый сайт в браузере, для чего требуется больше, чем имеющийся свободный 1 ГБ, например, 2 ГБ. Операционная система начинает в экстренном порядке отправлять в своп как минимум 0.5 ГБ (а по факту больше), чтобы можно было выделить браузеру необходимое количество оперативной памяти. Эта процедура становится самой приоритетной задачей, и придется пожертвовать даже движениями курсора мыши, чтобы ее выполнить как можно быстрее. Вы ждете. Проходит 5 минут, и система развисает, потому что окончила процедуру 100% загрузки очереди доступа к медленному жесткому диску, на котором размещена оперативная память (своп). При дефолтном vm.swappiness=60 редко используемые страницы памяти сбрасываются в своп заблаговременно, и резкого зависания на 5-10 минут не происходит.
UPD. В комментарии подсказывают, что это не точное описание работы vm.swappiness.
zram и приоритеты свопов
Рекомендую включить zram — прозрачное сжатие содержимого оперативной памяти. В Ubuntu это автоматизировано, достаточно установить пакет:
sudo apt install zram-config
Здесь и далее для дистрибутивов Rosa, Fedora все то же самое, но вместо zram-config —
Сервис systemd zram-config на Ubuntu будет автоматически добавлен в автозагрузку при установке пакета и запущен при перезагрузке системы. Для запуска вручную:
sudo systemctl start zram-config
sudo systemctl stop zram-config
Удаления из автозапуска:
sudo systemctl disable zram-config
Добавление в автозапуск:
sudo systemctl enable zram-config
При запуске zram-config берет число, равное 50% всего объема оперативной памяти, далее делает по одному виртуальному устройству /dev/zramN, где N начинается с 0, для каждого ядра процессора, а объем каждого /dev/zramN равен 50% всей оперативной памяти, деленному на количество ядер процессора. Так делалается для распараллеливания сжатия содержимого оперативной памяти по ядрам процессора; насколько я знаю, на современных ядрах Linux достаточно одного устройства /dev/zramN, а распараллелится оно само, но меня полностью устраивает искоробочная работа zram-config, и предпочитаю не лезть в нее руками.
Команда swapon -s выведет список всех задействованных свопов с указанием их приоритета. Первым используется тот своп, у которого приоритет выше. Если у вас уже есть дисковый своп и включен zram, то в случае с описанным выше пакетом-автокофигуратором приоритеты из коробки будут правильными. Например, у дискового свопа будет -1, а все /dev/zramN — 5. Таким образом, сначала используется zram, и только потом — диск.
Кстати, zram часто применяется на смартфонах, какую-либо на глаз заметную нагрузку на процессор при дефолтном методе сжатия lz4 он не создает.
Также приоритет свопа можно указать в /etc/fstab . Покажу на примере, как это сделано на моем рабочем компьютере с 6 ГБ ОЗУ.
Опцией монтирования pri=X заданы приоритеты свопов. Если еще включить zram, то картинка будет такой:
В первую очередь будет свопиться в zram, то есть сжиматься внутри оперативной памяти без использования внешнего устройства для свопа, во вторую — использовать небольшой своп на SSD. Почти никогда не будет использоваться 6 ГБ свопа на HDD, однако они понадобятся, если я захочу отправить компьютер в спящий режим в условиях большой загрузки оперативной памяти. (На самом деле у меня отключен zram).
На офисных ПК с 4 ГБ ОЗУ (Xubuntu 16.04, 17.10) всегда ставлю пакет zram-config . Chromium, по наблюдениям, на глаз, очень хорошо сжимается в оперативной памяти, в результате чего zram позволяет сделать работу намного более комфортной без модернизации железа.
Быстро вырубить программу, перегружающую ОЗУ. Запас ОЗУ для SSH
Бывает такое, что даже при vm.swappiness=60 какому-то черту, как правило, браузеру, требуется очень много оперативной памяти, и система подвисает. Решается очень просто: сочетание клавиш Alt+SysRq(PrintScreen)+F заставляет oom_killer принудительно включиться и вырубить процесс, который на момент вызова занимает больше всего памяти. Строго 1 процесс на 1 вызов, и строго обязательно что-то будет убито. Если много раз подряд нажмете, то, скорее всего, перезапустится графическая сессия. Событие убиения процесса отражается в dmesg красным цветом.
Однако эта штука, называющаяся Magic SysRq, из коробки отключена в большинстве дистрибутивов, потому что непривилегированный пользователь может убить абсолютно любой процесс. За это отчечает параметр ядра kernel.sysrq , узнать его текущее значение можно так:
Для работы Alt+SysRq+F нужно kernel.sysrq=1. Для этого отредатируем параметры ядра, расположенные в файлах /etc/sysctl.conf (обычно симлинк на /etc/sysctl.d/99-sysctl.conf) и /etc/sysctl.d/*.conf. Лучше всего создать отдельный файл:
sudo nano /etc/sysctl.d/99-dumalogiya.conf
Нажмем Ctrl+O, Enter для сохранения.
В случае с браузером Chromium Alt+SysRq(PrintScreen)+F будет вырубать по одной вкладке, не закрывая сам браузер, что очень удобно.
Сочетания клавиш Magic SysRq перехватываются напрямую ядром Linux, поэтому работают даже когда из-за очереди процессора подвисает X-сервер.
Источник
Best Lightweight Linux Distributions For Older Computers
Last updated September 14, 2021 By Ankush Das 384 Comments
Brief: Don’t throw your old computer just yet. Use a lightweight Linux distro and revive that decades-old system.
What do you do with your old computers? The one which once had good a hardware configuration but now potentially outdated.
Why not revive your old computer with Linux? I am going to list the best lightweight Linux distributions that you can use on old computers.
Some of the distributions mentioned here are also a part of the best Linux distributions for beginners. So, you might want to check that if you’re new to the Linux universe.
While our focus is on older computers, you can also use most of these lightweight Linux distros on relatively new hardware. This will give you a better performance if you use your computer for resource-heavy usage such as video editing on Linux.
Let’s see which lightweight Linux distribution you can use.
Best Lightweight Linux distros for old laptops and desktops
Note: The list is in no particular order of ranking, take a look at the minimum system requirements to choose one for yourself.
16. Q4OS
Support for 32-bit systems: Yes
Q4OS is a Debian-based distribution which aims to provide a fast experience while also offering a 32-bit option. In fact, it is one of the best options for 32-bit systems. It features the Trinity Desktop for 32-bit edition and the KDE Plasma desktop on 64-bit image.
It may not offer the best looking user interface, but it is simple and it is indeed screaming fast on older hardware. You can easily try this on your old computer to test it out.
Minimum Requirements for Q4OS:
- RAM: 128 MB (Trinity Desktop) / 1 GB (Plasma Desktop)
- CPU: 300 MHz (Trinity Desktop) / 1 GHz (Plasma Desktop)
- Storage Space: 5 GB (Plasma Desktop) / 3 GB (Trinity Desktop)
15. Slax
Support for 32-bit systems: Yes
Slax is a really portable lightweight Linux distro based on Debian which you can use it on a USB drive without installing it.
The ISO file size is just under 300 MB – which makes it a great option for older computers. The user interface is simple and usable with essential pre-built packages for an average user. You can even try to customize the OS and make permanent changes on the fly if you require it.
Minimum system requirements for Slax:
- RAM: 128 MB (offline usage) / 512 MB (for web browser usage)
- CPU: i686 or newer
14. Ubuntu MATE
Support for 32-bit systems: Yes
Ubuntu MATE is an impressive lightweight Linux distro that runs fast enough on older computers. It features the MATE desktop – so the user interface might seem a little different at first but it’s easy to use as well.
In addition to the desktop support, you can also try it on a Raspberry Pi or Jetson Nano.
Minimum system requirements for Ubuntu MATE:
- RAM: 1 GB
- CPU: Pentium M 1.0 GHz
- Disk Space: 9 GB
- Display Resolution: 1024 x 768
13. Zorin OS Lite
Support for 32-bit systems: Yes
Zorin OS is an Ubuntu-based Linux distribution. It offers a lite edition for older computers that features the Xfce desktop environment.
If you have a decent system (not too old), you can also try the regular Zorin OS to see if it fits your purpose.
Minimum system requirements for Zorin OS Lite:
- RAM: 512 MB
- CPU: 700 MHz Single Core
- Disk Space: 8 GB
- Display: 640 × 480 resolution
12. Xubuntu
Support for 32-bit systems: Yes
Xubuntu is one of the official flavors of Ubuntu that features the lightweight Xfce desktop.
You will find it easy to use and can also install it on your older computers with no issues. Head to their official website to download the ISO (32-bit/64-bit) you need and get started.
Minimum system requirements for Xubuntu:
- RAM: 512 MB (1 GB recommended)
- Processor: Pentium Pro or AMD Athlon
11. Linux Mint Xfce
Support for 32-bit systems: Yes
If you have a decent hardware configuration (refer to the minimum requirements below), Linux Mint Xfce edition will be a great option to have.
While being an Ubuntu-based distro, it also features the Xfce desktop which makes it good enough for some old computers. Considering that Linux Mint as one of the best Linux distros, you can also try other editions (like Cinnamon) available.
Minimum system requirements for Linux Mint Xfce:
- 1GB RAM (2GB recommended).
- 15GB of disk space (20GB recommended).
- 1024×768 resolution
10. Peppermint
Support for 32-bit systems: Yes
Peppermint is a cloud-focused Linux distribution that doesn’t need high-end hardware. It is based on Ubuntu and uses LXDE desktop environment to give you a smoother experience.
Originally created with the web-centric approach of netbooks in mind, Peppermint includes the ICE application for integrating any website or web app as a standalone desktop app.
You’ll find the documentation helpful as well. A dedicated forum also exists to help troubleshooting issues and answering your questions.
Minimum system requirements for Peppermint OS:
- RAM: 1 GB of RAM (recommended 2 GB)
- CPU: Processor based on Intel x86 architecture
- Disk space: At least 4 GB of available disk space
You can get more information about Peppermint on its official website.
9. Lubuntu
Support for 32-bit systems: Yes (older versions)
Next on our list of best lightweight Linux distributions is Lubuntu. As the name suggests, a member of the Ubuntu family but it utilizes either LXDE/LXQT desktop environment. From Ubuntu 18.10 and above, you will find LXQT as the default desktop environment and could find LXDE as the default in its previous releases.
Lubuntu supports older computers that have been buried (Just kidding! You can also use Lubuntu on modern hardware). Lubuntu is one of the lightest derivatives of Ubuntu so it specializes in speed and the support for older hardware.
Lubuntu has fewer packages pre-installed consisting mostly of lightweight Linux applications.
Software and repositories are the same so you will get all the software that you were using on Ubuntu from their repositories. However, I’d suggest to always prefer to select an application that doesn’t consume a lot of system resources.
Minimum hardware requirements for Lubuntu:
- RAM: 1 GB of RAM
- CPU: Pentium 4 or Pentium M or AMD K8 or higher
8. Linux Lite
Support for 32-bit systems: Yes (older versions)
As the name suggests Linux Lite is a lightweight Linux distro that does not need high-end hardware to run it. Even a beginner will be able to use it on older computers easily. Linux Lite is based on Ubuntu LTS (Long Term Support) releases.
Even though it’s a lightweight distro – it comes baked with some essential tools.
For instance, you may find Firefox for web browsing, Thunderbird for emails, Dropbox for Cloud storage, VLC Media Player for Music, LibreOffice for office, Gimp for image editing and Lite tweaks to tweak your desktop. (this can change depending what version you’re using).
Considering that it is based on Ubuntu, you’ll have plenty of support and resources available online as you can follow the Ubuntu tutorials.
Minimum hardware requirements for Linux Lite:
- RAM: 768 MB RAM (recommended 1 GB)
- CPU: 1Ghz processor
- Display: VGA screen 1024×768 resolution (recommended VGA, DVI or HDMI screen 1366×768)
- Disk space: At least 8 GB free disk space
7. LXLE
Support for 32-bit systems: Yes
LXLE is actually a respin of the Lubuntu LTS version. Now that Lubuntu ships with LXQT by default, LXLE is a great option for users who want to use the LXDE desktop environment.
Despite being lightweight Linux distro, LXLE tries to provide an intuitive UI and eye candies. The system is tweaked to improve performance and comes with a wide range of lightweight applications installed by default.
Minimum hardware requirements for LXLE:
- RAM: 512 MB (recommended 1 GB)
- CPU: Pentium 3 (recommended Pentium 4)
- Disk space: 8 GB
6. CrunchBang++
Support for 32-bit systems: Yes (older versions)
CrunchBang++ is also known as CBPP or #!++ or CrunchBang Plus Plus. Crunchbang++ is the clone of Crunchbang Linux which has been discontinued.
CrunchBang++ supports old computers and runs without any issue. CrunchBang++ is based on Debian 10 with the minimal design interface.
Some of the default applications in Crunchbang++ at the time of writing this were Geany IDE, Terminator terminal emulator, Thunar File Manager, Gimp for image editing, Viewnior image viewer, VLC Media Player for music, Xfburn CD/DVD burning software, and so on.
It may not be the best one around for every user- but you can give it a try and see it yourself.
Minimum hardware requirements for CrunchBang++:
- RAM: 1 GB of RAM
- CPU: Pentium 4 or Pentium M or AMD K8 or higher
5. Bodhi Linux
Support for 32-bit systems: Yes (older versions)
Yet another light Linux distribution – Bodhi Linux, that gives life to older PCs & Laptops. Bodhi Linux is quite known for its minimal approach and the support for low-end hardware.
It doesn’t feature a lot of things pre-installed – hence, you will notice that the ISO file size will be less than 1 GB.
The presence of Moksh Desktop makes Bodhi Linux is a decent choice for older hardware configurations while providing a good user experience.
Minimum hardware requirements for Bodhi Linux:
- RAM: 256 MB of RAM
- CPU: 1.0 GHz
- Disk space: 5 GB of drive space
4. antiX Linux
Support for 32-bit systems: Yes
antiX is a lightweight Linux distribution based on Debian Linux. If you are looking for something that does not include systemd, this is a great option.
antiX also uses icewm window manager to keep the system running on low-end hardware. It doesn’t have much pre-installed software so the ISO file size is around 700 MB. You can always download and install more software later if you have access to an active internet connection.
Minimum hardware requirements for antiX Linux:
- RAM: 256 MB of RAM
- CPU: PIII systems
- Disk space: 5 GB of drive space
3. SparkyLinux
SparkyLinux is another lightweight distro but at the same time, it also targets modern computers.
Depending on what you need – you will find two variants of SparkyLinux. One based on Debian’s stable release and the other based on Debian’s testing branch. So, you can opt for anyone you see fit.
In addition to the variants, you will also find different editions of ISO to download. For instance, an LXQT desktop-based edition, a GameOver edition with pre-installed stuff, and so on.
You can head down to their download page and click on “Stable” or “(Semi-)Rolling” releases to find all the editions listed.
Minimum hardware requirements for SparkyLinux:
- RAM: 512 MB
- CPU: Pentium 4, or AMD Athlon
- Disk space: 2 GB (CLI Edition), 10 GB (Home Edition), 20 GB (GameOver Edition)
2. Puppy Linux
Support for 32-bit systems: Yes (older versions)
Puppy Linux can be booted live with either a CD/DVD/USB.
Puppy Linux uses JWM and Openbox window managers by default which makes it very easy on system resources.
Because Puppy Linux is built to be fast, it does not come along with bundles of applications. It does have some basic apps, though. In other words, it can get your work done if you want to utilize a really old computer.
Minimum hardware requirements for Puppy Linux:
- RAM: 256 MB
- CPU: 600 Hz Processor
1. Tiny Core
Probably, technically, the most lightweight distro there is. However, it isn’t a complete Linux distribution for an average desktop user.
Tiny Core simply incorporates the fundamental core of an OS which includes the kernel and the root filesystem. In other words, it features the foundation of a desktop OS.
If you simply want a system to boot up coupled with a wired Internet connection, you can get started using it. But, you should not expect proper hardware support out of the box.
So, if you’re someone who knows how to set up or compile tools necessary with Tiny Core Linux to make it a complete desktop experience, you can give it a try.
Minimum hardware requirements for Tiny Core Linux:
- RAM: 64 MB (128 MB recommended)
- CPU: i486DX
Also, if you’re curious about similar tiny/smallest Linux distros for your old hardware, here are some suggestions to take a look at:
Conclusion
Most of the Linux distros should be easy to install on older computers without any hassle. If you’re inclined for a good user experience, easy to use UI, and stability, there’s a lot of options in our list.
Don’t forget to tell me about your favorite Linux distributions in the comment below.
Like what you read? Please share it with others.
Источник