Vous êtes sur la page 1sur 13

Buffer Types

Definition
There are seven main groups of buffers found in the shared memory. For more information on
each buffer type, see :
Repository Buffers
Table Buffers
Program Buffer
SAPgui Buffers
Roll and Paging Buffers
SAP Calendar Buffer
SAP Cursor Cache
SAP Buffers
Purpose
ach SAP instance !application server" has its o#n buffers. These buffers are also $no#n as
client caches because they are implemented on the client, that is, the application server. SAP
buffers occupy memory areas that are local to the #or$ process, and in individual shared memory
segments that can be accessed by all #or$ processes. These memory areas are e%ecuted for the
application server.
Some of the shared memory segments in an SAP System are grouped into one shared memory
segment $no#n as a pool. This is done to meet the operating system limits on the number of
shared memory allocations per process. &n most operating systems, you can allocate as many
shared memory segments as re'uired. The limits depend on the $ernel configuration. The A&(
operating system, for e%ample, allo#s )* shared memory segments per process.
SAP buffers store fre'uently+used data, and ma$e this data available to the local application
server instance. This helps to reduce the number of database accesses, the load on the database
server !it does not need to be accessed repeatedly to obtain the same information", and net#or$
traffic. As a result, system performance is considerably improved.
The data that is buffered includes ABAP programs and screens, ABAP ,ictionary data, and
company+specific data. Typically these remain unchanged during system operation.
-ou can change, or tune, the si.es of buffers to optimi.e performance for a particular hard#are
configuration. There are several #ays to tune buffers. As there are many constraints to consider
#hen change the buffer si.e, several difficulties may arise.
Confidential Page 1 7/23/2014
-ou can use table buffering to fine+tune applications, that is, some or all of the contents of
infre'uently changed tables can be held in local buffers.
SAP Buffers
Program Buffer This buffer occupies a #hole shared memory segment.
Generic Buffer
Screen Buffer
These buffers are held in a shared memory pool. All #or$
processes can access this pool.
Roll Area /ocal #or$ process buffers. 0nly one #or$ process can access
these buffers at a time.
Buffer Components
Definition
An SAP buffer consists of the follo#ing parts1
2ode table
The mode table resides in shared memory and tells you #hich pool contains
#hich shared memory areas. The mode table is part of the common
information on the shared memory areas that are accessed by the #or$
processes.
For e%ample, SAP 3ey ) #ith 2ode 4 *, instructs the 0S $ernel to e%tract
this buffer from the default pool and to allocate a uni'ue shared memory
segment.
SAP 3ey )* #ith 2ode 4 pool si.e instructs the 0S $ernel to store the buffer
specifically in pool )*.
SAP 3ey )) #ith 2ode 4 +)* means that the buffer is located in pool )*.
SAP 5lobal
2anagement Table
A shared memory area that is allocated by the dispatcher during system
startup.
6hen semaphore protection is on, the SAP 5lobal 2anagement Table is
addressed e%clusively by SAP Shared Memory Management. This is a
central agent that is found in each #or$ process and that sets up a shared
memory area for the local application server or instance.
The SAP Shared 2emory 2anagement issues a call to the operating system
!0S" #hen it creates a shared memory area. As a result, the SAP key is
assigned to an S key. The 0S returns a uni'ue identifier !handle" for the
shared memory area, #ith #hich the SAP Shared 2emory 2anagement
Confidential Page 2 7/23/2014
addresses the shared memory area that #as created by the 0S. All #or$
processes in the SAP System can access the SAP 5lobal 2anagement
Table. The handle can be accessed by all #or$ processes.
Address Table
very #or$ process contains this table.
Assigns virtual addresses to the physical addresses of the shared memory
areas.
Shared 2emory
0b7ects
These include the buffers, for e%ample.
8eader
Contains information on the shared memory area !also called memory
segment".
&f a #rite error occurs outside the segment area, then the uniformity of the
header is destroyed. The control function of the SAP 2anagement of Shared
2emory chec$s the consistency of the headers.
&,
&dentifies the memory area.
The &, is assigned #hen a SAP Shared 2emory 2anagement user re'uests
the memory area.
Storage Class
The memory class.
%amples of memory classes1 permanent !local", shared, roll, paging and
short.
Subdivision A mar$ for the re'uested area that can be referred to later #hen you release
the memory area.
Si.e include
header
Buffer si.e including the header.
Alignment Alignment of memory areas in accordance #ith hard#are constraints.
Tuning SAP Buffers
Definiton
&t is beneficial to $eep as much data buffered as possible. This helps avoid repetitive database
accesses, for e%ample from the net#or$ and &nterprocess Communication !&PC", and ma%imi.e
system performance.
Reduced performance is caused by
Confidential Page 3 7/23/2014
Buffers set too small.
The re'uired data cannot be stored in the buffers. &nstead, ob7ects have to be s#apped
out of the buffers. This causes e%pensive database accesses.
Buffers set too large
2emory is #asted. Paging may occur if too much memory is ta$en from the operating
system and allocated to the SAP buffers and database.
-ou should chec$ regularly #hether the buffer si.e is suited to your system re'uirements. Since
buffers are crucial for the performance of the SAP System, all !uffers !e%cept the SAP cursor
cache" should be ad7usted to their optimal value.
The optimum si.e for each buffer depends largely on the specific configuration of the server, that
is, the applications, the number of users #or$ing in each module, and so on. Therefore, it is
difficult to specify values suitable for all configurations. The most important criterion for the correct
buffer si.e is the buffer 'uality.
-ou should not ad7ust buffers in cases #here poor buffer 'uality is due to special
circumstances, for e%ample, ob7ect s#aps in the program buffer in a system #ith
a high level of development activity.
Buffer Tuning Checklist
&f there is insufficient memory to set the appropriate buffer si.es, you should consider adding
physical memory. 8o#ever, since this could ta$e some time, you may have to decide #hich
buffers are most important and should be ad7usted first using the e%isting memory.
As a guideline, the most important buffers are those that1
Are responsible for good dialog performance
Are used most fre'uently
Re'uire relatively fe# memory resources
These criteria give you the follo#ing priority list1
1. Repository buffers !nametab buffers"
2. Table buffers
3. Program buffers
4. Roll and page file buffers
5. SAPgui buffers
The Buffer Monitor
Purpose
Confidential Page 4 7/23/2014
6ith the CC2S buffer monitor you can analy.e the state of the SAP buffers and evaluate their
'uality. -ou can use this information to determine the areas in #hich you should change buffer
si.es to improve performance.
The buffer monitor gives you the follo#ing information for a selected server1
9uality of the most important buffers
Si.es of the most important buffers
Call statistics !database activity"
2emory usage
Semaphore usage
Table calls
:sage and configuration of the roll file
:sage and configuration of the paging file
:sage of e%tended and heap memory
Buffer resets
Number of objects in the buffers
Buffer Monitor and Tune Summary
To call the !uffer monitor:
From the initial R;< screen, choose Tools Administration Monitor Performance
Setup/Buffers Buffers !or call Transaction ST02 "
The buffer monitor displays information about buffer and memory usage and load for the instance
#here the user is logged on. Statistics are compiled from the time the server is started.
The Tune Summary screen is divided into four parts1
Buffer
SAP memory
Cursor cache
Call statistics
Buffers
The first column of the tune summary sho#s the names of the buffers1
Confidential Page 5 7/23/2014
The four R;< Repository buffers
The program, C:A, screen, and calendar buffers
The table buffers
See also:
Repository Buffers !=ametab Buffers"
"it Ratios
The hit ratios are displayed in percent.
The follo#ing diagram illustrates #hat is meant by hit ratios. A hit is #hen a ob7ect !such as a
table, screen or program" in the buffer!)" is accessed. &f the ob7ect has to be read from the
database!>", the buffer access fails.
Buffer hit ratio 4 Buffer ob7ect reads ; logical re'uests
Buffer #uality
Buffer 9uality 4 saved database calls ; !database calls ? saved database calls"
The database interface can translate one logical re'uest into several database calls.
Buffer 9uality1 0vervie#
Allocated Si$e
The allocated si.e is measured in 3B. &t is different from the a%aila!le !uffer si$e because part
of the space is used for buffer management.
&reespace
Freespace is important for analy.ing the buffer si.e. The space remaining in the buffer is
displayed in 3B and as a percentage of the available buffer si.e.
'um!er of Directories
ven if there is freespace in the buffer, ob7ects may not al#ays be loaded into the buffer because
there are no more free directories. The buffer monitor displays the number of directories available
for the buffer, and the number and percentage free. The buffer directories point to the location of
the ob7ects stored in the buffer.
S(apping
6hen a buffer has insufficient freespace or free directories, it has to s(ap ob7ects out of the
buffer in order to load a ne# ob7ect. The column Swap sho#s ho# many ob7ects have been
s#apped out since system startup.
Confidential Page 7/23/2014
Data!ase Accesses
6hen an ob7ect cannot be read from the buffer, the database has to be accessed. The number of
data!ase accesses is displayed in the last column on this screen.
&f a critical situation occurs in a buffer, the data for that buffer !freespace;ob7ect
s#aps" is displayed in red.
SAP memory
The follo#ing information is displayed1
The amount of space currently used in percent and in 3B
The ma%imum value !ma%. use" since system startup
The amount of space used in shared memory and on the dis$.

See also:
Roll and Paging Buffers
&or more information:
For details about an individual memory area, select a line.
The Detailed Analysis #indo#s !Extended Memory and Heap Memory" include functions for
information about1
#uotas
2emory allocation !se'uence, si.e"
)*t+ mem+ !locks
%tended memory user
Current parameters
The instance profile settings for memory management
"istory
2emory usage over the course of several days.
SAP cursor cache
Confidential Page 7 7/23/2014
The R;< System has a cursor cache that stores cursors for SELECT statements to avoid time
consuming PREPARE processing.
This cache has a fi%ed si.e and cannot be changed.
SAP Cursor Cache
Call statistics
The Tune Summary screen displays the access statistics for all data either residing in the SAP
pool buffers or the database.
The follo#ing table describes the information of the tune summary.
Ta!le: Tune Summary
Screen ,nformation
First column Contains the different $inds of statements that can be used to access a
table.
! SELECT SINGLE , SELECT , INSERT , UPDATE , DELETE ".
/ast line Sho#s the total + or in the case of the hit ratios, the average + data of
the call statistics.
=e%t column Sho#s the hit rates for the SELECT statements for buffered tables.
A hit rate for the other statements ! UPDATE , INSERT and DELETE " is
not displayed because these statements al#ays have to be passed to
the database.
ABAP Processor ,isplays the number of logical re'uests to the buffered tables, and ho#
many of them failed.
The subse'uent columns display1
The average database call time
The number of affected ro#s.
Table access failures are not the same as buffer access failures. The S9/
statements S/CT S&=5/, &=SRT, ,/T, and :P,AT can fail if the
specified data record does not e%ist. A buffer access can @fail@, if the table has not
yet been loaded into the buffer.
Some logical re'uests cannot be satisfied by buffer access and re'uire that the database be
accessed.
Buffer history
Confidential Page ! 7/23/2014
Analy.e the buffer history to find the correct buffer si.es.
To display the !uffer history:
From the initial R;< screen, choose Tools Administration Monitor Performance
Setup/Buffers Buffers Goto Performance database Tis ser!er istory
The data displayed is similar to the columns in the Tune Summary.
The si.es of the buffers may be appropriate for the current system situation, but may have been
too small for recent days. &f so, you should resi.e the buffers even if the si.es are appropriate for
the current situation.
See also:
Chec$ing 2emory :sage
,isplaying Table Buffers
Repository Buffers -'ameta! Buffers.
Definition
The name table !nametab" contains the table and field definitions that are activated in the SAP
System. An entry is made in the Repository buffer #hen a mass activator or a user !using the
ABAP ,ictionary, Transaction S))" re'uests to activate a table. The corresponding name table
is then generated from the information that is managed in the Repository.
The Repository buffer is mainly $no#n as the nametab buffer !=TAB", but it is
also $no#n as the ABAP ,ictionary buffer.
The description of a table in the Repository is distributed among several tables !for field definition,
data element definition and domain definition". This information is summari.ed in the name table.
The name table is saved in the follo#ing database tables1
,,=TT !table definitions"
,,=TF !field descriptions"
The Repository buffer consists of four buffers in shared memory, one for each of the follo#ing1
Ta!le definitions TTAB buffer Table ,,=TT
&ield descriptions FTAB buffer Table ,,=TF
Confidential Page " 7/23/2014
,nitial record layouts &RC buffer Contains the record layout initiali.ed
depending on the field type
Short 'ameta! S=TAB buffer A short summary of TTAB and FTAB buffers
The Sort nametab and "nitial record layouts are not saved in the database. &nstead, they are
derived from the contents of tables ,,=TT and ,,=TF.
6hen access to a table is re'uested, the database access agent embedded in each #or$
process first reads the Sort nametab buffer for information about the table. &f the information is
insufficient !for e%ample, the SELECT statement uses a non+primary $ey" it accesses the Table
definitions buffer and then the #ield descriptions buffer. By reading the Repository buffers, the
database access agent $no#s #hether the table is buffered or not. :sing this information, it
accesses the table buffers !partial buffer or generic buffer" or the database.
The &RC buffer is read1
6hen a REFRESH command is e%ecuted in an ABAP program
At an INSERT command, #hen a record is created in the buffers before the data is
inserted and the fields are initiali.ed #ith the values found in &RC buffer
-ou can set the buffers mentioned above by editing the parameters in the instance profile.
See also:

