Swap pager getswapspace failed

+swap_pager_getswapspace(3): failed
+swap_pager_getswapspace(12): failed
+swap_pager_getswapspace(3): failed
+swap_pager_getswapspace(15): failed
+swap_pager_getswapspace(6): failed

Posted on 28 августа, 2014

И так на одной из тестовых виртуалок не хватает swap раздела.

то ли я пожадничал с выделением места, то ли слишком нагрузил

При загрузке mysql

Starting mysql.

смотрим командой

swapinfo

Device 1K-blocks Used Avail Capacity
/dev/da0p3 262144 251864 10280 96%

Всю память сжирает и соответственно прибивается ОС.

И так в логах

FreeBSD kerne l: swap_pager : out of swap space
Aug 28 15:41:51 FreeBSD kernel: swap_pager_getswapspace(16): failed
Aug 28 15:41:51 FreeBSD kernel: pid 801 (mysqld), uid 88, was killed: out of swap space

Попробуем увеличить swap

1. Создаем в директории / usr папку swap /

2.далее в нем создаем фаил командой

root@FreeBSD: /usr/swap # dd if=/dev/zero of=/usr/swap0 bs=1M count= 1024

где count кол-во выделенной памяти в данном случае мб.

bs — указывается единица измерения.

ждем пока создаст
1024+0 records in
1024+0 records out
1073741824 bytes transferred in 102.540987 secs (10471343 bytes/sec)

3. задаем права доступа на фаил

#chmod 0600 /usr/swap0

4. Добавляем в rc.conf путь до файла свопа

swapfile=»/usr/swap0»

странно но по манулу не сработало.

у меня установлена 10 версия FreeBSD Release

добавил в rc.conf

ту же строчку что и при загрузке в ручную

mdconfig -a -t vnode -f /usr/swap/swap0 -u 0 && swapon /dev/md0

была какая то ругать в логах. но все равно фаил подкачки создался и работает.

Так же вручную прописываем

mdconfig -a -t vnode -f /usr/swap/swap.file -u 0 && swapon /dev/md0

смотрим

swapinfo
Device 1K-blocks Used Avail Capacity
/dev/da0p3 262144 4948 257196 2%
/dev/md0 1048576 0 1048576 0%
Total 1310720 4948 1305772 0%

появилось новое устройство с 1 гб.памяти.

junior466

Newbie

Today I logged in to FreeNAS and was greeted with a ton of these messages in log:

freenas swap_pager_getswapspace: failed

I started doing some research and it appears that most people that have these issues are running either jails or Virtual machines. I am not running neither and simply have some shares mounted on a few virtual machines on a couple ESXi hosts.

Here’s a screenshot of the memory section of the reporting tab:

My system specs:

Build FreeNAS-11.1-U6
Platform Intel(R) Xeon(R) CPU E5-2403 0 @ 1.80GHz
Memory 16GB

Any help would be greatly appreciated.

jgreco

Res > Moderator

It’d be helpful if you posted a lot more information about your system and setup. NFS? iSCSI? Pool config? Etc.?

In general, 16GB is a bit shy for block storage.

junior466

Newbie

It’d be helpful if you posted a lot more information about your system and setup. NFS? iSCSI? Pool config? Etc.?

In general, 16GB is a bit shy for block storage.

jgreco

Res > Moderator

Ah, I misread your initial post as "mounted for a few virtual machines."

I’ll let someone else ponder SMB issues. It looks like something momentarily maxxed out your system’s memory. It would be worthwhile to review the logs for clues as to whether something launched right at the time swap usage started to skyrocket.

junior466

Newbie

Ah, I misread your initial post as "mounted for a few virtual machines."

I’ll let someone else ponder SMB issues. It looks like something momentarily maxxed out your system’s memory. It would be worthwhile to review the logs for clues as to whether something launched right at the time swap usage started to skyrocket.

@jgreco — It happened again and after further investigation, I was greeted with this in the log:

Is it safe to assume that I maxed out the smbd service and need to consider adding more memory? I have a few servers that heavily depend on the smbd service.

jgreco

Res > Moderator

@jgreco — It happened again and after further investigation, I was greeted with this in the log:

Is it safe to assume that I maxed out the smbd service and need to consider adding more memory? I have a few servers that heavily depend on the smbd service.

No, it means the system ran out of memory, swapped a bunch of stuff to swap, and then was still (maybe later, eventually, etc) out of memory. When that happens, FreeBSD will kill semi-arbitrary processes, not necessarily the one actually causing the problem.

Therefore it is not safe to assume that it was smbd causing the problem. It would be nice to know what the problem is, and you might want to consider setting up a little shell script cron to periodically snapshot the process list, so that you can look back. This would be the "best" path forward.

Adding more memory is likely to either reduce the frequency or eliminate the issue, depending on whether you are experiencing some sort of memory leak, insufficient amount of memory to begin with, etc. Without knowing the offender it is hard to provide any answer that is more accurate than just tossing darts at a dartboard.

junior466

Newbie

No, it means the system ran out of memory, swapped a bunch of stuff to swap, and then was still (maybe later, eventually, etc) out of memory. When that happens, FreeBSD will kill semi-arbitrary processes, not necessarily the one actually causing the problem.

Therefore it is not safe to assume that it was smbd causing the problem. It would be nice to know what the problem is, and you might want to consider setting up a little shell script cron to periodically snapshot the process list, so that you can look back. This would be the "best" path forward.

Adding more memory is likely to either reduce the frequency or eliminate the issue, depending on whether you are experiencing some sort of memory leak, insufficient amount of memory to begin with, etc. Without knowing the offender it is hard to provide any answer that is more accurate than just tossing darts at a dartboard.

Thanks for your reply. That makes sense. I’ve noticed my Nextcloud server acting up recently so I suspect it may have something to do with it since it uses one of the shares through smbd.

I will keep an eye on it but unfortunately I don’t have the skills necessary to setup a script as you suggested.

Читайте также:  Usb vid 0489 pid e00f rev 0596

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *