kmem crash - kernel panic freenas 8 stable

Status
Not open for further replies.

simonaic

Cadet
Joined
May 31, 2013
Messages
6
Hi,

I'm running FreeNAS-8.3.1-RELEASE-p2-x86 (r12686+b770da6)
with a 32bits CPU : Intel(R) Pentium(R) 4 CPU 2.80GHz
and 1GB of RAM : 1006MB

AMD64 release of freenas doesn't work on it. I need to use this machine.

Every time i'm writing on that server, it crash saying :

panic: kmem_malloc(131072): kmem_map too small: 335544320 total allocated
cpuid = 0
uptime: 1d0h5m40s

Here is what the system say :
[root@freenas] ~# sysctl -a|grep kmem_size
vm.kmem_size_scale: 3
vm.kmem_size_max: 335544320
vm.kmem_size_min: 0
vm.kmem_size: 335544320

I've seen that i have to edit the loader.conf file but I don't know the amount of kmem i do have to set.

Thanks!
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
ZFS requires a minimum of 6Gb of RAM.

Since you won't be able to use more the 4Gb of RAM with the 32 bit version, I'd switch to UFS. I *think* the minimum requirement for it, might be 2Gb.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
ZFS requires a minimum of 6Gb of RAM.

Since you won't be able to use more the 4Gb of RAM with the 32 bit version, I'd switch to UFS. I *think* the minimum requirement for it, might be 2Gb.

FreeNAS with ZFS typically requires a minimum of 8 GB of RAM in order to provide good performance and stability, and what you're seeing is --stability.

FreeNAS itself expects to have several gigabytes of memory available to work within, but for the most part, it can safely be dependent on swap to handle that, which allows the developers to focus on features rather than developing code that works on the smallest platforms possible. But FreeNAS also comes shipped tuned for a larger memory system... this is pretty much an obvious side effect of the need to have it work well out of the box for the intended targets. However, it ought to be possible to tune it to work, definitely for 4GB, maybe for 2GB, possibly even for 1GB, by carefully reading up on ZFS tuning for smaller memory systems. Some of the FreeBSD guys (including me) have had ZFS working on 1GB or sub-1GB systems. However, the best solution is to cram the thing full of RAM, or better, get a 64-bit platform and stick 8GB on.
 

simonaic

Cadet
Joined
May 31, 2013
Messages
6
FreeNAS with ZFS typically requires a minimum of 8 GB of RAM in order to provide good performance and stability, and what you're seeing is --stability.

FreeNAS itself expects to have several gigabytes of memory available to work within, but for the most part, it can safely be dependent on swap to handle that, which allows the developers to focus on features rather than developing code that works on the smallest platforms possible. But FreeNAS also comes shipped tuned for a larger memory system... this is pretty much an obvious side effect of the need to have it work well out of the box for the intended targets. However, it ought to be possible to tune it to work, definitely for 4GB, maybe for 2GB, possibly even for 1GB, by carefully reading up on ZFS tuning for smaller memory systems. Some of the FreeBSD guys (including me) have had ZFS working on 1GB or sub-1GB systems. However, the best solution is to cram the thing full of RAM, or better, get a 64-bit platform and stick 8GB on.

What if I use a UFS volume instead of ZFS?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
UFS/FFS has virtually no memory requirements - some of us remember running the earliest FreeBSD's on systems with 2MB or 4MB (MB not GB) of memory. The FreeNAS software, however, does require some amount of memory, in part because it loads memory filesystems into memory so that it can boot off a USB stick - this is by far the biggest thing which there *must* be memory for in a FreeNAS UFS system. Unless something has changed recently, it ought to be able to run UFS in 1GB.
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Was 6 Gb changed to 8 Gb recently? Or, was the change made in anticipation of v 9.1?

It had been 6GB plus a mashup of what I would refer to as "confusing additional qualifications and statements" which appeared to leave some users with the idea that 4GB or 6GB was OK or even ideal. What users are looking for in hardware recommendations: magic numbers. They just want to know how much they should have.

In 2006, 8GB of RAM was an onerous amount of RAM to require for something like ZFS, I want to say around $100-$150 per 1GB stick, so I can see wanting to right-size.

But FreeNAS 8 is a 2010-2011-era project. At the time, 8GB was still "a lot" of memory, but not as bad. Socket 1155 was new, those boards could handle 32GB, but the cost per stick for unbuffered 8GB modules was north of $1K *each*, about $5000 for 32GB of memory, but 4GB modules were dirt cheap (I want to say about $300 for 16GB of memory).

Today, a slotbuster set of DDR3-1600 for 1155 is $277 - still a price premium since I can put 64GB on a 2011 for ~$500.

So no one ought to be buying two 2GB modules and two 1GB modules (6GB) anymore because "they can't afford" 8GB. From a UNIX old-timer point of view, I'm still horrified by the idea that a fileserver requires 64MB(!) or more of RAM. But this is 2013. RAM is pretty cheap.

And we've seen this parade of users come to the forum with what *I* would call reasonable expectations that their "large memory" 4GB systems should be able to do ZFS, except I simultaneously understand that FreeNAS is designed for large systems, and the default tuning choices that make large systems work very well by default ... make small systems unstable.

Further, we've moved from v15 to v28, the FreeNAS middleware has grown larger, etc., etc., so what might have been OK two years ago, not so OK now.

So at that point, the documentation was what was broken, because it was failing to clearly and unambiguously scream "you need 8GB" at users. It isn't entirely true: a knowledgeable user can get by on less. But a knowledgeable user is much less likely to try in 2013, and probably doesn't need that guidance in the docs anyways.
 
Status
Not open for further replies.
Top