Buffer Waits Ratio
Posted in 1999
Topics: High Availability & Replication, Backup & Restore, Storage & Space Management, Server Administration, Transactions, Locking & Isolation, Logging & Checkpoints, Networking & sqlhosts Configuration
Friends,
Informix Version: 7.30 FC7
OS: HPUX 11.0
Hardware: HP9000 Series 800 V2500
Disk Array: EMC 3700
Application: OLTP (strictly database server)
Misc. 16 CPU, 8GB mem, 2 instances
I've been making use of the bufwait ratio formula [ratio = (bufwaits /
(pagreads + bufwrits)) * 100] on my production servers. During normal day
to day usage it hovers at around 15%. I know the ideal target is 10%.
During heavy activity in the afternoon I have seen measurements of >25%. I
plan to increase BUFFERS,LRUS and CLEANERS and maybe NUMCPUVPS. I would
appreciate if you guys/gals confirm my plan and also have a look at my
onconfig file and recommend any improvements.
Informix recommends 4 LRUS per NUMCPUVPS (Admin Guide Vol2 33-45)
I have 6 CPUVPS, 28 LRUS (whoops) looking after 100000 BUFFERS, each LRU is
looking after approximately 7000 pages.
So, my questions are;
1) Should I conform to the 4 LRUS/NUMCPUVPS?
2) Is 7000 BUFFERS a high/low number of pages for each LRU, is there an
optimized target?
Also, could someone explain to me why the formula uses pagreads and not
bufreads.
#**************************************************************************
#
# INFORMIX SOFTWARE, INC.
#
# Title: onconfig.prod
# Description: Informix Dynamic Server Configuration Parameters
#
#**************************************************************************
# Root Dbspace Configuration
ROOTNAME rootdbs # Root dbspace name
ROOTPATH /dev/ifn_110001 # Path for device containing rootdbspace
ROOTOFFSET 0 # Offset of root dbspace into device
(Kbytes)
ROOTSIZE 200000 # Size of root dbspace (Kbytes)
# Disk Mirroring Configuration Parameters
MIRROR 1 # Mirroring flag (Yes = 1, No = 0)
MIRRORPATH # Path for device containing mirrored root
MIRROROFFSET 0 # Offset into mirrored device (Kbytes)
# Physical Log Configuration
PHYSDBS plogdbs # Location (dbspace) of physical log
PHYSFILE 49890 # Physical log file size (Kbytes)
# Logical Log Configuration
LOGFILES 100 # Number of logical log files
LOGSIZE 5000 # Logical log size (Kbytes)
# Diagnostics
MSGPATH /home/informix/log/ccd.log # System message log file
path
CONSOLE /dev/console # System console messagepath
ALARMPROGRAM /opt/informix_7.30/etc/no_log.sh # Alarm program path
SYSALARMPROGRAM /opt/informix_7.30/etc/evidence.sh # System Alarm
program path
TBLSPACE_STATS 1
# System Archive Tape Device
#TAPEDEV /dev/null # Tape device path
TAPEDEV /dev/rmt/c11t1d0BESTb # Tape device path
#TAPEDEV /dev/rmt/c11t2d0BESTb # Tape device path
TAPEBLK 64 # Tape block size (Kbytes)
TAPESIZE 71303168 # Maximum amount of data to put on
tape (Kbytes)
# Log Archive Tape Device
#LTAPEDEV /dev/null # Log tape device path
LTAPEDEV /prod/informix/llogs/ccd/llog.today # Log tape
device path
LTAPEBLK 64 # Log tape block size (Kbytes)
LTAPESIZE 2048000 # Max amount of data to put on log tape
(Kbytes)
# Optical
STAGEBLOB # Informix Dynamic Server/Optical staging
area
# System Configuration
SERVERNUM 13 # Unique id corresponding to a DynamicServer instance
DBSERVERNAME cortran0 # Name of default database server
DBSERVERALIASES cortran1 # List of alternate dbservernames
NETTYPE soctcp,1,100,NET # Configure pollthread(s) for nettype
DEADLOCK_TIMEOUT 60 # Max time to wait of lock in distributed
env.
RESIDENT 1 # Forced residency flag (Yes = 1, No = 0)
MULTIPROCESSOR 1 # 0 for single-processor, 1 formulti-processor
NUMCPUVPS 6 # Number of user (cpu) vps
SINGLE_CPU_VP 0 # If non-zero, limit number of cpu vps toone
NOAGE 0 # Process aging
AFF_SPROC 0 # Affinity start processor
AFF_NPROCS 0 # Affinity number of processors
# Shared Memory Parameters
LOCKS 400000 # Maximum number of locks
BUFFERS 100000 # Maximum number of shared buffers
NUMAIOVPS 24 # Number of IO vps
PHYSBUFF 64 # Physical log buffer size (Kbytes)
LOGBUFF 64 # Logical log buffer size (Kbytes)LOGSMAX 1024 # Maximum number of logical log files
CLEANERS 24 # Number of buffer cleanerprocesses
SHMBASE 0x0 # Shared memory base address
SHMVIRTSIZE 500000 # initial virtual shared memory segment size
SHMADD 65536 # Size of new shared memory segments
(Kbytes)
SHMTOTAL 2000000 # Total shared memory (Kbytes). 0=>unlimited
CKPTINTVL 180 # Check point interval (in sec)
LRUS 28 # Number of LRU queues
LRU_MAX_DIRTY 2 # LRU percent dirty begin cleaning limit
LRU_MIN_DIRTY 1 # LRU percent dirty end cleaning limit
LTXHWM 50 # Long transaction high water markpercentage
LTXEHWM 60 # Long transaction high water mark
(exclusive)
TXTIMEOUT 300 # Transaction timeout (in sec)
STACKSIZE 256 # Stack size (Kbytes)
# System Page Size
# BUFFSIZE - Dynamic Server no longer supports this configuration parameter.
# To determine the page size used by Dynamic Server on your
platform
# see the last line of output from the command, 'onstat -b'.
# Recovery Variables
# OFF_RECVRY_THREADS:
# Number of parallel worker threads during fast recovery or an offline
restore.
# ON_RECVRY_THREADS:
# Number of parallel worker threads during an online restore.
OFF_RECVRY_THREADS 10 # Default number of offline worker threads
ON_RECVRY_THREADS 1 # Default number of online worker threads
# Data Replication Variables
# DRAUTO: 0 manual, 1 retain type, 2 reverse type
DRAUTO 0 # DR automatic switchover
DRINTERVAL 30 # DR max time between DR buffer flushes (in
sec)
DRTIMEOUT 30 # DR network timeout (in sec)
DRLOSTFOUND /prod/informix/infxdump/ccd.found # DR lost+found filepath
# CDR Variables
CDR_LOGBUFFERS 2048 # size of log reading buffer pool (Kbytes)
CDR_EVALTHREADS 1,1 # evaluator threads (per-cpu-vp,additional)
CDR_DSLOCKWAIT 5 # DS lockwait timeout (seconds)
CDR_QUEUEMEM 4096 # Maximum amount of memory for any CDR queue
(Kbytes)
# Backup/Restore variables
BAR_ACT_LOG /prod/informix/infxdump/ccd/bar_act.log
BAR_MAX_BACKUP 15
BAR_RETRY 1
BAR_NB_XPORT_COUNT 10
BAR_XFER_BUF_SIZE 31
# Informix Storage Manager variables
ISM_DATA_POOL ISMData # If the data pool name is changed, be sure
to
# update $INFORMIXDIR/bin/onbar. Change to
# ism_catalog -create_bootstrap -pool <new
name>
ISM_LOG_POOL ISMLogs
# Read Ahead Variables
RA_PAGES 10 # Number of pages to attemptto read ahead
RA_THRESHOLD 5 # Number of pages left before next group
# DBSPACETEMP:
# Dynamic Server equivalent of DBTEMP for SE. This is the list of dbspaces
# that the Dynamic Server SQL Engine will use to create temp tables etc.
# If specified it must be a colon separated list of dbspaces that exist
# when the Dynamic Server system is brought online. If not specified, or if
# all dbspaces specified are invalid, various ad hoc queries will create
# temporary files in /tmp instead.
DBSPACETEMP tempdbs1,tempdbs2,tempdbs3,tempdbs4 # Default
temp dbspaces
# DUMP*:
# The fo
At least some of this question asks why the bufwaits ratio formula is what
it is. Since I developed the formula I guess I should answer. Read on:
"Henderson, Scott" wrote:
>
> Friends,
>
> Informix Version: 7.30 FC7
> OS: HPUX 11.0
> Hardware: HP9000 Series 800 V2500
> Disk Array: EMC 3700
> Application: OLTP (strictly database server)
> Misc. 16 CPU, 8GB mem, 2 instances
Awesome platform (he said jealously).
> I've been making use of the bufwait ratio formula [ratio = (bufwaits /
> (pagreads + bufwrits)) * 100] on my production servers. During normal day
> to day usage it hovers at around 15%. I know the ideal target is 10%.
Not good.
> During heavy activity in the afternoon I have seen measurements of >25%.
Veritable death.
I
> plan to increase BUFFERS,LRUS and CLEANERS and maybe NUMCPUVPS. I would
> appreciate if you guys/gals confirm my plan and also have a look at my
> onconfig file and recommend any improvements.
>
> Informix recommends 4 LRUS per NUMCPUVPS (Admin Guide Vol2 33-45)
Yeah and somewhere else they recommend LRUS so that buffers per LRU is
around 600 or some such arbitrary nonsence. I think that was the
Performance Guide.
How many concurrent user sessions do you have normally? Peak? Max? THAT
is going to determine the level of buffer and LRU contention more than
anything else! That and the number of buffers and LRUs determine the
level of bufwaits.
> I have 6 CPUVPS, 28 LRUS (whoops) looking after 100000 BUFFERS, each LRU is
> looking after approximately 7000 pages.
> So, my questions are;
>
> 1) Should I conform to the 4 LRUS/NUMCPUVPS?
No.
> 2) Is 7000 BUFFERS a high/low number of pages for each LRU, is there an
> optimized target?
Probably high but not if you have the max of 750,000 buffers! It depends.
> Also, could someone explain to me why the formula uses pagreads and not
> bufreads.
Sure. The formula is predicated on the contention that bufwaits are from
two causes. Buffer contention and LRU contention. I sought onstat stats
that would help me monitor these. Bufreads is the number of times a page
already in the buffer cache was read. No contention there. A bufread
read does not latch either the buffer or the LRU containing it. Indeed a
bufread does not get to the buffer through the LRUS at all but through a
different page address hash table.
On the other hand pagreads are the number of pages read from disk into
buffers. In this case an LRU has to be latched and a clean buffer moved
from the end of the LRU's clean queue to the head of the queue since it
is not the most-recently-used. Once a buffer is selected the buffer must
be latched also and written to. These are both points of possible
contention and waiting.
#**************************************************************************
> #
> # INFORMIX SOFTWARE, INC.
> #
> # Title: onconfig.prod
> # Description: Informix Dynamic Server Configuration Parameters
> #
> #**************************************************************************
>
> # Root Dbspace Configuration
>
> ROOTNAME rootdbs # Root dbspace name
> ROOTPATH /dev/ifn_110001 # Path for device containing root> dbspace
>
>
> ROOTOFFSET 0 # Offset of root dbspace into device
> (Kbytes)
> ROOTSIZE 200000 # Size of root dbspace (Kbytes)>
> # Disk Mirroring Configuration Parameters
>
> MIRROR 1 # Mirroring flag (Yes = 1, No = 0)
> MIRRORPATH # Path for device containing mirrored root
> MIRROROFFSET 0 # Offset into mirrored device (Kbytes)>
> # Physical Log Configuration
>
> PHYSDBS plogdbs # Location (dbspace) of physical log
> PHYSFILE 49890 # Physical log file size (Kbytes)>
> # Logical Log Configuration
>
> LOGFILES 100 # Number of logical log files
> LOGSIZE 5000 # Logical log size (Kbytes)>
> # Diagnostics
>
> MSGPATH /home/informix/log/ccd.log # System message log file
> path
> CONSOLE /dev/console # System console message> path
> ALARMPROGRAM /opt/informix_7.30/etc/no_log.sh # Alarm program path
> SYSALARMPROGRAM /opt/informix_7.30/etc/evidence.sh # System Alarm
> program path
> TBLSPACE_STATS 1>
> # System Archive Tape Device
>
> #TAPEDEV /dev/null # Tape device path
> TAPEDEV /dev/rmt/c11t1d0BESTb # Tape device path
> #TAPEDEV /dev/rmt/c11t2d0BESTb # Tape device path
> TAPEBLK 64 # Tape block size (Kbytes)
> TAPESIZE 71303168 # Maximum amount of data to put on
> tape (Kbytes)>
> # Log Archive Tape Device
>
> #LTAPEDEV /dev/null # Log tape device path
> LTAPEDEV /prod/informix/llogs/ccd/llog.today # Log tape
> device path
> LTAPEBLK 64 # Log tape block size (Kbytes)
> LTAPESIZE 2048000 # Max amount of data to put on log tape
> (Kbytes)>
> # Optical
>
> STAGEBLOB # Informix Dynamic Server/Optical staging
> area
>
> # System Configuration
>
> SERVERNUM 13 # Unique id corresponding to a Dynamic> Server instance
> DBSERVERNAME cortran0 # Name of default database server
> DBSERVERALIASES cortran1 # List of alternate dbservernames
> NETTYPE soctcp,1,100,NET # Configure poll> thread(s) for nettype
You have no shared memory connections? With 6 CPU VPs you may want more
than one NET VP to keep them all busy.
> DEADLOCK_TIMEOUT 60 # Max time to wait of lock in distributed
> env.
> RESIDENT 1 # Forced residency flag (Yes = 1, No = 0)
>
> MULTIPROCESSOR 1 # 0 for single-processor, 1 for> multi-processor
> NUMCPUVPS 6 # Number of user (cpu) vps
> SINGLE_CPU_VP 0 # If non-zero, limit number of cpu vps to> one
>
> NOAGE 0 # Process aging
Noage is VERY important for performance on HP unless you bounce the engine
or the machine every few days.
> AFF_SPROC 0 # Affinity start processor
> AFF_NPROCS 0 # Affinity number of processors
You should use affinity to keep the two instances from using the same CPUs.
> # Shared Memory Parameters
>
> LOCKS 400000 # Maximum number of locks
> BUFFERS 100000 # Maximum number of shared buffers
> NUMAIOVPS 24 # Number of IO vps
> PHYSBUFF 64 # Physical log buffer size (Kbytes)
> LOGBUFF 64 # Logical log buffer size (Kbytes)> LOGSMAX 1024 # Maximum number of logical log files
> CLEANERS 24 # Number of buffer cleaner
CLEANERS should be >= LRUS
> processes
> SHMBASE
Related threads
- onbar -c -F in Windows Informix instance
- Anyone... SQLCODE=-668, ISAM error=-1
- Not using the 100% logical log page size alloacted to informix