Out of Swap Space Constantly

Hi Everybody

Im new here, and i´m searching for help with my truenas core.
The system is a VM truenas core running in a synology box, it have 2 years since we configurate the system and since the first run we dont have a major problem.
But since 2 month ago (maybe a little more) the system are having problems with the swap running out of space, and sometimes it hung and we have to do a force shutdown.

The truenas have a 22 GB ECC Memory Ram, and have 2 pools, one with a 71 TB and the other with 120 TB, CPU is a Westmere X56xx and the TrueNAS version is 13.0-U6.1 the system is only for file share through the SMB and rsync to do a mirror of the file to other VM truenas with same specs.

Thanks for any helping hand in this!

Can you run top in an SSH session, then type

o
swap
<ENTER>

(“o” for “order”)

That should show you the process consuming the most swap space on top of the list.

Thanks for the reply

This is the output for the TOP

and this is the output for TOP -w

Do you mean you are running TN Core as a VM on top of a Synology DS or RS?

Or

That you have replaced Synology DSM with TrueNAS Core? If you are then you are the first person I have heard of doing that

Please post your hardware and specifiy how you are running Core?

Yes, i mean im running TN Core as a VM on top of a Synology DS, in that time that was the only way i found to migrate from an old freenas to the new box.
Im running the native app of DSM Virtual Machine Manage to run the VM TN Core, and it was configurate (the VM) with 22 GB Ram, 3 VM Disk.

Wow - I would describe that as “Brave”

What DS?

While Synology DSM doesn’t speak ZFS - you are running virtual disks (a big No No) on a (I imagine) untested hypervisor and are deep into uncharted territory.

1 Like

@alvaro_robles Have you tried upping the RAM in the TrueNAS VM? How many SMB clients are being served?

General Advice
Virtualize TrueNAS

Yes, now i know that (2 years befores dont know this jejeje)

@SmallBarky the DSM have 32 GB of total RAM, 22 of that is for the TN and the other 10 is available in DSM.
Do you think increasing the RAM is the best?
DSM Virtual Machine Manager dont have to much options when you are setting up a VM, so i dont know (maybe not) if the system have HBA directly.
Im strongly thinking to set up the old FreeNAS Box to backup all the data on this TN and make the FreeNAS as the production Box, but is to many data to backup, any recommend to make the backup as quickly as possible?

Is there a reason for sticking with 13.0u1 and not upgrading to the latest 13.0u6 or 13.0u7?

It doesn’t seem like you have much RAM to work with. I am guessing the DSM needs some of that to run itself. Can the RAM be expanded, doubled to 64GB, for example?

Were there any changes up to the time you started to have this problem? Did you get a lot more SMB clients accessing the machine? How full are the pools?

im in the 13.-U6.1 for the moment, the reason to not upgrade to U7 (for the moment) is for the use of this box, this box usually if busy all the time.

for the moment i cant chose the memory increase to 64 GB casue for the money recorts

Weren´t any change in the box at the time we started to have problems, the smb clients accesing the box is the same (maybe 1 or 2 more, usually we have till 50 clients connected at the same time).
The pools are at his 40% on one and 50% at the other pool.

Can you post the all the hardware details of your Synology machine. Model number, installed RAM, hard drives (model and size), what kind of networking, etc.

Also post your setup of your TrueNAS. I know you posted some details but it may help to know how the VDEVs and pools are set up inside.

You can use screenshots of the GUI windows if it helps explain. I use the Snipping Tool in Window 10 or 11 to create and post images. It lets you select just parts of your screen.

sure.
DSM is a RS4021xs+ DSM Version 7.2-64570, a intel xeon D-1541 2.1 GHZ witch 8 cores for the CPU, 32 GB Ram, with 16 disks of 16 TB each one, disk model HAY5300-16T, for the network im using the 6 network ports as a bond for dinamyc link aggregation.

For the TN Core, i will atach some screenshots

My recommendation is to max your RAM to 64GB (2x16GB DDR4 ECC sticks are dirt cheap used, or you can get them cheap new on Aliexpress) The raise your VM’s RAM to 54GB and disable swap completely. (It is not even really used in any Linux distros any more.) If you stick to keep swap, you should use at least half of the size of your RAM in the machine. Since you have a ton of HDD space, you can easily allocate a 128GB swap drive if you like)

1 Like

Thanks Gyula, cause for the momento i cant raise the RAM, i prefer to increase the swap temporally, but how can increase swap?

Well, I dont really know, since I never use it.
If you have an old HDD lying around and a free sATA port, you might add it to the system, and tell it to use as swap. But, I am not confident, you can do that with TrueNAS…

He has his system virtualized on a Synology DS or DR machine using DSM (disk station manager?).
It is a production system with at least 50 SMB users and does backups?

I browses older forum posts and to sum them up…add RAM. Swap usage was okay for a minor task but if you hit it regularlly, add the RAM.

I don’t know how TrueNAS is adding or attaching swap as I tried looking at FreeBSD documentation and, I think, TrueNAS is handling it a bit different as to when and where it is attached upon startup, etc.

I looked at my Core 13u7 boot disk and my swap partition is larger that what is currently allocated, by TrueNAS default. I also have a swap partion on my single data disk. I am not certain if Core is using the boot pool swap or the data disk swap.

I wasn’t going to recommend any changes, besides adding RAM, since production.

1 Like