High swap space usage windows

Нехватка памяти на сервере

Не так давно я создавал тред, где переживал что апач с одним единственным сайтом из хмтл страничек отжирает всю память на серваке. Меня успокоили, что он отжирает свободную память под кеш, что свободная память все равно никак не используется и как только она понадобится, то апач мне её вернет. Прошло несколько месяцев, сервер никто не трогал. Сегодня установил zabbix и он сразу же выдал мне сообщение о проблеме Lack of free swap space on Zabbix server. Получается память для него так и не освободилась? Как с этим боротся? Не может же быть такого, что apache2 со статическим сайтом + zabbix отжирают 2 гигабайта оперативки?

Не ужеле не можете посмотреть, кто сколько памяти отжирает?

Судя по выводу free — cвоп у вас не подключен\отсутствует, соответственно свободного пространства в нем 0.

Апач всё отжирает. Поидее он должен отжирать неиспользуемую память для убыстрения работы, но вот сейчас память нужна, а он её не отдает

Lack of free swap space (Отсутствие свободного пространства подкачки)

Не может же быть такого, что apache2 со статическим сайтом + zabbix отжирают 2 гигабайта оперативки?

Вот сколько памяти у тебя занято приложениями.

Странно, VPS машину создали без свапа получается? теперь вручную его пилить

Как быстро выяснить какой процесс в Linux использует пространство подкачки (swap)

Заметка очень короткая и призвана администраторам помочь быстро найти процессы которые максимально используют пространство swap. Что делать с этими процессами — это уже отдельная тема, главное найти кто потребляет swap.

Исходные данные: ОС Oracle Linux 7;
Задач: Найти потребителя SWAP

Типичная ситуация на сервере с системой мониторинга — это аларм вида:
prod-srv-01 Low free swap space (free: 0.15 %, threshold: 10%, alert started: 8.79 %)