Buffer Types
Typical Parameter Settings for SAP Buffers
Typical Parameter Settings for SAP Buffers
Repository Buffers -nameta! !uffers.
Ta!le definition !uffer
-TTAB.
For the TTAB buffer, the si.e of the management part and the
user data cannot be ad7usted separately. Both are managed by
the parameter rsdb/ntab/entrycount , #hich specifies the
number of directory entries in the buffer. ach entry has a si.e
of about *.)A 3B. This parameter also specifies the number of
directory entries for the other three Repository buffers.
Confidential Page 10 7/23/2014
&ield description !uffer
-&TAB.
The number of directory entries is t#ice the number specified by
the parameter rsdb/ntab/entrycount . ach entry re'uires
about *.*<B 3B in the management part of the buffer. The si.e
of the data portion in 3B is determined by
rsdb/ntab/tabs!"e .
Short nameta! !uffer
-S'TAB.
The number of directory entries is t#ice the number specified by
the parameter rsdb/ntab/entrycount . ach entry re'uires
about *.*<B 3B in the management part of the buffer. The si.e
of the data portion in 3B is determined by
rsdb/ntab/sntabs!"e .
,nitial record !uffer
-,RBD.
The number of directory entries is t#ice the number specified
#ith the parameter rsdb/ntab/entrycount . ach entry
re'uires about *.*<B 3B in the management part of the buffer.
The si.e of the data portion in 3B is determined by
rsdb/ntab/!rbds!"e .

