cancel
Showing results for 
Search instead for 
Did you mean: 

Kernel memory planing

SOLVED
Go to solution

Kernel memory planing

Hello,

I have a V2250:
6 CPU??s x 240 MHz
6 GB of Memory

And I need up some parameters of the Kernel ( nfile, nproc ... ), but when I up this parameters, the Kernel don??t Start on boot, and my machine have a Panic.

The maximun value of this parameter is the memmory limit, and I'd like to know how to calculate the memory utilization by kernel.

My kernel have this parameter now:
Parameter Value
===============================================================================
NSTRBLKSCHED 2
NSTREVENT 50
NSTRPUSH 16
NSTRSCHED 0
STRCTLSZ 1024
STRMSGSZ 65535
acctresume 4
acctsuspend 2
aio_listio_max 256
aio_max_ops 2048
aio_physmem_pct 10
aio_prio_delta_max 20
allocate_fs_swapmap 0
alwaysdump 0
bootspinlocks 256
bufcache_hash_locks 128
bufpages 0
chanq_hash_locks 256
create_fastlinks 0
dbc_max_pct 5
dbc_min_pct 2

I'd like to up the MAXUSERS to 500, and the nproc, nfile and others up respectivily.
8 REPLIES

Re: Kernel memory planing

All parameters:


Parameter Value
===============================================================================
NSTRBLKSCHED 2
NSTREVENT 50
NSTRPUSH 16
NSTRSCHED 0
STRCTLSZ 1024
STRMSGSZ 65535
acctresume 4
acctsuspend 2
aio_listio_max 256
aio_max_ops 2048
aio_physmem_pct 10
aio_prio_delta_max 20
allocate_fs_swapmap 0
alwaysdump 0
bootspinlocks 256
bufcache_hash_locks 128
bufpages 0
chanq_hash_locks 256
create_fastlinks 0
dbc_max_pct
dbc_min_pct 2
default_disk_ir 1
desfree 0
disksort_seconds 0
dnlc_hash_locks 64
dontdump 0
dskless_node 0
dst 1
eisa_io_estimate 0x300
eqmemsize 15
fcp_large_config 0
file_pad 10
fs_async 1
ftable_hash_locks 64
hdlpreg_hash_locks 128
hfs_max_ra_blocks 8
hfs_ra_per_disk 64
hpux_aes_override 0
initmodmax 50
io_ports_hash_locks 64
iomemsize 40000
km_disable 0
ksi_alloc_max (NPROC*8)
ksi_alloc_max (NPROC*8)
ksi_send_max 32
lotsfree 0
max_async_ports 50
max_fcp_reqs 512
max_mem_window 0
max_thread_proc 256
maxdsiz 0X3BC00000
maxdsiz_64bit 0x0000000040000000
maxfiles 2048
maxfiles_lim 2048
maxqueuetime 0
maxssiz 0X04FB3000
maxssiz_64bit 0x00800000
maxswapchunks 7854
maxtsiz 0X10000000
maxtsiz_64bit 0x0000000040000000
maxuprc ((NPROC*9)/10)
maxusers 400
maxvgs 80
mesg 1
minfree 0
modstrmax 500
modstrmax 500
msgmap (MSGTQL+2)
msgmax 32768
msgmnb 65535
msgmni (NPROC)
msgseg 32767
msgssz 128
msgtql (NPROC*10)
nbuf 0
ncallout 4004
ncdnode 150
nclist (100+16*MAXUSERS)
ncsize (NINODE+VX_NCSIZE)
ndilbuffers 30
netisr_priority -1
netmemmax 0
nfile (5*NPROC+2048)
nflocks (NPROC)
nhtbl_scale 0
ninode (8*NPROC+2048)
nkthread 2048
nni 2
no_lvm_disks 0
nproc ((MAXUSERS*3)+64)
npty 60
nstrpty 60
nstrtel (MAXUSERS)
nswapdev 25
nswapfs 10
nsysmap ((NPROC)>800?2*(NPROC):800)
nsysmap64 ((NPROC)>800?2*(NPROC):800)
num_tachyon_adapters 5
o_sync_is_o_dsync 0
page_text_to_local 0
pfdat_hash_locks 128
public_shlibs 1
region_hash_locks 128
remote_nfs_swap 0
rtsched_numpri 32
scroll_lines 100
scsi_max_qdepth 8
scsi_maxphys 1048576
sema 1
semaem 16384
semmap (SEMMNI+2)
semmni (NPROC*5)
semmns (SEMMNI*2)
semmnu (NPROC-4)
semume 64
semvmx 32768
sendfile_max 0
shmem 1
shmmax 0X130000000
shmmni 512
shmseg 32
st_ats_enabled 1
st_fail_overruns 0
st_large_recs 0
streampipes 0
swapmem_on 0
swchunk 2048
sysv_hash_locks 128
tcphashsz 0
timeslice 10
timezone 420
unlockable_mem (MAXUSERS*10)
vnode_cd_hash_locks 128
vnode_hash_locks 128
vps_ceiling 16
vps_chatr_ceiling 65536
vps_pagesize 4
vx_maxlink 32767
vx_ncsize 1024
vx_ninode 0
vx_noifree 0
vxfs_max_ra_kbytes 1024
PIYUSH D. PATEL
Honored Contributor