Вначале немного теории, о том как получить информацию о распределении памяти процессами в Linux.

  • /proc/meminfo — псевдо-файл который сообщает статистику об использовании памяти в системе. Вы также можете использовать утилиты free, vmstat и другие инструменты, чтобы узнать ту же информацию;
  • /proc/$/smaps, /proc/$/status и /proc/$/stat — используйте эти псевдо-файлы для поиска информации о потреблении памяти каждым процессом ($ замените на номер процесса);
  • Читайте также:  Восстановление windows 10 при помощи загрузочной флешки
  • smem — утилита (скрипт python), которая поможет вывести информацию в более удобном виде;

    Теперь идем на сервер и смотрим:

    Мы видим, что swap заполнен на 100% — это плохо.

    Попробуем быстро выяснить кто основной потребитель, для этого обратимся к /proc/*/status
    Ниже простой сценарий на bash который выдаст нам список потребителей swap:

    Результат будет длинным, я покажу только TOP потребителей:

    Мы видим, что основной потребитель — это процесс ora_j001_bs. На сервере установлен Oracle и один из процессов потребляет swap.
    На втором месте мы видим процесс rsyslogd — думаю он в представлении не нуждается.

    Если на потребителя №1 мы не можем повлиять быстро, то на потребителя №2 (rsyslogd) можем — это попытаться его перазапустить.

    Выполняем перезапуск rsyslogd:

    И смотрим состояние swap:

    Мы видим, что стало доступно 1.6 GB, а это уже более 30% от размера swap, что вполне нас должно устроить на первое время.

    На этом все, до скорых встреч. Если у Вас возникли вопросы или Вы хотите чтобы я помог Вам, то Вы всегда можете связаться со мной разными доступными способами.

    High memory usage with little swap space used

    I have 8Gb usable memory and 10Gb swap space available

    My memory usage is 90-95% used while only +/- 1gb swap space is used.

    Do I misunderstand the purpose of swap space or is there some issue on my side?

    2GB. I cannot and will not compare it to Windows and it’s irrelevant for your question. In it you seem to imply you should be having more swap used which is nonsense. And the list you gave can easily take that much memory and more. FYI, any modern web browser will gulp as many as it can and what the tabs are matters way more than how many they are. – user589808 Oct 5 ’16 at 12:32

    1 Answer 1

    If you’d run the top command, you’d see something in line with this:

    In this particular case, we have 32 gigs of RAM, of which just 172 MiB is shown as «free».
    We do not have swap at all in our case.

    Yet, to calculate the «real» free memory, add «cached Mem» to «free» and you would see that almost all of the memory is free.
    The trick is that «cached Mem» is basically disk cache — Linux would use most of available free memory just for that to speed up disk operations. Do not worry — should a necessity for extra memory arise, Linux can instantly reduce the disk cache and use that for whatever purposes are needed. You only need to start worrying once both «free» and «cached Mem» are very small — that would mean you probably need a RAM upgrade to keep things running smoothly.

    Читайте также:  Windows 10 не восстанавливается с диска

    As to swap, I would agree with the previous replies that you don’t want to use it in vain in cases where you have plenty of RAM. And 8 gigs are plenty for a desktop, if you are not using some heavy graphics processing software or such.

    How to increase swap memory in Windows? [duplicate]

    I bought a new system with 4 GB of RAM. I don’t know how do I check how much swap memory I have allocated. I know that we can increase RAM physically. I want to increase swap memory on windows. How can I increase swap memory? Is that possible?

    3 Answers 3

    Taken directly from the documentation, which is the first Google result for «windows change swap space»:

    Open System by clicking the Start button Picture of the Start button, right-clicking Computer, and then clicking Properties.

    In the left pane, click Advanced system settings. Administrator permission required If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.

    On the Advanced tab, under Performance, click Settings.

    Click the Advanced tab, and then, under Virtual memory, click Change.

    Clear the Automatically manage paging file size for all drives check box.

    Under Drive [Volume Label], click the drive that contains the paging file you want to change.

    Click Custom size, type a new size in megabytes in the Initial size (MB) or Maximum size (MB) box, click Set, and then click OK.

    This applies to Windows 7, 8, and all earlier versions back to at least XP. The procedure hasn’t changed in over a decade.

    “Lack of free swap space” on Windows Server

    I have several Windows Server 2012 Virtual Machines, which are monitored by zabbix 2.4. The zabbix throws «Lack of free swap space» for some VMs, but there are disk and memory free on these machines, and the Virtual Memory is set to OS Control on Windows.

    Читайте также:  Will java run on windows 10

    What means «Lack of free swap space» on Windows Server? It’s disk space? RAM? Virtual Memory?

    How can I resolve it?

    3 Answers 3

    I have just resolved my item with the same error. It is related to the windows page file and in my case it was configured to be automatically managed by windows.

    In my situation Windows didn’t think it wanted a higher swap space and wasn’t taking out more space but it was at 0 remaining so zabbix was reporting the error. I have chosen to move to a custom page file size — just remember to hit set prior to saving as it won’t always retain after a reboot.

    System -> Advanced System Settings -> Advanced Tab -> Performance Settings -> Advanced Tab and changed to use a manual page file rather than the system allocated page file

    That is one solution for the problem. Unfortunately for us, we have many Windows servers and leave their pagefile (swap space) to be managed by Windows.

    When Windows manages the pagefile, it leaves the pagefile size alone even sometimes filled with 0 bytes free until some program requests more memory and then if it has space on the pagefile drive, it will grow the size of the pagefile providing more free pagefile space.

    This confuses the «simple» Zabbix alarm. It sees, for example, a 1.7GB page file with 0 bytes free and throws an alarm. It didn’t see that Windows was managing the pagefile and the drive had plenty of disk space available for pagefile growth.

    It’d be great if Zabbix could (psuedo code follows): IF «Windows is managing the pagefile» THEN IF pagefile free space % is lower than threshold AND drive containing pagefile has less free space than 2nd threshold THEN throw trigger (send alarm) ELSE #assumes fixed pagefile size on a drive IF pagefile free space % is lower than threshold THEN throw trigger (send alarm) FI

    This trigger complexity is beyond my Zabbix skill rating. If anyone has suggestions on how to implement this it would greatly help. (We chase 4 to 5 production level swap space alarms each day. Correction, ignore. Which scares us and should scare Zabbix developers. Crying wolf is not a good thing.)

  • Оцените статью
    Adblock
    detector