The follo#ing table summari.es the buffer si.es that can be allocated, along #ith the
corresponding profile parameters. &t also contains the number of the pool containing the buffer1
Ta!le: Buffer Capacity
Buffer
Management "eader
-Si$e in /B.
0ser Data
-Si$e in /B.
/ey Pool
TTAB *.)A 3B rsdb/ntab/entrycount

C> C*
&TAB *.*<B 3B >
rsdb/ntab/entrycount
rsdb/ntab/ftabsize
C< C*
S'TAB *.*<B 3B >
rsdb/ntab/entrycount
rsdb/ntab/sntabsize
CD C*
,RBD *.*<B 3B >
rsdb/ntab/entrycount
rsdb/ntab/irbdsize
CC C*

Thus, the si.e of the shared memory pool is controlled by the parameter !#c/s$%&#s!"e&'0 .
For more information, see Repository Buffers
Confidential Page 11 7/23/2014
Ta!le Buffers
Generic key -resident. !uffer -TAB1.
The number of directory entries !one for each resident table or generic area" is specified by
"csa/db&%a(&butab . The si.e of the data space in !ytes is defined by
"csa/tab)e&buer&area + The placement of the buffer can be controlled #ith
!#c/s$%&#s!"e&*+ and is usually set to *0 !pool )*". The parameter "csa/e(c$an,e&%ode
should not be changed. 3eep its default value off+
Single key -partial. !uffer -TAB1P.
The number of directory entries !one per table" is specified by rtbb/%a(&tab)es . The si.e of
the data space in /B is defined by rtbb/buer&)en,t$ . The placement of the buffer can be
controlled #ith !#c/s$%&#s!"e&-- and is usually set to 23 #hich means that it is not in a pool.
The parameter rtbb/ra%e&)en,t$ specifies the si.e of one frame in /B and should al#ays
be $ept at its default value of 4+ For more information, see Table Buffers
Program Buffers
The si.e of the program buffer can only be specified by one parameter, aba#/buers!"e
#hich defines the si.e in /B. The number of directory entries is calculated from this parameter.
The placement of the buffer can be controlled #ith !#c/s$%&#s!"e&0. and is usually set to 2,
#hich means that it is not in a pool. For more information, see Program Buffers.
SAPgui Buffers
Screen !uffer -PR)S.
The si.e of the directory, that is, the ma%imum number of screens is specified by
"csa/bud!r&entr!es . The total si.e of the buffer in /B is defined by
"csa/#resentat!on&buer&area , #hich includes the space for the directory.
Control the placement of the SAPgui buffers using parameter !#c/s$%&#s!"e&*' . This
parameter is usually set to /*0 , #hich means that it is in pool )*.
C0A !uffer
The parameter rsdb/cua/buers!"e defines the total si.e of the buffer in /B+ The number of
directory entries is calculated as1 tota) s!"e / 201 . The placement of the buffer can be
controlled #ith !#c/s$%&#s!"e&'2 and is usually set to /'0 3 #hich means that it is in pool C*.
For more information, see SAPgui Buffers.
Roll and Paging Buffers
The parameters rd!s#/R3LL&SH4 and rd!s#/PG&SH4 are used to allocate the roll and paging
buffer in 5/B bloc$s.
Confidential Page 12 7/23/2014
This buffer is normally placed outside a pool. To place the buffer inside a pool, set the parameters
!#c/s$%&#s!"e&05 and !#c/s$%&#s!"e&0+ . For more information, see R;< Roll and Paging
Buffers.
SAP Calendar Buffer
The si.e of the calendar buffer in !ytes is specified by the profile parameter
"csa/ca)endar&area . For more information, see SAP Calendar Buffer.
See also:

=ote )*<ACA in SAP=et.
Special Aspects of Tuning
Call Statistics
Reasons for Poor Buffer 9uality
Buffer Types
Confidential Page 13 7/23/2014

Vous aimerez peut-être aussi