Re: Kernel memory planing

Hi,

I recommend to change the maxusers value.

nfile's value is based on several other parameters. My preference is to increase 'maxusers' since increasing maxusers impacts 'nproc' and both impact 'nfile'.

You can try changing the maxusers to 500.
Use SAM to do it.

Why are you trying to increase these parameters ?? Any problems ??


Piyush
PIYUSH D. PATEL
Honored Contributor

Re: Kernel memory planing

Formula for nfile is

(16*(NPROC+16+MAXUSERS)/10+32+2*(NPTY+NSTRPTY+NSTRTEL)).

Piyush
James Murtagh
Honored Contributor

Re: Kernel memory planing

Hi,

Not really sure what you are asking but I'll try and answer the best I can....

Most parameters such as nproc are (C) structures which allow more entries in the kernel tables. To find out the size of an individual structure, you can write some C code or use q4....

HPUX 11i

ied /usr/contrib/bin/q4 /stand/vmunix /dev/kmem

sizeof (struct proc)
02300 1216 0x4c0

So each time you increment nproc by one you will using 1216 bytes of kernel memory.

Also, a lot of these parameters are not memory limited, but architecture limited. Again, for nproc, PA-RISC 2.0 (mainly 64bit)defined 22 bits for the Space ID for processes, so the maximum number of processes is 2^22 = 4194304.
You can compare this against the maximum in /usr/conf/master.d/core-hpux.

And finally, looks like you are not building the kernel properly! To do this, following these steps....

cd /stand/build
/usr/lbin/system_prep -s system
kmtune -s nproc= -S system
mk_kernel -s system
cp ../system ../system.prev
cp system ../system
kmupdate

Then reboot your server for the changes to take place.

Hope this helps.
James Murtagh
Honored Contributor
Solution

Re: Kernel memory planing

Hi,

Sorry, should have added a few more things.

The kernel build I did was only an example. If you want to increase maxusers to increase the others that is probably better. If you are doing this, getting no errors from the kernel build and the server is not booting still, check the size of the newly created kernel and even compare it to the running kernel...

ie.

size /stand/build/vmunix_test
size /stand/vmunix

I know the V-Class has problems when this is too big, over 100 MB I think but could be wrong. The best bet in this case, if everything else looks OK is to contact a V-Class expert at HP.

Also, in terms of the kernel memory example, most structure names can be found in the include directories, ie /usr/include....and yes, a lot are memory limited as you said, but check core-hpux for the defined limits.

Re: Kernel memory planing

Thanks for your help!

Thanks for 100MB of the maxinum size of the vmunix file, it's very important for me!
But I'd like do know what is the maximun memory utilization by kernel?

Exemple:

If nfile = 200
Memory aloc by nfile is 20K

If nproc = 20
Memory aloc by nproc is 10k

Total memory alocated by kernel is: 30k.

It??s possible to calc?

James Murtagh
Honored Contributor

Re: Kernel memory planing

Hi,

It really depends what you mean....

Kernel memory is the kernel, kernel allocatable memory, it's uarea, filesystem buffer cache and IO space.

For example :

The kernel memory you already seen from the size command.

The allocatable memory is much harder to calculate. HP has a tool name "kmeminfo" they should be able to send you, which lists all kernel buckets in use etc.

Buffer cache usage can be calculated using :

echo bufpages/D | adb -k /stand/vmunix /dev/kmem

bufpages:
bufpages: 12418

So I am using 12418*4K ~ 50MB buffer cache.

This all adds up to kernel memory, although I expect your question really regards the size of the kernel object and the output from kmeminfo?
James Murtagh
Honored Contributor

Re: Kernel memory planing

Also, even easier than the command line stuff I have been showing is if you have glance, you can check the memory report and see the value of "Sys Mem". This is (most) system memory but doesn't include the buffer cache, but this is listed beside it.