I'm running FreeBSD 9.2p13 with UFS and journaled softupdates.
Does anybody know how to tune softupdates journal on UFS?
There are no suitable information in handbook, man pages or sysctl description.
Thanks a lot in advance for any advice or point where I can read more about UFS journaled softupdates tuning.
My issue:
I have some scripts, parsing data, and store it in sophia db.
When a lot of small writes occuring, sometimes filesystem wedges, but disk load, that i could see through gstat, systat, vmstat etc. does not indicate disk or any other overload.
in messages I can see only this:
kernel: softdep: Out of journal space!
when I tried to find the reason I saw normal situation with dirhash and vnodes
sysctl -a | grep dirh
vfs.ufs.dirhash_reclaimage: 5
vfs.ufs.dirhash_lowmemcount: 2795
vfs.ufs.dirhash_docheck: 0
vfs.ufs.dirhash_mem: 141044
vfs.ufs.dirhash_maxmem: 27111424
vfs.ufs.dirhash_minsize: 2560
sysctl -a | grep vnodes
kern.maxvnodes: 1223926
kern.minvnodes: 305981
vfs.freevnodes: 305981
vfs.wantfreevnodes: 305981
vfs.numvnodes: 389262
when I tried to run ls to that filesystem terminal freezed, last strings from truss ls shows that:
...
lstat("work",{ mode=drwxr-xr-x
,inode=69662209,size=1024,blksize=32768 }) = 0 (0x0)
getdirentries(0x4,0x80100b000,0x1000,0x8010d9068,0xc94a8,0x0) = 0 (0x0)
lseek(4,0x0,SEEK_SET) = 0 (0x0)
maybe it will be significant info, but there are no description in sysctl:
debug.softdep.jwait_newblk: 104971
debug.softdep.jwait_inode: 16966
debug.softdep.jwait_freeblks: 0
debug.softdep.jwait_filepage: 736
debug.softdep.journal_wait: 122673
debug.softdep.journal_min: 1
debug.softdep.journal_low: 85056
UPDATE:
Thanks to @Kondibas for answer about tunefs!
Thanks to Vlad for pointing me to the right way :)
When I looked through the source /sys/ufs/ffs/ffs_softdep.c I found all remain answers to my questions.
this points me to situation when message occurs in system log:
/*
* Verify some free journal space. softdep_prealloc() should
* guarantee that we don't run out so this is indicative of
* a problem with the flow control. Try to recover
* gracefully in any event.
*/
while (jblocks->jb_free == 0) {
if (flags != MNT_WAIT)
break;
printf("softdep: Out of journal space!\n");
softdep_speedup();
msleep(jblocks, &lk, PRIBIO, "jblocks", hz);
}
Here I can see sysctl parameter to monitor situation about journal:
static int stat_journal_low; /* Times hit journal low threshold */
static int stat_journal_wait; /* Times blocked in jwait(). */
this parameters I can see in sysctl as:
sysctl debug.softdep.journal_wait
sysctl debug.softdep.journal_low
And here I can see some tunable parameters the sofdep behavior influenced by:
softdep_initialize()
{
int i;
LIST_INIT(&mkdirlisthd);
max_softdeps = desiredvnodes * 4;
pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, &pagedep_hash);
inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash);
newblk_hashtbl = hashinit(desiredvnodes / 5, M_NEWBLK, &newblk_hash);
bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash);