Vous êtes sur la page 1sur 77

Week 2: Memory Management and Gateway Service

Unit 1: Fundamentals of Memory Management


This week you will learn about memory management, and its optimal configuration for an Esta semana aprenderá sobre la administración de memoria y su configuración óptima para un sistema SAP.
SAP system. También aprenderá sobre el servicio de puerta de enlace:
You will also learn about the gateway service:
the basics, security settings, and interface configuration.
los conceptos básicos, la configuración de seguridad y la configuración de la interfaz.
Let us get started with the first unit where you will learn the fundamentals of SAP memory Comencemos con la primera unidad donde aprenderá los fundamentos de la administración de memoria de
management. SAP.
Fundamentals of Memory Management
Memory Types
An application runs in a work Process, where an ABAP program is
normally executed.
Theprocess requires memory to do this, which is allocated to the
process by the memory management system.

The different SAP memory types are:


 Extended memory
 Private memory (heap memory)
 Paging memory
Tipos de memoria
Three memory types are
available at SAP level: Una aplicación se ejecuta en un work process, donde
Extended Memory, normalmente se ejecuta un programa ABAP.
Private Memory, known as well
as heap memory, El WP requiere memoria para hacer esto,
and Paging Memory.
la cual está asignada al WP por la administración de
memoria del Sistema.
Memory management is a core
part of an SAP system. Los diferentes tipos de memoria SAP son:
It is responsible for using the • Memoria extendida
available operating system • Memoria privada (heap memory)
resources effectively, and for
• Memoria de paginación
distributing them in the ABAP
system to process the requests.
La gestión de la memoria es una parte fundamental de un
sistema SAP.
Es responsable de usar los recursos disponibles del sistema
operativo, de manera efectiva y de distribuirlos en el
sistema ABAP para procesar las solicitudes.

Tres tipos de memoria están disponibles a nivel de SAP:


• Memoria extendida,
• Memoria privada, conocida como heap memory,
• yAlllarights
© 2017 SAP SE or an SAP affiliate company. memoria de paginación.
reserved. ǀ PUBLIC 2
Fundamentals of Memory Management SAP Swap memory: SAP Swap memory:
Asignación de memoria para la actualización de sesión
Memory Types Allocation of memory for the current
interna, mediante la transferencia de páginas fuera de la
internal session by transferring pages out
Extended Memory: Memoria extendida: of memory, similarly to operating system memoria, de manera similar a la paginación del sistema
La memoria extendida de SAP es el núcleo de administración de paging. operativo.
SAP extended memory is the core of the SAP memory SAP Paging enables the roll area to be
memoria del sistema SAP. “Los sistemas de paginación de memoria dividen los
management system. Each SAP work process has a part extended at ABAP runtime when a large
reserved in its virtual address space for extended memory. Cada work process de SAP tiene una parte reservada en su programas en pequeñas partes o páginas.
dataset, internal tables, for example, is
You can set the size of extended memory using the profile espacio de direcciones virtuales para memoria extendida. Del mismo modo, la memoria es dividida en trozos del
handled.
parameter em/initial_size_MB: Extended Memory Pool SAP’s memory management concept mismo tamaño que las páginas llamados marcos de página.
Size.
Puede establecer el tamaño de la memoria extendida utilizando
el parámetro de perfil currently limits SAP Paging to cases where De esta forma, la cantidad de memoria desperdiciada por
You can map the extended memory from the common the ABAP commands EXTRACT and
resource onto any work process, and after onto another em / initial_size_MB: Tamaño de la agrupación de memoria un proceso es el final de su última página, lo que minimiza
EXPORT… TO MEMORY… are used.
process on the same address in the virtual address space. extendida. la fragmentación interna y evita la externa”.
This is important if you work with pointers in the ABAP
program. Puede asignar la memoria extendida del recurso común a SAP Paging permite que el roll area se amplíe en el tiempo
cualquier work process, y luego a otro proceso en la misma de ejecución de ABAP, cuando se maneja un conjunto de
dirección en el espacio de direcciones virtuales. Esto es datos de gran tamaño, como por ejemplo tablas internas.
importante si trabaja con punteros en el programa ABAP. El concepto de gestión de la memoria de SAP actualmente
limita el SAP Paging a los casos en que ABAP ordena extraer
y exportar….. Para la memoria, ser usada
Roll Memory:
El roll area es un área de memoria con un tamaño establecido
(configurable) que pertenece a un WP.
Roll Memory: Se encuentra en el heap del espacio de direcciones virtuales del
WP.
The roll area is a memory area with a set (configurable) size
that belongs to a work process. It is located in the heap of the Cuando el contexto de un WP cambia,
virtual address space of the work process. los datos se copian del roll area a un recurso común llamado el
roll file.
When the context of a work process changes, the data is Para evitar la copia repetida, hay otro roll búfer ubicado entre
copied from the roll area to a common resource called the
los que forma parte de la memoria compartida.
roll file. To prevent repeated copying, another roll buffer is
located in between that is part of the shared memory. El roll area consta de 2 segmentos.
El primer segmento, que se puede configurar con el parámetro
The roll area consists of 2 segments. The first segment, which
can be set with the parameter ztta/roll_first, is assigned to
ztta / roll_first, se asigna primero al WP como memoria.
the work process first as memory. If this is used up, the work Si se usa esto, el WP tiene más memoria asignada.
process has more memory assigned to it. The amount of
La cantidad de memoria está determinada por la diferencia
memory is determined by the difference between the
parameters ztta/roll_area and ztta/roll_first. entre los parámetros
ztta / roll_area y ztta / roll_first.
NOTE- Sequential memory allocation to several work
NOTA: asignación de memoria secuencial a varios WP utilizando
processes using a relatively slow copying process
un proceso de copia relativamente lento 3
Fundamentals of Memory Management
Memory Types Memoria Privada (Heap Memory)
Heap Memory: Otros procesos no pueden usar memoria privada (heap memory).
Después de liberar la memoria asignada, el sistema operativo aún
Other processes cannot use private (heap)
considera que la memoria (virtual) está ocupada por el WP asignado.
memory. After releasing the assigned memory,
the operating system still considers the (virtual) Estas características de la Heap Memory requieren que:
memory as being occupied by the allocating
process. Si un WP de diálogo ha agotado el roll area asignada y la memoria
extendida, la memoria privada se asigna al WP.
These characteristics of heap memory require El work process entra en modo PRIV (privado).
that:
The work process can be run in PRIV mode
(private) when the local memory is assigned.
El WP puede correr en modo PRIV (privado) cuando la memoria local
This means that the work process is reserved for esta asignada.
processing the current user context until the Esto significa que el WP está reservado para procesar las actualizaciones
context releases the work process again when del contexto de usuario, hasta que el contexto libere el WP nuevamente
the request has ended. cuando la solicitud haya finalizado.
The work process, if it has used a lot of private Si el WP, ha utilizado una gran cantidad de memoria privada, se reinicia
memory, is restarted when the user context is cuando se termina el contexto del usuario y se devuelve la memoria
terminated and the local memory is returned. local.
The restart makes the local memory available
El reinicio hace que la memoria local vuelva a estar disponible para otros
again for other processes. A restart occurs if a
work process uses more local memory than is procesos.
defined in the parameter abap/heaplimit. Se produce un reinicio si un WP utiliza más memoria local que la definida
en el parámetro abap / heaplimit.
If a dialog work process has used up the roll area
assigned to it and the extended memory, private En la configuración de parámetros, asegúrese de que no haya
memory is assigned to the work process. demasiados WP de diálogo en el modo PRIV, ya que esto reduce el
The work process goes into PRIV mode (private).
rendimiento del sistema.
In the parameter settings, ensure that not too
many dialog work processes are simultaneously Los otros tipos de WP
in the PRIV mode, since this lowers system (background, update, enqueue and spool work processes)
performance.
se asignan a la memoria del heap después de que se agote el roll area.
The other Work Process types (background,
update, enqueue and spool work processes) are La asignación de memoria extendida no es útil ya que no se produce
assigned heap memory after the roll area is used ningún cambio de contexto para estos procesos.
up. Allocating Extended Memory is not useful
since no context change occurs for these
processes.
4
Basado en el diagrama anterior se explica cómo funciona la secuenciación
Fundamentals of Memory Management 1) Al principio, se utiliza el Roll Area y la memoria asignada se basa en el parámetro SAP "ztta / roll_first", según el diagrama
Memory Types anterior, al usuario se le asignará una memoria de 20KB y cuando la llene,
2) utilizará la memoria extendida, es decir, post roll area , el usuario utiliza la memoria extendida y su valor se basa en
el parámetro de SAP “em / initial_size_MB”
Y la cuota de usuario para el WP particular en el extended memory, depende del parámetro de SAP
ztta / roll_extension_dia.
Si esta memoria no es suficiente entonces:
3) El roll área restante se utiliza, y la memoria depende de "ztta / roll_área + ztta / roll_first"
si esta memoria no es suficiente
4) El sistema utiliza memoria privada local [heap memory].
Luego, el WP pasa al modo PRIV y dentro de las posibilidades pueden surgir:
5) El límite del área heap del área de WP ,y el valor se basa en el parámetro de SAP "abap / heap_area_dia“
o la memoria completa de almacenamiento de todas las bases de WP del parámetro de SAP "abap / heap_area_total"
para un servidor de aplicaciones que llega a su límite, lo que degrada SAP rendimiento de sistema
6) Lo que hace que el Sistema operativo llegue al limite de asignación de memoria.
7) The Swap Space, en el sistema host se agota, o se alcanza el límite superior del espacio de direcciones del SO.
Una vez que el WP entra en modo PRIV, no se puede finalizar con el parámetro "rdisp / max_wprun_time",
este permanece conectado al usuario hasta que, el usuario finaliza las transacciones,
o el sistema lo agota debido a la memoria, o hasta que se desconecte explícitamente con SM04 / DPMON.

Secuencia de asignación de memoria de SAP en modo de fondo (Background)


1) Al principio, se utiliza Roll Area y su valor se basa en el parámetro SAP "ztta / roll_area",
Si el roll área está llena, entonces:
2) Se utiliza el heap memory, y estará disponible hasta que ocurra lo siguiente:
a) El limite de heap memory es usada bajo el parámetro sap “abap/heap_area_nondia” o usa enteramente la memoria
asignada para todo los WP, y su valor basado en el parámetro de SAP "abap / heap_area_total"
b) Lo que hace que el Sistema operativo llegue al limite de asignación de memoria.
c) The Swap Space en el sistema host estará completamente agotado.
Sin embargo, esta situación no debería ocurrir a menudo, porque resultaría en problemas graves de rendimiento.
Compruebe los requisitos the swap space, para varias plataformas y defina el espacio de intercambio de manera óptima
para evitar este problema
3) Si la heap memory está llena, entonces utiliza la memoria extendida y su valor basado en el parámetro de SAP
"em / initial_size_MB".
5
Fundamentals of Memory Management
Features (1)
The order in which the work process is assigned the memory type depends
on the work process type
(either dialog or non- dialog),
and the underlying operating system.
By default, dialog work processes allocate extended memory first, while non-
dialog ones heap.

Características:
El orden en que se asigna el tipo de memoria al work process,
depende del tipo de work process (ya sea diálogo o no diálogo),
y el sistema operativo subyacente.
Por defecto, los work process de diálogo asignan memoria extendida primero, mientras que
los que no son de diálogo se apilan.

Depending on the operating system and


Según el sistema operativo y el tipo de work process,
work process type, the memory is el WP asigna la memoria en una secuencia determinada.
allocated by the work process in a certain
sequence. En los WP de diálogo, primero asignan la memoria extendida.
In dialog work processes, first the Luego viene la heap memory (heap memory)
extended memory is assigned. Then
comes the heap memory.
This diagram displays the memory types
Este diagrama muestra los tipos de memoria que se pueden
that can be assigned to the work asignar a los WP
processes at the SAP level and on the a nivel de SAP y a nivel del sistema operativo.
operating system level.
Here, you also can see the most relevant Aquí, también puede ver los parámetros más relevantes en el
parameters in the instance profile that perfil de instancia
define the allocation memory quotas for
each work process.
que definen las cuotas de asignación de memoria para cada
work process.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


The memory management in an SAP ABAP
Fundamentals of Memory Management system differentiates between the memory
La administración de memoria en un sistema SAP ABAP diferencia entre
areas that can be used by all the work las áreas de memoria que pueden usar todos los WP y aquellas áreas que
Features (2) processes, and those areas that are están disponibles exclusivamente para un work process.
available exclusively to one work process.
User Context The user context includes data that El contexto del usuario incluye datos que caracterizan al usuario,
characterizes the user, like authorizations, como autorizaciones,
The memory used exclusively by a work process stores session-specific administrative information, and other data
for the ABAP and screen processors
información administrativa
data that must be kept for longer than the duration of a work step. y otros datos para los procesadores de pantalla y ABAP.
This information must be shared amongst
This datais automatically made available to the process at the start of a all the work processes that execute the
dialog step (rolled in) and saved at the end of the dialog step (rolled out). different dialog steps of an SAPtransaction. Esta información debe compartirse entre todos los work process que
When a dialog step has finished, this ejecutan los diferentes pasos de diálogo de una transacción SAP.
information is saved and rolled out to the
Contexto de usuario shared memory.
It will then be rolled in to be available for
Cuando finaliza un paso de diálogo, esta información se guarda y se
La memoria utilizada exclusivamente por un work process
the next dialog step of the transaction extiende (rolled out) a la memoria compartida (shared memory).
almacena datos específicos de la sesión que deben conservarse durante más tiempo
There are also additional memory areas for
que la duración de un paso de trabajo.
all work processes in the shared memory. Luego se enrolled para que esté disponible, para el siguiente paso de
These memory areas are used, among diálogo de la transacción.
Estos datos se ponen automáticamente a disposición del proceso al comienzo de un other things, for the factory calendar, the
paso de diálogo (rolled in) y se guardan al final del paso de diálogo (rolled out). screen buffer, the table and the program
buffers.
También hay áreas de memoria adicionales para todos los work process
en la memoria compartida.

Estas áreas de memoria se utilizan, entre otras cosas, para


el calendario de fábrica,
el búfer de pantalla,
The table y los buffers del programa.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7


Fundamentals of Memory Management Let us talk about the extended memory, which is a shared Hablemos de la memoria extendida, que es un recurso
resource for all the work processes
Extended memory The size of this resource is defined by parameter
compartido para todos los WP

Extended memory is the core of the memory management system. em/initial_size_MB at instance startup. El tamaño de este recurso está definido por el parámetro
There can be some exceptions depending on the underlying em / initial_size_MB en el inicio de la instancia.
Each work process hasa part reserved in its virtual address space for operating system that we will describe in the next unit.
extended memory. Every work process can allocate a limited part of it. Puede haber algunas excepciones dependiendo del sistema
The screenshot visualizes the relationship between extended operativo subyacente que describiremos en la siguiente unidad.
You can adjust the size of extended memory using the profile parameter memory pool and the work processes.
em/initial_size_MB, Cada Work Process puede asignar una parte limitada de él.
La captura de pantalla visualiza la relación entre la agrupación de
on AIX platform using EM/TOTAL_SIZE_MB. memoria extendida y los WP.

On Windows, it can be extended automatically up to em/max_size_MB.

ztta/roll_extension(_dia|_nondia) defines the quota for extended memory per


user context.
On Windows either ztta/roll_extension or em/address_space_MB –
whichever is lower – will be the limit.

Memoria Extendida

Hablemos sobre la memoria extendida, que es un recurso compartido para todos los work process.
La memoria extendida es el núcleo del sistema de administración de memoria.
Cada work process tiene una parte reservada en su espacio de direcciones virtuales para memoria extendida.
El tamaño de este recurso se define mediante el parámetro em / initial_size_MB al inicio de la instancia.
Puede ajustar el tamaño de la memoria extendida usando el parámetro de perfil em / initial_size_MB,
en la plataforma AIX utilizando EM / TOTAL_SIZE_MB.

En Windows, se puede extender automáticamente hasta em / max_size_MB.


ztta / roll_extension (_dia | _nondia) define la cuota de memoria extendida por contexto de usuario.
Cada work process puede asignar una parte limitada de él.
En Windows, ztta / roll_extension o em / address_space_MB (el que sea menor) será el límite.
Puede haber algunas excepciones, dependiendo del sistema operativo subyacente que describiremos en la siguiente unidad.

La captura de pantalla visualiza la relación entre el grupo de memoria extendida y los work process.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8


Fundamentals of Memory Management
Private memory (1)
If the extended memory is fully occupied, or the limit for the work process has been
exceeded,the dialog work process allocates private memory.
This is known as heap memory because it is specific to the process, and the user
context canno longer be processed by a different work process.
The other work process types (background, update, and spool work
processes, a.k.a. non- dialog work processes) are assigned private memory
directly.

Private memory (heap memory) in turn differentiates between PRIV-memory and


PROC- memory.

Si la memoria extendida está completamente ocupada, o se ha excedido el límite para el WP, el WP de


diálogo asigna memoria privada.
Esto se conoce como memoria de almacenamiento dinámico (Heap Memory) porque es específico del
proceso, y el contexto del usuario ya no puede ser procesado por un WP diferente.

Los otros tipos de WP (background, update, and spool work processes,


también conocidos como WP sin diálogo) se asignan directamente a la memoria privada.

La memoria privada o Heap Memory (memoria de almacenamiento dinámico)


a su vez diferencia entre la memoria PRIV y la memoria PROC

Let us continue with the heap memory. Continuemos con la Heap Memory
When a dialog work process uses its quota of extended memory or there is
not more extended memory available,
Cuando un WP de diálogo usa su cuota de memoria extendida o no hay más memoria extendida disponible,
and it still requires more memory,it will start to allocate work process local
memory, the so-called heap memory. y aún requiere más memoria, comenzará a asignar memoria local del WP, la llamada Heap Memory.
Los WP sin diálogo asignan primero la memoria de almacenamiento dinámico (Heap Memory), ya que no se produce un cambio de contexto.
Non-dialog work processes allocate heap memory first, since no context
switch occurs.
Después de usar la cuota de memoria de almacenamiento dinámico del proceso, o si no hay más memoria de almacenamiento dinámico
After using the process’ quota of heap memory or if there is no more heap disponible, los WP comenzarán a asignar memoria extendida.
memory available, the work processes will start allocating extended
memory. Si profundizamos en la tecnología, la Heap Memory se puede dividir en memoria PRIV y memoria PROC.
If we go deeper into the technology, heap memory can be divided into
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9
PRIV memory and PROC memory.
Fundamentals of Memory Management In some cases, when you go to transaction En algunos casos, cuando pasa a la transacción SM50 o SM66, ve los work process del
SM50 or SM66, you see dialog work processes diálogo en el modo PRIV.
Private memory (2) in PRIV mode. This means that heap memory
Esto significa que la heap memory se les ha asignado.
has been assigned to them.
PRIV-memory La heap memory no puede ser compartida por otros WP, e incluso cuando el work process
Heap memory cannot be shared by other ha finalizado su tarea, la memoria permanece ocupada a nivel del sistema operativo.
The work process is run in PRIV mode when work processes, and even when the work
private memory is assigned. process has finished its task, the memory Para liberar la memoria, es necesario reiniciar el work process.
remains occupied at the operating system Para ello, se establece un límite con el parámetro abap / heaplimit.
Private memory cannot be used by other work level.
processes. Cuando el work process utiliza la cantidad de heap memory definida por este parámetro,
To release the memory, the work process se reinicia automáticamente, solo después de terminar la tarea que ha estado
After releasing the assigned memory, the operating needs to be restarted. procesando.
To do so, a limit is set by the parameter
system still considers the virtual memory as being abap/heaplimit.
occupied by the allocating work process. Recomendamos que no cambie el valor predeterminado del parámetro abap / heaplimit,
When the work process uses the amount of ya que puede dar lugar a problemas inesperados.
When the amount of heap memory defined by heap memory defined by this parameter, it is
abap/heaplimit is exceeded, a work process is restarted automatically restarted, only after finishing El objetivo es reiniciar los work process lo menos posible, evitando cuellos de botella en el
after completing a transaction step and releases the the task that it has been processing. espacio de intercambio al mismo tiempo .
resources on operating system level. We recommend that you do not change the
default value of the abap/heaplimit
It is strongly recommended not to change the default parameter, because it may result in
value of abap/heaplimit. unexpected issues.

The aim is to restart work processes as


PRIV-memoria (2) seldom as possible avoiding swap space
bottlenecks at the same time.
El work process se ejecuta en modo PRIV cuando se asigna la memoria
privada.
La memoria privada no puede ser utilizada por otros WP

Después de liberar la memoria asignada, el sistema operativo aún


considera que la memoria virtual está ocupada por el WP asignado.

Cuando se excede la cantidad de heap memory definida por el parámetro


abap / heaplimit, se reinicia un WP después de completar un paso de
transacción y libera los recursos en el nivel del sistema operativo.

Se recomienda encarecidamente no cambiar el valor predeterminado de


abap / heaplimit.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10
Fundamentals of Memory Management
Private memory (3)

The SAP system offers a mechanism that lets you terminate non-active dialog
work processes in PRIV mode.
The mechanism works as follows:
In PRIV mode, a maximum number (n) of dialog work processes can run without
any time restrictions.
To determine this number (n), set the value of the profile parameter
rdisp/wppriv_max_no.
If more than (n) dialog work processes are active and the time span set in
parameter rdisp/max_priv_time has elapsed, the transaction for the PRIV process
that has spent the longest possible time in PRIV mode is reset.
Memoria Privada (3)
El sistema SAP ofrece un mecanismo que le permite finalizar WP de diálogo no activos en modo PRIV.
El mecanismo funciona de la siguiente manera:
En modo PRIV, se puede ejecutar un número máximo (n) de WP de diálogo sin restricciones de tiempo.
Para determinar este número (n), establezca el valor del parámetro de perfil
rdisp / wppriv_max_no.
Si hay más de (n) WP de diálogo activos y ha transcurrido el período de tiempo establecido en el
parámetro rdisp / max_priv_time, se restablece la transacción para el proceso PRIV que ha pasado el
mayor tiempo posible en modo PRIV.

Another type of protection method is to allow only a


Otro tipo de método de protección es permitir que solo un número
specific number of dialog work processes to stay in PRIV
mode. específico de WP de diálogo permanezca en modo PRIV.

When this maximum number, defined by parameter Cuando se alcanza este número máximo, definido por el parámetro
rdisp/wppriv_max_no is reached, the longest running rdisp / wppriv_max_no, el Work Process de diálogo de ejecución más
dialog work process in PRIV larga en el modo PRIV terminará primero.
mode will be terminated first.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 11
Fundamentals of Memory Management As already mentioned earlier,
heap memory can be divided into
Private memory (4) PRIV memory and PROC memory.

PROC memory is used for data


PROC-memory that is not bound to a specific user
context, for example, temporary
This is used for data that is not bound to a specific user context, for example heap buffer areas.
temporary, heap buffer areas.
The parameters which have an
In contrast to PRIV memory, influence on this type of memory
are mentioned in this slide.
allocation of PROC memory does not lead to an exclusive reservation of the It is important, that parameter
process for a specific user context. em/proc_max_size_MB is set to
unlimited, to avoid a system
em/proc_max_size_MB specifies the maximum size of the PROC heap standstill.
memory that can be allocated by all work processes in total, If this parameter is set to a
specific value, a work process
and em/proc_max_wpsize_MB the maximum allocation per work process.
probably cannot get its quota of
PROC memory in some cases.

Memoria PROC
Como ya se mencionó anteriormente, la memoria de almacenamiento dinámico
Esto se usa para datos que no están vinculados a un contexto de usuario específico, se puede dividir en memoria PRIV y memoria PROC.
por ejemplo,
temporary, heap buffer areas. La memoria PROC se usa para datos que no están vinculados a un contexto de usuario específico, por ejemplo, áreas
temporales de almacenamiento intermedio de almacenamiento dinámico.
En contraste con la memoria PRIV,
la asignación de memoria PROC no conduce a una reserva exclusiva del WP para un contexto Los parámetros que influyen en este tipo de memoria se mencionan en esta diapositiva.
de usuario específico. Es importante que el parámetro em / proc_max_size_MB esté establecido en ilimitado, para evitar una parada del
sistema.
El Parametro: em / proc_max_size_MB Si este parámetro se establece en un valor específico, un WP probablemente no pueda obtener su cuota de
especifica el tamaño máximo de la Heap Memory PROC que todos los WP pueden asignar
memoria PROC en algunos casos.
en total,
y el Parametro: em / proc_max_wpsize_MB la asignación máxima por Work
Process.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 12


Fundamentals of Memory Management El tercer tipo de memoria SAP, que quiero mencionar, es la memoria de paginación.
Paging memory
Esto es específico para las declaraciones de extracción y exportación ABAP, por lo tanto, no debe mezclarse
Paging memory functions as memory forABAP extracts and exports. con el método de paginación a nivel del sistema operativo.

La memoria de paginación puede residir en la memoria principal o compartirse entre la memoria principal y
It is divided into two parts: el sistema de archivos. (main memory and the file system.)
 Paging buffer (in memory) is set by rdisp/PG_SHM
Por defecto, toda la memoria de paginación está disponible en la memoria principal para evitar problemas
 Paging file (on file system) is set by rdisp/PG_MAXFS de rendimiento.
By default, the paging buffer is set by a formula depending on physical
La fórmula para calcular la memoria de paginación es óptima para el uso normal.
memory, and the paging file is set to the size of the paging buffer.
The formulais optimal for normal usage. Cuando una aplicación usa mucho la memoria de la página, puede ser necesario aumentarla manualmente.

La memoria de paginación funciona como memoria para extractos y exportaciones ABAP.


Se divide en dos partes:
• El búfer de paginación (en memoria) se establece mediante rdisp / PG_SHM
• El archivo de paginación (en el sistema de archivos) lo establece rdisp / PG_MAXFS
De manera predeterminada,
el búfer de paginación está configurado por una fórmula que depende de la memoria física,
y el archivo de paginación está configurado al tamaño del búfer de paginación.
La fórmula es óptima para el uso normal.

The third type of SAP memory, that I want to mention, is the paging memory.

This is specific to ABAP extract and export statements, therefore it should not be
mixed up with the paging method at the operating system level.

The paging memory can reside in the main memory or be shared between main
memory and the file system.

By default, the whole paging memory is available in main memory to avoid


performance issues.

The formula for calculating paging memory is optimal for the normal usage.

When an application uses page memory heavily, it might be necessary to increase it


© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 13
manually.
Fundamentals of Memory Management
Parameters
An instance is controlled by its profile parameters.
Profile parameters enable you (amongst other things) to
set up your memory management system to get
maximum benefit from it.
Certain parameters may restrict individual work
processes, and quotas may limit resources used by
all work processes.

Many of the SAP memory management profile


parameters are calculated by formulas to simplify
administration and to ensure that parameters are
consistent.
See also:
SAP Note 2085980 – New features in memory
management as of Kernel Release 7.40

Parámetros
Una instancia está controlada por sus parámetros de perfil.
Los parámetros de perfil le permiten (entre otras cosas)
configurar su sistema de administración de memoria para
obtener el máximo beneficio de él.
Ciertos parámetros pueden restringir los WP individuales, y
las cuotas pueden limitar los recursos utilizados por todos
los WP.
Muchos de los parámetros del perfil de administración de
memoria de SAP se calculan mediante fórmulas para
simplificar la administración y garantizar que los parámetros
sean consistentes.

Ver también:
Nota SAP 2085980 - Nuevas características en la gestión de
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 14
memoria a partir de la versión 7.40 de Kernel
Fundamentals of Memory Management
Parameters
The parameters in the instance profile allow system
administrators to customize the SAP system
according to the requirements.
Among others, the memory management
parameters can be adjusted to get the maximum
benefit from it.
These are parameters which are calculated with
formulas by default.
Some parameters are valid for individual work
processes; others influence the whole system.

Los parámetros en el perfil de instancia


permiten a los administradores del
sistema personalizar el sistema SAP de
acuerdo con los requisitos.
Entre otros, los parámetros de
administración de memoria se pueden
ajustar para obtener el máximo beneficio.
Estos son parámetros que se calculan con
fórmulas por defecto.
Algunos parámetros son válidos para
Work Process individuales; otros influyen
en todo el sistema.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 15


The most essential parameter for El parámetro más esencial para la administración de memoria es PHYS_MEMSIZE.
Fundamentals of Memory Management memory management is
Most important profile parameters (1) PHYS_MEMSIZE.
Al configurar este parámetro, el resto de los parámetros de administración de memoria se
By setting this parameter, the rest of calculan y ajustan automáticamente.
PHYS_MEMSIZE the memory management
parameters are calculated and De esta manera, la "administración de memoria de administración cero" (“zero
 Available main memory for the SAP instance. adjusted automatically. administration memory management” ZAAM), solo estaba disponible para sistemas SAP en
With PHYS_MEMSIZE, all memory management ejecución. Para todos los sistemas operativos.
parameters are calculated and adjusted In this way, the “zero administration
memory management” (ZAAM), that
automatically. was only available for SAP systems En plataformas Windows, está disponible para todas las plataformas del sistema operativo
running. For All operating Systems. como para NetWeaver versión 7.40.
At least extended global memory (for the ITS) and
in Windows platforms, is available El valor predeterminado para el parámetro PHYS_MEMSIZE
page should be checked. for all the operating system es el tamaño en Megabytes de la memoria principal del servidor.
platforms as for NetWeaver release
Controlling Memory Management 7.40.

 abap/heaplimit: Work process restart The default value for parameter


PHYS_MEMSIZE is the size in
megabytes of the main memory of
PHYS_MEMSIZE the server.
Memoria principal disponible para la instancia de SAP.
Con PHYS_MEMSIZE, todos los parámetros de administración
de memoria se calculan y ajustan automáticamente.
Al menos se debe verificar la memoria global extendida (para
el ITS) y la página.
Control de gestión de memoria
abap / heaplimit: reinicio del Work Process

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 16


Fundamentals of Memory Management In this slide, you can see the parameters that define the memory quotas per work process.
Most important profile parameters (2) We have parameter ztta/roll_extension_dia.
Memory Management Resources for One Work Process This parameter specifies the maximum amount of extended memory to be occupied by dialog work processes. When
this limit is reached, the process starts to allocate heap memory.
 ztta/roll_extension_dia: EM limit for dialog work processes
We have also abap/heap_area_dia parameter.
 abap/heap_area_dia: Heap memory limit for dialog work processes This one specifies the maximum local process memory that can be allocated to a single dialog work process.

 abap/heap_area_nondia: Heap memory limit for non-dialog WP Another parameter is abap/heap_area_nondia.


This specifies the maximum amount of local process memory that can be allocated to one non-dialog work process.
 ztta/roll_extension_nondia: EM limit for non-dialog work processes
And the parameter ztta/roll_extension_nondia
specifies the maximum amount of extended memory to be allocated by a non-dialog work process.
Recursos de gestión de memoria para un work process:
ztta / roll_extension_dia: límite de EM para work process de diálogo
abap / heap_area_dia: Límite de heap memory para los work process de diálogo
abap / heap_area_nondia: Límite de heap memory para work process que no son de diálogo Parámetros de perfil más importantes
ztta / roll_extension_nondia: límite de EM para work process sin diálogo En esta diapositiva, puede ver los parámetros que definen las cuotas de memoria por work process.
Tenemos el parámetro ztta / roll_extension_dia.
Este parámetro especifica la cantidad máxima de memoria extendida que ocuparán los work
process de diálogo. Cuando se alcanza este límite, el proceso comienza a asignar heap memory.

También tenemos el parámetro abap / heap_area_dia.


Este especifica la memoria de proceso local máxima que se puede asignar a un solo wp de diálogo

Otro parámetro es abap / heap_area_nondia.


Este especifica la cantidad máxima de memoria de proceso local que se puede asignar a un WP No
dialogo.

Y el parámetro ztta / roll_extension_nondia


especifica la cantidad máxima de memoria extendida que se asignará mediante un work process sin
diálogo.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 17


Fundamentals of Memory Management The following parameters Los siguientes parámetros definen los recursos de memoria que se pueden asignar para todo
Most important profile parameters (3) define the memory resources el sistema: (Limitaciones de la gestión de la memoria de todo el sistema)
that can be allocated for the
Memory Management Limitations of Entire System entire system:
abap / heap_area_total
 abap/heap_area_total: abap/heap_area_total Define la total local process memory para todos los work process juntos.
defines the total local process Límite de memoria de Stack para todos los work process juntos
Heap memory limit for all work processes together memory for all the work
 em/initial_size_MB: processes together. em / initial_size_MB
Especifica el tamaño inicial del área de administración de memoria que SAP asigna como
Extended memory pool size em/initial_size_MB
specifies the initial size of the memoria extendida (Extended Memory). Tamaño de la agrupación de EM
 em/proc_max_size_MB: memory area that SAP memory
management allocates as El parámetro em / proc_max_size_MB
Maximum amount of PROC memoy that can be allocated to all work extended memory. Especifica el tamaño máximo de la heap memory de PROC que pueden ser asignados por
processes todos los work process en total.
The parameter
Limitaciones de gestión de memoria de todo el sistema em/proc_max_size_MB
specifies the maximum size of
abap / heap_area_total: the PROC heap memory that
Límite de memoria de almacenamiento dinámico (Heap Memory), para todos can be allocated by all work
los WP juntos processes in
total.
em / initial_size_MB:
Tamaño de agrupación de memoria extendida (Extended Memory).
em / proc_max_size_MB:
Cantidad máxima de memoria PROC que se puede asignar a todos los WP

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 18


Fundamentals of Memory Management Now, we will show you some operating- Ahora, le mostraremos algunos parámetros de administración de memoria específicos de
Platform-specific description of memory management (1) specific memory management operación.
parameters.
Primero, echemos un vistazo a la plataforma AIX.
AIX First, let us take a look at the AIX
platform. Parámetro ES / TABLE = SHM_SEGS:
 ES/TABLE = SHM_SEGS | UNIX_STD El valor predeterminado SHM_SEGS cambia a la implementación alternativa de la memoria
The default value SHM_SEGS Parameter ES/TABLE = SHM_SEGS: extendida.
switches to the alternative implementation of the extended This default value switches to the
alternative implementation of the Con esta configuración, la secuencia de asignación de memoria se invierte para los
memory. extended memory. procesos que no son de diálogo,
With SHM_SEGS, the allocation sequence for non- dialog work With this setting, the allocation por lo que primero se les asigna la EM y luego se les asigna la heap memory.
processes is the same as for dialog work processes (first sequence of memory is reversed for
extended memory, then heap). non-dialog processes, so first extended Este es el mismo orden que para los work process de diálogo.
and afterwards heap memory is
Con SHM_SEGS, la secuencia de asignación para los work process que no son de diálogo es
allocated to them.
la misma que para los work process de diálogo (primero la memoria extendida, luego la
 EM/TOTAL_SIZE_MB This is the same order as for dialog work
processes. heap).
Defines the extended memory pool size on AIX
Parameter EM/TOTAL_SIZE_MB
defines the extended memory pool size Parámetro EM / TOTAL_SIZE_MB
Descripción específica de la plataforma de gestión de memoria (1) for an SAP system running on the AIX Define el tamaño de la agrupación de memoria extendida para un sistema SAP que se
platform. ejecuta en la plataforma AIX.
AIX
ES / TABLE = SHM_SEGS | UNIX_STD
El valor predeterminado SHM_SEGS,
cambia a la implementación alternativa de la memoria extendida.
Con SHM_SEGS, la secuencia de asignación para WP sin diálogo es la
misma que para los WP de diálogo (primero memoria extendida, luego
montón).

EM / TOTAL_SIZE_MB
Define el tamaño de la agrupación de memoria extendida en AIX

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 19


Fundamentals of Memory Management
Platform-specific description of memory management (2)

Linux
 es/implementation = std | map
With the default std variant, the memory management of an
SAP system on Linux is the same as on standard UNIX
systems.
This means that all user contexts are displayed in the
address space at the same time.

LINUX
es / implementación = std | mapa
Con la variante estándar estándar, la gestión de memoria de un sistema SAP en Linux
es la misma que en los sistemas UNIX estándar.
Esto significa que todos los contextos de usuario se muestran en el espacio de
direcciones al mismo tiempo.

Segundo, en Linux, tenemos parámetros es / implementacion = std | mapa


Con la variante estándar (valor predeterminado) por defecto,
la administración de memoria de un sistema SAP en Linux es la misma que en los
sistemas UNIX estándar.
Esto significa que todos los contextos de usuario se muestran en el espacio de
direcciones al mismo tiempo.
Esto es lo mismo que en otros sistemas operativos Unix.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 20


Fundamentals of Memory Management Third, in Windows, parameter
em/address_space_MB
Tercero, en Windows, el parámetro em / address_space_MB
Define el espacio reservado para el contexto del usuario + la memoria global
Platform-specific description of memory management (3) Defines the space reserved
extendida por work process.
for the user context and the
extended global memory per
Secuencia para asignar memoria extendida para WP:
Windows work process.
min {em / address_space_MB, ztta / roll_extension_dia} = Para WP de diálogo.
 em/address_space_MB Parameter
Space reserved for user context + extended global memory (EG) in WP ztta/roll_extension_dia Parámetro ztta / roll_extension_dia
will have a meaning in this
Tendrá un significado en esta plataforma solo si tiene un valor inferior
platform only if it has a lower
 em/max_size_MB value than parameter al del parámetro em / address_space_MB.
Maximum size of extended memory pool em/address_space_MB.
min {em / address_space_MB, ztta / roll_extension_nondia} = para WP sin
Sequence for allocating extended memory for Work processes: Initially, the extended diálogo
memory is set to the size of
 min {em/address_space_MB, ztta/roll_extension_dia} the profile parameter
Inicialmente, la memoria extendida se establece en el tamaño del parámetro de
PHYS_MEMSIZE.
for dialog work processes perfil PHYS_MEMSIZE.
If more memory is required,
extended memory extends Si se necesita más memoria, la memoria extendida se extiende en pasos, hasta el
 min {em/address_space_MB, ztta/roll_extension_nondia} itself in steps, up to the value valor del parámetro em / max_size_MB.
of parameter
for non-dialog work processes
em/max_size_MB.
em / max_size_MB = Tamaño máximo de la agrupación de memoria extendida
WINDOWS
em / address_space_MB
Espacio reservado para el contexto del usuario + memoria global extendida (EG) en
WP
em / max_size_MB
Tamaño máximo de la agrupación de memoria extendida

Secuencia para asignar memoria extendida para WP:


min {em / address_space_MB, ztta / roll_extension_dia}
para WP de diálogo
min {em / address_space_MB, ztta / roll_extension_nondia}
para WP sin diálogo

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 21


Week 2: Memory Management and Gateway Service
Unit 2: Memory Management Configuration
In this unit, you will learn about SAP memory management configuration.
from the perspective of both, the operating system and the SAP system.
We will also look at how to monitor the memory configuration. Let us begin.

En esta unidad, aprenderá acerca de la configuración de gestión de memoria de SAP.


Desde la perspectiva de ambos, el sistema operativo y el sistema SAP.
También veremos cómo monitorear la configuración de la memoria. Empecemos.
The SAP system is designed to run on top of
Memory Management Configuration various operating systems, El sistema SAP está diseñado para ejecutarse sobre varios sistemas operativos, como
The operating system like Windows, Linux, AIX, Solaris, and HP-UX. Windows, Linux, AIX, Solaris y HP-UX.

The operating system offers resources like El sistema operativo ofrece recursos como CPU, memoria, disco, red, para todas las
Resources
CPU, memory, disk, network,
aplicaciones que se ejecutan en él.
 Various operating systems: for all the applications running on it.

– Windows The resources are used by the operating Los recursos son utilizados por el propio sistema operativo,
system itself, by the SAP application, por la aplicación SAP,
– UNIX: Linux, AIX, Oracle Solaris, HP-UX and by a third-party application as well, for y también por una aplicación de terceros,
example a non-SAP database or application. por ejemplo, una base de datos o aplicación que no sea de SAP.

 Used by: One of these resources is the memory.


Uno de estos recursos es la memoria.
– Operating System On the operating system level, it consists of
the physical memory and the paging file, En el nivel del sistema operativo, consiste en la memoria física y el archivo de
– SAP known as Swap space. paginación, conocido como espacio de intercambio.
– 3rd party applications (e.g. database) RAM memory plus Swap together form the so
La Memoria RAM Plus y la Memoria Swap juntas forman la llamada memoria virtual.
- called virtual memory.
 Memory on operating system level:
– physical memory (RAM)
– paging file (Swap space)
 RAM + Swap = virtual memory

Recursos
*Varios sistemas operativos:
₋ Windows
₋ UNIX: Linux, AIX, Oracle Solaris, HP-UX

*Usado por:
₋ Sistema Operativo
₋ SAP
₋ Aplicaciones de terceros (por ejemplo, base de datos)

*Memoria en el nivel del sistema operativo:


₋ memoria física (RAM)
₋ archivo de paginación (espacio de intercambio)

*RAM + Swap
© 2017 = anmemoria
SAP SE or SAP affiliate virtual
company. All rights reserved. ǀ PUBLIC 23
Memory Management Configuration The operating system has certain settings which limit the El sistema operativo tiene ciertas configuraciones que limitan el uso de memoria
memory usage per user. por usuario.
User-specific memory
Since the SAP system and all its processes are run by adm
Operating system memory for <sid>adm Dado que el sistema SAP y todos sus procesos son ejecutados por un usuario adm
user at the operating system level,
limits for the adm will be valid for the whole SAP system en el nivel del sistema operativo,
as well. Los límites para adm también serán válidos para todo el sistema SAP.
 Determine it by:
– sh -c 'ulimit -a’ or csh -c limit On Windows, usually there aren’t any issues connected to En Windows,
such limits, normalmente no hay problemas relacionados con dichos límites,
– SAP tool: memlimits -v off but on Unix operating systems, they need to be set
pero en los sistemas operativos Unix, deben configurarse correctamente.
correctly.
The requirements are different per operating system. Los requisitos son diferentes según el sistema operativo.
 In command output refer to:
There are several ways to check these limits.
– data size, stack size (requirements vary per operating system) One of them is to run “ulimit -a” or “limit” commands.
Hay varias formas de verificar estos límites.
Uno de ellos es ejecutar los comandos "ulimit -a" o "limit".
– Maximum heap size per process
In the command output, data and stack size point to
En la salida del comando, los datos y el tamaño del stack apuntan a las limitaciones
memory limitations.
See also: Another way is to use SAP’s “memlimits” executable. de la memoria.
SAP Note 1704753 – Inst.Systems Based on NetWeaver on UNIX In its output, “Maximum heap size per process” refers to Otra forma es usar el ejecutable "memlimits" de SAP.
SAP Note 1827960 – Adjusting operating system limits for SAP instances this user’s limitations.
En su salida, "Tamaño máximo de heap size" se refiere a las limitaciones de este
usuario.
Memoria del sistema operativo para <sid> adm
*Determinarlo por:
sh -c 'ulimit -a’ o csh -c limit
Herramienta SAP: memlimits -v off

*En salida de comando se refieren a:


• tamaño de datos,
• tamaño de stack (los requisitos varían según el sistema
operativo)
• Tamaño máximo de heap por proceso

Ver también:
SAP Note 1704753 - Inst.Systems basados ​en NetWeaver en
UNIX
Nota de SAP 1827960 - Ajuste de los límites del sistema
operativo para las instancias de SAP

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 24


Memory Management Configuration Each SAP instance has an initial and a maximum possible memory
Instance-specific memory requirement

Memory requirement of SAP instance If you run the command tool sappfpar using the instance profile
and the check option, the output provides the following
 Determine it by: information:
*First, the “Total, minimum requirement”
– sappfpar check pf=<instance profile> is the memory which is allocated when starting the SAP system.
*Later, the “Total, worst case requirement” is the maximum
 At the bottom of command output: usage made of the various shared memory segments
at the operating system level.
– Total, minimum requirement *The “Total, worst case requirement” value must fit into the
available virtual memory.
– Total, worst case requirement
If more SAP instances are running on the same host, you need to
Shared Memory (SHM) + Extended Memory (EM) total + summarize their worst-case requirement.
Heap total The tool sappfpar with the check option also verifies the
parameter configuration,
– Errors detected (e.g. segment size) and reports if there are any errors to be corrected.

 What to consider:
– Total, worst case requirement must fit in RAM+Swap
Cada instancia de SAP tiene un requisito de memoria inicial y máximo
– Errors detected must be 0 ---> change posible
configuration if there are any Si ejecuta la herramienta de comando sappfpar utilizando el perfil de
instancia y la opción de verificación.
Requisito de memoria de la instancia de SAP La salida proporciona la siguiente información:
*Determinarlo por: * Primero, el "Total, requisito mínimo"
sappfpar check pf = <perfil de instancia> es la memoria que se asigna al iniciar el sistema SAP.
* Más tarde, el "Total, de requisitos en el peor de los de casos" es el uso
*En la parte inferior de la salida de comando: máximo que se hace de los diversos segmentos de memoria compartida, a
• Total, requisito mínimo nivel del sistema operativo.
• Total, requisito de peor caso El valor de "Total, de los requisitos en el peor de los casos" debe encajar en
• Memoria compartida (SHM) + Total de memoria extendida (EM) + la memoria virtual disponible.
Heap Total
• Errores detectados (por ejemplo, tamaño de segmento) Si se ejecutan más instancias de SAP en el mismo host, debe sumarizar el
requisito del peor de los casos.
*Qué considerar:
• Total, el requisito de peor caso debe caber en RAM + Swap La herramienta sappfpar con la opción de verificación
• Los errores detectados deben ser 0 ---> cambiar la configuración si hay también verifica la configuración del parámetro, e informa si hay errores por
alguno corregir.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 25
Memory Management Configuration
ZAMM (1)
Zero Administration Memory Management
 One parameter:
– PHYS_MEMSIZE
– % of RAM or absolute value in MB, default 100% RAM
– other memory parameters are automatically derived from
it, platform dependently, by best practices formulas

 Change if:
– further SAP instances are planned on same host
– you want to adjust the resource requirement of an SAP
instance
Administración de memoria de administración cero
*Un parámetro:
• PHYS_MEMSIZE
• % de RAM o valor absoluto en MB, predeterminado 100% RAM
• Otros parámetros de memoria se derivan automáticamente de ella,
dependiendo de la plataforma, mediante fórmulas de mejores
prácticas.

*Cambiar si
• Se planean más instancias de SAP en el mismo host
• quieres ajustar el requerimiento de recursos de una instancia de SAP

The values of the individual memory configuration parameters


are automatically obtained from the value of the profile
parameter PHYS_MEMSIZE,
with the help of formulas depending on the operating system
platform. Los valores de los parámetros de configuración de memoria individuales, se obtienen automáticamente del valor del parámetro de perfil PHYS_MEMSIZE,
Some of the formulas are shown on the screenshot. Con la ayuda de fórmulas en función de la plataforma del sistema operativo.
Algunas de las fórmulas se muestran en la captura de pantalla en la siguiente lamina.
You need to adjust PHYS_MEMSIZE from the default value only
if you install several instances of the same
host or if you want to adjust the resource requirement of an SAP Debe ajustar PHYS_MEMSIZE del valor predeterminado solo si instala varias instancias del mismo host o si desea ajustar los requisitos de recursos de una
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 26
instance. instancia de SAP.
Memory Management Configuration Algunas formulas se muestran en esta pantalla:
ZAMM

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 27


Memory Management Configuration
ZAMM (2)
Zero Administration Memory Management
 Offers a good basic settings which may need to be adjusted.
 To check old values that are still set against new calculated ones, use
sappfpar check_formula pf=<profile>
 and decide which is more suitable for the SAP instance.
 See also:
– SAP Note 88416 – Zero administration memory management for the
ABAPserver
– SAP Note 2085980 – New features in memory management as of Kernel
Release 7.40

Administración de memoria de administración cero


*Ofrece una buena configuración básica que puede necesitar ser ajustada.

*Para verificar los valores antiguos que todavía están configurados con los nuevos
calculados, use sappfpar check_formula pf = <perfil>
y decida cuál es más adecuado para la instancia de SAP.

Zero administration memory La administración de memoria de administración cero


management offers a good basic ofrece una buena configuración básica.
setting.
The values are not hardcoded
because they do not necessarily Los valores no están codificados debido a que no
suit to the requirements necesariamente se ajustan perfectamente a los
perfectly in all the requisitos en todos los configuraciones
configurations.
Puede usar el comando "sappfpar" con la opción
You can use the command
“sappfpar” with the check option
de verificación para validar qué parámetros se desvían
to validate which parameters de su valor predeterminado y decidir cuál es el más
deviate from their default value adecuado para la instancia de SAP.
and decide which is more
suitable for the SAP instance.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 28
Memory Management Configuration
Issues

Typical issues:
 Work process-specific memory limits reached (dump)
 Instance-specific memory limits reached (dump)
 Operating system memory fully utilized or user- specific
operating system limits reached (crash, dump)

Problemas típicos:
• Límites de memoria específicos del WP alcanzados (volcado)
• Límites de memoria específicos de la instancia alcanzados (volcado)
• Memoria del sistema operativo totalmente utilizada o límites del sistema
operativo específicos del usuario alcanzados (bloqueo, volcado)

Typical memory issues while Los problemas típicos de memoria al trabajar


working with SAP systems are: con sistemas SAP son:
Memory limits reached which
are specific to a work process,
or memory limits reached
• Los límites de memoria alcanzados que son
which are specific to the SAP específicos de un WP,
instance, or memory issues on • o los límites de memoria alcanzados que
the operating system level. son específicos de La instancia de SAP,
• o problemas de memoria en el nivel del
sistema operativo.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 29


Memory Management Configuration
Tools

Monitoring tools
 ABAP:
– ST02
– ST06
– RZ20
– SM50 / SM66 (PRIV)
– RSMEMORY ------------------
 Operating system:
– top
– ps aux
– Windows task manager
– ...
Memory Management Configuration
Tools
Hay varias herramientas de monitoreo disponibles en el sistema SAP y en el nivel del sistema
Several monitoring tools are available in the SAP
system and on the operating system level
operativo para Determinar el uso de los recursos y encontrar los posibles factores a
to determine the usage of resources and find optimizar.
the potential factors to optimize.
Tales herramientas son:
Such tools are: Transacción ST02
Transaction ST02 que muestra el uso actual de la memoria en porcentaje.
that displays the current usage of memory in
percentage.
Además, puede comparar el valor en memoria con el uso máximo para ver si ya se ha
In addition, you can compare the in-memory alcanzado.
value to the maximum usage to see if it has
already been reached. Transacción ST06
ofrece una visión general de los recursos del sistema operativo:
Transaction ST06 los valores actuales, las 24 horas anteriores y el historial también si desea mirar hacia atrás
offers an overview of the operating system
resources:
los últimos días.
current values, previous 24 hours ones, and
history as well if you want to look back to Transacción RZ20
the last days. También tiene elementos de árbol de monitoreo para generar alertas cuando se alcanzan
algunos umbrales de memoria.
Transaction RZ20
also has monitoring tree elements to generate
alerts when some memory thresholds are
Transacciones SM50 y SM66
reached. son útiles para verificar si los WP han entrado en el modo PRIV y cuánto tiempo han estado
en ese modo.
Transactions SM50 and SM66
are helpful to check whether work processes Transacción RSMEMORY
have entered the PRIV mode and how long they le permite visualizar la memoria global extendida y la descripción general de la memoria
have been in that mode.
PROC por proceso y en el nivel de instancia de SAP.
Transaction RSMEMORY
enables you to display extended global memory Cada sistema operativo también ofrece herramientas para monitorear los recursos de
and PROC memory overview per process and at memoria.
the SAP instance level. Como:
Top
Each operating system also offers tools to
monitor memory resources.
ps aux
-Administrador de tareas de Windows

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 31


Memory Management Configuration
Dumps

Typical memory dumps (ST22)


 SYSTEM_MEMORY_ERROR

 SYSTEM_NO_MEMORY

 SYSTEM_NO_ROLL

 SYSTEM_NO_SHM_MEMORY

 SYSTEM_NO_TASK_STORAGE

 SYSTEM_SHM_NO_ROLL

 ...

 TSV_TNEW_BLOCKS_NO_ROLL_MEMORY

 TSV_TNEW_OCCURS_NO_ROLL_MEMORY

 TSV_TNEW_PAGE_ALLOC_FAILED

 ...

 LOAD_NO_ROLL

When resources are exhausted, SAP system Cuando se agotan los recursos,
raises a short dump and collects the most el sistema SAP genera un volcado corto y recopila la
important information in it. información más importante que contiene.
You can view a list of the short dumps in
transaction ST22.
Puede ver una lista de los volcados cortos en la
Short dumps are either the result of a transacción ST22.
shortage at the operating system level or at
ABAP level. Los volcados cortos son el resultado de una escasez a
nivel del sistema operativo o a nivel ABAP.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 32
Memory Management Configuration
Dumps (2)
Typical memory dumps (ST22)
Special case:
 *NO_ROLL* dumps
They point to EM shortage.

Background:
Starting with SAP NetWeaver 7.4, all data that was stored in the classic ROLL
area in earlier releases will be stored in the extended memory together with
the other data contained in the ABAP user context, to simplify configuration.

Volcados de memoria típicos (ST22)


Caso especial:
* NO_ROLL * volcados
Señalan la escasez de EM (Extended Memory)

Fondo:
A partir de SAP NetWeaver 7.4, todos los datos que se almacenaron en el área ROLL clásica,
en versiones anteriores se almacenarán en la memoria extendida
junto con los demás datos contenidos en el contexto del usuario ABAP,
para simplificar la configuración.

As from SAP NetWeaver 7.40, ROLL area does


A partir de SAP NetWeaver 7.40, el área ROLL ya no
not exist anymore. existe.

Therefore the dumps which include the ROLL Por lo tanto, los volcados que incluyen el patrón ROLL
pattern point to a shortage in extended apuntan a una escasez en la memoria extendida.
memory.

Earlier ROLL parameters are obsolete as well.


Los parámetros ROLL anteriores también son obsoletos.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 33


System dumps offer important information
Memory Management Configuration about the type of the error.
Los volcados del sistema ofrecen información importante sobre el tipo de error.
Analysis This information helps you to determine Esta información le ayuda a determinar dónde está el problema y qué acciones
where the problem is and what corrective correctivas deben realizarse.
action needs to be performed.
Dump analysis (ST22) En la diapositiva, hemos enumerado la información más importante que debe
On the slide, we have listed the most consultar en el caso de un volcado corto.
Most important parts: important information you need to look at in
 Runtime errors, i.e. the name of dump the case of a short dump.
Los puntos más relevantes son:
* Errores de tiempo de ejecución, que es el nombre del volcado.
 Short text The more relevant points are:
* Texto breve, que da una pista sobre la posible causa raíz.
*Runtime errors, which is the name of the
 Error analysis dump. * Consumo de memoria, incluyendo memoria extendida y de pila.
*Short text, which gives a hint about the * Número de WP para localizar la traza de desarrollador correspondiente.
 System environment, such as SAP release, SP level, OS, possible root cause.
SAP kernel and patch, database *Memory consumption, including extended
and heap memory.
*Work process number to locate the
corresponding developer trace.
 Memory consumption, such as EM, Heap, MM used, MM free
 Work process number (dev_wXX)
 User and transaction
 Information on where terminated
 Source code extract (ABAP)

Análisis de volcado (ST22) / información más importante que debe consultar en


el caso de un volcado corto.
Partes más importantes:
*Errores de tiempo de ejecución, es decir, el nombre del volcado
*Texto corto
*Análisis de errores
*Entorno del sistema, como el lanzamiento de SAP, nivel de SP, OS, Kernel y
parche SAP, BD
*Consumo de memoria, Tal como EM, Heap, MM usado, MM Libre
*Número de WP (dev_wXX)
*Usuario y transacción
*Información sobre dónde termina
*Extracto de código fuente (ABAP)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 34


Memory Management Configuration Análisis de volcado (ST22)

Analysis Partes más importantes:


• Errores de tiempo de ejecución, es decir, el nombre del volcado
• Texto corto
• Análisis de errores
• Entorno del sistema,
• como la versión de SAP, el nivel de SP, el sistema operativo,
• Kernel y parche de SAP, base de datos
• Consumo de memoria, como EM, Heap, MM utilizado, MM libre
• Número de proceso de trabajo (dev_wXX)
• Usuario y transacción
• Información sobre dónde terminó
• Extracto de código fuente (ABAP)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 35


The memory consumption part of the dump can
Memory Management Configuration show that there are two possible causes: La parte de consumo de memoria del volcado puede mostrar que hay
One, when extended memory and heap usage dos causas posibles:
Best practices corresponds to or is very close to the values
set by parameter ztta/roll_extension and 1. Una, cuando la memoria extendida y el uso de la heap
Memory consumption – EM, Heap: parameters abap/heap_area_dia or *_nondia. corresponden o están muy cerca de los valores establecidos por el
And two, when extended memory and heap
parámetro ztta / roll_extension y los parámetros abap /
1. Corresponds to (or very close to) process-specific limits usage are different from those limits or the total
heap_area_dia o * _nondia.
resource has been used.
EM: ztta/roll_extension Para la primera causa, consulte "Transacción" e "Información sobre
For the first cause, refer to "Transaction", and
dónde terminó" en el volcado
Heap: abap/heap_area_(dia|nondia) "Information on where terminated" in the dump
and involve the application specialists so they e involucra a los especialistas en aplicaciones para que puedan
2. Different from process-specific limits could verify why so much memory is being used. verificar por qué se está utilizando tanta memoria.
It is also worth restricting selection criteria
How to react: wherever it is possible in the application in
También vale la pena restringir los criterios de selección siempre que
order to consume less memory. sea posible en la aplicación para consumir menos memoria.
1. Involve the application specialists (refer to “Transaction”, “Information on where
terminated”, “Source code extract” in dump) so they verify why so much The second reason points to a capacity 2. Y dos, cuando la memoria extendida y el uso de la heap son
memory is being used; restrict selection criteria of report if possible bottleneck on the instance or at the operating diferentes de esos límites o se ha usado el recurso total.
system level.
2. Review work process trace (see “Work process number” in dump) for details, La segunda razón apunta a un cuello de botella de capacidad en la
either instance or operating system limits reached In the corresponding developer trace file, more instancia o en el nivel del sistema operativo.
details are provided on the root cause.
See also: En el Developer trace file correspondiente, se proporcionan más
detalles sobre la causa raíz.
– SAP Memory Management System

Mejores Practicas:
Consumo de memoria - EM, Heap:
1.Corresponde a (o muy cerca de) los límites específicos del proceso
EM: ztta / roll_extension
EM: abap / heap_area_ (dia | nondia)
2.Diferente de los límites específicos del proceso
Como reaccionar:
*Involucre a los especialistas de la aplicación
1. (consulte "Transacción",
2. "Información sobre dónde terminó",
3. "Extracto de código fuente" en el volcado)
para que verifiquen por qué se utiliza tanta memoria; restringir los criterios de selección del informe si es posible
*Revise el WP Trace(consulte "Número de WP" en el volcado) para obtener más detalles, ya sea la instancia o los
2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 36
límites©del sistema operativo alcanzados
Week 2: Memory Management and Gateway Service
Unit 3: Fundamentals of SAP Gateway
In this unit, we will talk about the SAP Gateway.
Before we begin, let us clarify what we mean by SAP Gateway.
In this openSAP course, we mean the SAP kernel process called gateway,
not the SAP NetWeaver Gateway 2.0, which is an ABAP-based product that handles OData requests
and is used with the SAP Fiori.

En esta unidad, hablaremos sobre el Gateway SAP.


Antes de comenzar, aclaremos a qué nos referimos con SAP Gateway.
En este curso de openSAP, nos referimos al proceso del kernel de SAP denominado gateway,
no el SAP NetWeaver Gateway 2.0, que es un producto basado en ABAP que maneja OData solicita y se utiliza con el SAP Fiori.
Fundamentals of SAP Gateway
Usage (1)
 The gateway carries out RFC services within the SAP
world, which are based on TCP/IP. These services enable
SAP systems and external programs to communicate with
one another.
 RFC services can be used either in the ABAP program
or for the external programs using the interfaces.
 RFC can be used between processes of an
instance or a system, or between systems.
Uso de la Gateway
• La gateway lleva a cabo servicios RFC dentro del mundo SAP, que se basan
en TCP / IP. Estos servicios permiten que los sistemas SAP y los programas
externos se comuniquen entre sí.

• Los servicios RFC se pueden utilizar en el programa ABAP o para los


programas externos que utilizan las interfaces.

• RFC puede ser utilizado entre procesos de una Instancia o un sistema, o


entre sistemas.

The gateway handles all the RFC


communication in SAP systems. La gateway maneja todas las comunicaciones RFC en los sistemas SAP.
RFC communication uses TCP/IP
connections.
La comunicación RFC utiliza conexiones TCP / IP.
Una comunicación RFC puede ocurrir entre dos instancias ABAP del
An RFC communication can occur
between two ABAP instances of the
mismo sistema,
same system, entre dos sistemas diferentes,
between two different systems, o incluso entre un sistema SAP y un sistema de terceros que utiliza una de
or even between an SAP system and a las bibliotecas proporcionadas por SAP,
third-party system that uses one of the como el SDK RFC de NetWeaver o el JCo.
libraries provided by SAP,
like the NetWeaver RFC SDK or the JCo.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 38


Fundamentals of SAP Gateway Each ABAP instance has its own, local gateway process.
A gateway is not installed at the ABAP Central Services Cada instancia de ABAP, tiene su propio proceso de gateway local.
Usage (2) Instance – the ASCS instance, by default.
La gateway no está instalada en la instancia de servicios centrales de ABAP: la instancia de
The following figure shows three different SAP systems. However, if the system has an ASCS instance, it is ASCS, de forma predeterminada.
possible to install a Gateway on it. Sin embargo, si el sistema tiene una instancia ASCS, es posible instalar un Gateway en él.
Here you can see the differences between the Such gateway would be called a standalone gateway, as
installation types ABAP-only, Java-only, and dual stack: Dicha gateway se llamaría standalone gateway, ya que no se adjuntará a un Dispatcher
it will not be attached to a dispatcher process.
It is also possible to install an instance that has only the Process.
 For ABAP systems, each instance contains a gateway gateway. También es posible instalar una instancia que tenga solo la gateway.
that is started and monitored by the ABAP dispatcher. This will be called a standalone gateway as well.
Esto también se llamará una standalone gateway.
 For systems with an ASCS instance, it is possible to At Java systems, a standalone gateway is installed at En los sistemas Java, se instala una standalone gateway en
configure a gateway on the ASCS instance. By default, the Java Central Services Instance, the SCS instance. • la instancia de servicios centrales de Java,
it is not configured. One gateway is enough for Java systems, as the Java
• la instancia de SCS.
instances will not communicate with each other
 For Java systems, one gateway is enough for the whole through the Gateway, Una gateway es suficiente para los sistemas Java,
system, because the instances communicate with each as it can happen in ABAP systems, depending on the
ya que las instancias de Java no se comunicarán entre sí a través de la Gateway
other and not using the RFC. The gateway is used for application request.
Como puede ocurrir en los sistemas ABAP, dependiendo de la solicitud de la aplicación.
RFC/JCo connections to other systems.

Uso de la Gateway 2
La siguiente figura muestra tres sistemas SAP diferentes.
Aquí puede ver las diferencias entre los tipos de instalación
solo 1.ABAP, 2.solo Java y 3. Dual stack.
Para los sistemas ABAP,
Cada instancia contiene una gateway iniciada y supervisada por el
despachador ABAP.
Para sistemas con una instancia de ASCS,
Es posible configurar una gateway en la instancia de ASCS.
Por defecto, no está configurado.
Para los sistemas Java,
Una gateway es suficiente para todo el sistema,
porque las instancias se comunican entre sí y no utilizan el RFC.
La gateway se utiliza para las conexiones RFC / JCo a otros
sistemas.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 39


Fundamentals of SAP Gateway El nombre del proceso de la gateway
Architecture of the gateway (1) en el nivel del sistema operativo es gwrd
Gateway Processes En las instancias de ABAP,
 The SAP Gateway is made up of: el despachador iniciará y supervisará la gateway.

– Gateway read process (usual name: gateway) Si detecta que la gateway no se está ejecutando más,
intentará iniciar una nueva gateway.
– Gateway monitor
Si no se puede iniciar la gateway,
el despachador activará un apagado de emergencia y
Gateway Read Process detendrá la instancia.
 Gateway read is started by the dispatcher and Esto se debe a que la gateway es un proceso clave para el
checked by it periodically. funcionamiento normal de una instancia ABAP.

 The gateway reader receives all RFC requests and hands El procesamiento real de las solicitudes RFC
them over to a DIA WP; the processing takes place there. tiene lugar en los WP de diálogo.
Procesos de Gateway El gateway entrega una solicitud RFC entrante a un WP de
El Gateway SAP se compone de: diálogo libre,
1. Proceso de lectura de la gateway (nombre habitual: gateway) y se encarga de enviar la respuesta a la persona que llama,
2. Monitor de gateway una vez que el WP de diálogo finalizó el procesamiento.

Proceso de lectura de gateway


• El Dispatcher inicia la lectura de la gateway y la verifica
periódicamente.
• El lector de la gateway recibe todas las solicitudes de RFC y las
entrega a un DIA WP; El procesamiento se lleva a cabo allí.

The name of the gateway process at operating system level is gwrd.


At ABAP instances, the dispatcher will start and monitor the gateway.
If it detects that the gateway is not running any more, it will try to start a new gateway.
If the gateway cannot be started, the dispatcher will trigger an emergency shutdown and
will stop the instance.

This is because the gateway is a key process for the normal operation of an ABAP
instance.
The actual processing of RFC requests takes place at the dialog work processes.
The gateway hands over an incoming RFC request to a free dialog work process and takes
care of sending the response back to
the caller, once
© 2017 SAPthe processing
SE or was
an SAP affiliate finished
company. by the
All rights dialog
reserved. work process.
ǀ PUBLIC 40
Fundamentals of SAP Gateway At an ABAP instance, we can monitor the local En una instancia ABAP, podemos monitorear la gateway local a través de la
gateway through the transaction SMGW. transacción SMGW.
Architecture of the gateway (2)
When we open this transaction, we are
Gateway Monitor presented with a list of the currently active Cuando abrimos esta transacción, se nos presenta una lista de las conexiones
connections. activas actualmente.
 The gateway monitor (transaction SMGW) is used to analyze and
administer the gateway. When you start it, you initially get a list of active We also see some information about the status También vemos información sobre el estado de la gateway, en el encabezado en
connections. of the gateway, at the header on the top of the la parte superior de la pantalla.
screen.
 You can call up all the other monitor functions via a menu.
At this transaction, we can also see a list of En esta transacción, también podemos ver
These are among others:
external systems that are connected to this • una lista de sistemas externos que están conectados a esta gateway,
– Display Logged-On Clients gateway, • muestra el valor actual de los parámetros de la gateway,
display the current value of gateway parameters, • cambia el valor de los parámetros que se pueden cambiar dinámicamente,
– Display and Control Existing Connections change the value of parameters that are • y mantener las diferentes características de seguridad de la gateway.
dynamically switchable,
– Display Gateway Release Information and maintain the different security features of
– Display Parameters and Attributes of the Gateway the gateway.

– Change Gateway Parameters


– Activate Traces
– Expert Functions

Monitor de Gateway
• El monitor de gateway (transacción SMGW) se utiliza para analizar y
administrar la gateway.
• Cuando lo arranca, inicialmente obtiene una lista de conexiones activas.
Puede acceder a todas las demás funciones del monitor a través de un menú.
Estos son entre otros:
 Mostrar clientes conectados
 Visualización y control de conexiones existentes
 Mostrar información de la versión de Gateway
 Mostrar parámetros y atributos de la gateway
 Cambiar los parámetros de la gateway
 Activar rastreos o traces
 Funciones de experto

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 41


Fundamentals of SAP Gateway
You can also monitor the
Architecture of the gateway (3) gateway at operating system
level by using the gwmon tool.

Gateway Monitor Although it does not have all the


features available as the
 You can also monitor the gateway at operating transaction SMGW,
system level. Use program gwmon. you can perform several
important actions using
 It has a reduced set of functionality compared to this tool, like
SMGW. listing the active connections
and reloading the security
configuration files without
having to restart the gateway.
Monitor de gateway
También puede monitorear la gateway a nivel del sistema
operativo.
Utiliza el programa gwmon
Tiene un conjunto reducido de funcionalidades en comparación
con SMGW.

También puede monitorear la gateway a nivel del sistema


operativo utilizando la herramienta gwmon.

Aunque no tiene todas las funciones disponibles como la


transacción SMGW, puede realizar varias acciones importantes
utilizando
esta herramienta, como>
• enumerar las conexiones activas
• y recargar los archivos de configuración de seguridad sin tener
que reiniciar la gateway.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 42


Fundamentals of SAP Gateway The gateway is configured through profile
parameters, which are read when the
Configuring the gateway gateway is started.

You can see the parameters at the


 The installation of a gateway for TCP/IP connections
transaction SMGW,
within an instance of an SAP system is standard. menu Goto,
Parameters,
 As with all SAP programs, the gateway can be Display/Change.
controlled by parameters.
While you are in edit mode, the parameters
 The gateway reads the parameters from the SAP that are dynamically switchable will have
profile like every other process. the background in white color as we can
see at the screenshot on the slide.
 Changes to static parameter values (blue rows) only
take effect when you restart the system.
 Dynamic parameter values (white rows), on the other
hand, can be changed during runtime.

Configurar la Gateway La gateway se configura mediante parámetros de


perfil, que se leen cuando se inicia la gateway.
• La instalación de una gateway para conexiones TCP / IP
dentro de una instancia de un sistema SAP es estándar.
Puede ver los parámetros en la transacción
• Como con todos los programas de SAP, la gateway se puede
SMGW,
controlar mediante parámetros.
menu
• La gateway lee los parámetros del perfil de SAP como
->Goto,
cualquier otro proceso.
->>Parámetros,
• Los cambios en los valores de parámetros estáticos (filas
->>>Mostrar / Cambiar.
azules) solo surten efecto cuando reinicia el sistema.
• Los valores de parámetros dinámicos (filas blancas), por otro
Mientras esté en modo de edición,
lado, se pueden cambiar durante el tiempo de ejecución.
los parámetros que se pueden cambiar
dinámicamente tendrán el fondo en color blanco
como podamos
ver en la captura de pantalla en la diapositiva.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 43


Fundamentals of SAP Gateway
Security settings in the gateway (1)
 SAP Gateway is an interface between the application server and other SAP
systems or programs. Application servers and database hosts are in the
same network segment. This network is secured from external access through
a demilitarized zone (DMZ).
 RFC communication via the SAP Gateway to remote systems / programs via
the Internet is in principle unsecure if no further actions are taken.
Configuraciones de seguridad en la gateway (1)
SAP Gateway es una interfaz
entre el servidor de aplicaciones y otros sistemas o programas de SAP.

Los servidores de aplicaciones y los hosts de bases de datos están en el mismo segmento de red.
Esta red está protegida del acceso externo a través de una zona desmilitarizada (DMZ).

La comunicación RFC a través de la gateway de SAP a sistemas / programas remotos a través de


Internet no es segura en principio si no se toman más medidas

Now, let us talk about the security features of the gateway.

You can protect the SAP servers through your network Ahora, hablemos sobre las características de seguridad de la gateway.
infrastructure.
However, this usually does not provide application level
security, Puede proteger los servidores SAP a través de su infraestructura de red.
for example, which program name a third-party system can Sin embargo, esto generalmente no proporciona seguridad a nivel de aplicación, por ejemplo,
use when registering itself at the gateway. qué nombre de programa puede usar un sistema de terceros al registrarse en la gateway.

Therefore, the gateway provides security features from its Por lo tanto, la gateway proporciona características de seguridad desde su nivel de aplicación.
application level.

In addition, the data exchanged through RFC communication Además, los datos intercambiados a través de la comunicación RFC no están encriptados de
is not encrypted by default. manera predeterminada.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 44


Fundamentals of SAP Gateway Encryption of RFC communication can
be El cifrado de la comunicación RFC puede ser activado habilitando el SNC,
Security settings in the gateway (2) activated by enabling the SNC, Secure Network Communication.
Secure Network Communication.
La gateway tiene una Lista de control de acceso, que puede ser utilizada
System administrators have several options to configure external The gateway has an Access Control List
that can
para determinar qué servidores remotos pueden conectarse a la gateway.
communication of the gateway to make it more secure:
be used to determine which remote
 Configuring support of Secure Network servers are allowed to connect to the Y también hay características de seguridad para controlar,
Communication (SNC) components gateway. qué servidores remotos pueden registrar un programa en la gateway,
por lo que el sistema ABAP puede devolver la llamada al sistema remoto;
 Configuring network-based access control lists (ACL) And there are also security features to y qué usuarios pueden iniciar qué programas, bajo demanda.
control
 Configuring the startup of connections between the gateway and external which remote servers can register a
programs to make them more secure program at the gateway, so the ABAP
system can call the remote system
– Logging-based configuration back; and which users can start which
programs on demand.
– Restrictive configuration (secure configuration)

Los administradores del sistema tienen varias opciones para configurar la


comunicación externa de la gateway para que sea más segura:
• Configuración de soporte de red segura
• Componentes de comunicación (SNC)
• Configuración de listas de control de acceso basadas en red (ACL)
• Configurar el inicio de conexiones entre la gateway y los programas externos para
hacerlos más seguros
• Configuración basada en el registro
• Configuración restrictiva (configuración segura)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 45


Fundamentals of SAP Gateway Let us talk about the SNC. Hablemos del SNC.

SNC support (1) When you configure SNC at an ABAP


instance, it will allow encrypted
Cuando configura SNC en una instancia ABAP,
permitirá la comunicación encriptada de los usuarios de la GUI de SAP al sistema,
communication from SAP GUI users to the así como también habilitará el encriptado para la comunicación RFC.
Configuring support of SNC components system, as well as enable encryption for
 The parameter snc/enable specifies whether the system incl. the RFC communication. Las conexiones no SNC aún se pueden permitir.
gateway is to support SNC. Non-SNC connections can still be La gateway leerá los parámetros de SNC al inicio y abrirá un puerto TCP / IP adicional si
 snc/enable = 0  no SNC connections are accepted. permitted. SNC está habilitado.
El número del puerto habilitado para SNC es 48, y luego el número de instancia.
 The gateway checks whether connections to non-SNC The gateway will read the SNC parameters
upon startup and will open one additional Por ejemplo, el puerto habilitado para SNC para una instancia 00 sería 4800.
programs are permitted. snc/permit_insecure_start = 1
TCP/IP port if SNC is enabled.
 connections to non-SNC programs are permitted.
El número del puerto no SNC es 33 y luego el número de instancia, y este puerto
SNC-enabled port: 48XX The number of the SNC-enabled port is 48, siempre está abierto.
and then the instance number. For
Non-SNC port: 33XX example, the SNC-enabled port for an
instance 00 would be 4800.

Please note: Establishing an SNC-protected connection is time- The number of the non-SNC port is 33 and
consuming, and it will therefore have an impact on performance. then the instance number, and this port is
always opened.
See also: Recommendations regarding SNC configuration

Configuración de soporte de componentes SNC


El parámetro snc / enable especifica si el sistema incluye.
La gateway es para soportar SNC.
snc / enable = 0 -> no se aceptan conexiones SNC.

La gateway comprueba si se permiten conexiones a programas que no son SNC.


snc / permit_insecure_start = 1 ->se permiten conexiones a programas que no son
de SNC.

Puerto habilitado para SNC: 48XX


Puerto no SNC: 33XX

Tenga en cuenta que el establecimiento de una conexión protegida con SNC lleva
mucho tiempo y, por lo tanto, tendrá un impacto en el rendimiento.

Ver también: Recomendaciones sobre la configuración de SNC


© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 46
Fundamentals of SAP Gateway Since the encryption and decryption of the
packets can be time-consuming, it is possible
Desde el cifrado y descifrado de los paquetes, pueden llevar mucho tiempo, es posible usar
saprouters y transferirles las tareas de cifrado.
SNC support (2) to use saprouters and transfer the encryption
tasks to them.
El saprouter es un motor independiente y no requiere una conexión a una base de datos.
Configuring support of SNC components The saprouter is a standalone engine and it Se puede instalar en los dos extremos del canal de conexión y tener SNC habilitado.
does not require a connection to a database. It
As an alternative to SNC support, you can also secure can be installed at the two ends of the
communication between SAP Gateways of different SAP systems connection channel and have SNC enabled.
En este escenario, el cliente puede iniciar una conexión no SNC con el primer saprouter, que
by using SAP routers. cifra los datos y los envía al segundo saprouter a través de un canal habilitado para SNC.
In this scenario, the client can start a non-SNC
They take on the SNC encryption and SNC encoding tasks. connection to the first saprouter, which El segundo saprouter descifra los datos y establece una conexión no SNC con el sistema SAP.
See also: encrypts the data and sends it to the second
Configuring SNC: SAProuter → SAProuter saprouter through an SNC-enabled channel.

The second saprouter decrypts the data and


Configuración de soporte de componentes SNC establishes a non-SNC connection with the SAP
Como alternativa al soporte SNC, system.
también puede asegurar la comunicación entre las gateway de SAP de
diferentes sistemas SAP mediante el uso de enrutadores SAP.
Asumen las tareas de cifrado SNC y codificación SNC.

SAProuter
Es un programa que actúa, como una ubicación intermedia en la red entre
sistemas SAP, donde el acceso se controla antes de enviar los datos más
adelante en el camino de la comunicación.
También se pueden establecer conexiones entre sistemas SAP a través de varios
SAProuters.
Luego puede asegurar y proteger las conexiones entre los SAProuter adyacentes
utilizando SNC.
Los SAProuters se autentican entre sí, y encriptan los mensajes intercambiados.
De esta manera, puede establecer un túnel seguro para las comunicaciones
entre componentes que no puedan utilizar SNC.
Un único SAProuter puede ser tanto el iniciador como el aceptador de una
conexión protegida con SNC.

Un ejemplo típico se muestra en la figura a continuación.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 47


Fundamentals of SAP Gateway Besides the encryption of the
communication, we can configure gateway
Además del cifrado de la comunicación,
podemos configurar las características de seguridad de la gateway
Secure configuration (1) security features related to the
registration of external systems at SAP and relacionadas con el registro de sistemas externos en SAP,
the on-demand startup of programs by y el inicio de programas a pedido por parte de SAP,
Configuring connections between the gateway SAP, como hemos mencionado anteriormente.
and external programs to make them more as we have mentioned earlier.

secure Tenemos dos enfoques para configurar estas características.


We have two approaches to configure
these features. • Una es la configuración basada en el registro,
To ensure the SAP Gateway operates more securely, be • la otra es el enfoque manual y más restrictivo.
especially aware of interaction with external programs. You can One is the logging-based configuration,
the other is the manual, more restrictive
configure the gateway to ensure that undesirable external approach.
programs cannot be run.
There are two ways to do this:
 Logging-based configuration
 Restrictive configuration (secure configuration)

Configurar conexiones entre la gateway y programas externos para hacerlos más


seguros
Para garantizar que la gateway de SAP funcione de manera más segura, tenga
especial cuidado con la interacción con programas externos.
Puede configurar la gateway para garantizar que no se puedan ejecutar
programas externos no deseados.
Hay dos maneras de hacer esto:
• Configuración basada en el registro
• Configuración restrictiva (configuración segura)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 48


Fundamentals of SAP Gateway in the logging-based configuration,
you would not
en la configuración basada en el registro,
puedes no restringir cualquier cosa, al principio.
Secure configuration (2) restrict anything, at first.
Debería activar la función de registro de la gateway,
You would activate the logging y utilizar la información de registro para crear las reglas de seguridad
Logging-based configuration feature of the gateway and use the más adelante.
log information to create the security
To ensure SAP programs required for system operation are not blocked by a rules later. Discutiremos la función de registro, así como estos archivos de
configuration that is too restrictive, you should configure the security files to seguridad, en la próxima unidad.
We will discuss the logging feature, as
enable all connections, and monitor the gateway using gateway logging. well as these security files, at the next
This way, you get an overview of which programs are to be allowed, unit.
and can then edit the secinfo and reginfo configuration files accordingly.
See also: Setting Up Gateway Logging

Configuración basada en el registro


Para garantizar que los programas SAP necesarios, para el funcionamiento del sistema, no
estén bloqueados por una configuración demasiado restrictiva,
debe configurar los archivos de seguridad, para habilitar todas las conexiones y
monitorear la gateway mediante el registro de la gateway.

De esta manera, obtiene una visión general de los programas que se permitirán,
y luego puede editar los archivos de configuración
secinfo y reginfo
en consecuencia.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 49


Fundamentals of SAP Gateway If you use the restrictive approach, Si utiliza el enfoque restrictivo, lo haría inicialmente
you would Para permitir el registro y el inicio de programas solo desde los servidores
Secure configuration (3) initially allow the registration and
startup of programs from the local
locales de SAP,
Restrictive configuration (secure configuration) SAP servers only, and you may also y también puede crear las reglas de seguridad para los programas que ya
create the security rules for the conoce.
You configure the gateway so that initially only system- internal programs you are already aware of.
Todo lo demás estaría bloqueado.
programs can be started and registered.
Everything else would be blocked. Luego, extenderá los archivos de seguridad según sea necesario.
After that, you can add programs you want to allow to
You would then extend the security Este enfoque puede no ser adecuado para entornos de producción, ya
the secinfo and reginfo configuration files. files as needed. que puede interrumpir la comunicación con un sistema externo crítico.
To set up the recommended secure SAP Gateway configuration, This approach may not be suitable
proceed as follows: for production environments, as it
may break the communication with
 Check if parameter gw/acl_mode = 1 (default) is set a critical external system.

 Check the secinfo and reginfo files


 Extend these files as required

See also:
 SAP Note 1850230 - GW: "Registration of tp <program ID> not allowed"
 SAP Note 2145145 - User is not authorized to start an external
program

Configuración restrictiva (configuración segura)


Configura la gateway para que inicialmente, solo se puedan iniciar y registrar
programas internos del sistema.
Después de eso,
puede agregar los programas que desea permitir a los archivos de configuración
secinfo y reginfo.
Para configurar la gateway segura de SAP se recomienda, proceder de la siguiente
manera:
• Compruebe si el parámetro gw / acl_mode = 1 (predeterminado) está configurado
• Verifique los archivos secinfo y reginfo
• Extienda estos archivos según sea necesario
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 50
Week 2: Memory Management and Gateway Service
Unit 4: SAP Gateway Security Configuration
Hello and welcome to Week 2, Unit 4.
At this unit, we will talk about the security features of the gateway, in detail.
Let us start with some general tips about the security files called reginfo and secinfo.

Hola y bienvenidos a la Semana 2, Unidad 4.


En esta unidad, hablaremos sobre las características de seguridad de la gateway, en detalle.
Comencemos con algunos consejos generales sobre los archivos de seguridad llamados reginfo y secinfo.
SAP Gateway Security Configuration • La primera línea de estos archivos debe ser "# VERSION = 2",
The first line of these files should be “#VERSION=2”,
as seen at this slide. This enables the syntax version
Tips como se ve en esta diapositiva. 2 of these files, which adds more features.
Esto habilita la sintaxis versión 2 de estos archivos, que agrega más Any other line that starts with a hashtag will be
General tips for reginfo and secinfo funciones. considered a comment.
 The first line of the reginfo / secinfo file should be “#VERSION=2” Cualquier otra línea que comience con un hashtag / se considerará un
comentario. The first letter of the rule can be either P for permit
 The first letter of the rule can be either P (for Permit) or D (for Deny) or D for deny.
• La primera letra de la regla puede ser P para permiso o D para negar.
 Each line must be a complete rule, i.e. you cannot break the rule into Each line on the file must be a complete rule. It is
two or more lines • Cada línea en el archivo debe ser una regla completa.  not possible to break a rule into two or more lines.
No es posible dividir una regla en dos o más líneas.
 The gateway will apply the rules in the same order as they appear in The gateway will apply the rules in the same order as
the • La gateway aplicará las reglas en el mismo orden en que aparecen en they appear in the file.
file, and only the first matching rule will be used except for registered el archivo. The first matching rule will be used to allow the
programs: all ACCESS info of all lines will be used if the TP name La primera regla de coincidencia se utilizará para, registration or start of the program, according to the
permitir el registro o el inicio del programa de acuerdo con la pregunta firing question.
matches
de activación.
To verify the permission to access registered
 Each instance should have its own security files, with their own Para verificar el permiso para acceder a los programas registrados, programs, the gateway will combine all the servers
rules, as the rules are applied by the gateway process of the local la gateway combinará todos los servidores enumerados en el argumento listed at the ACCESS argument of all rules related to
instance; however a central file can be used as well ACCESS de todas las reglas relacionadas con este programa. this program.

 The keyword “local” means “the local server”; the keyword Discutiremos los argumentos disponibles en las siguientes diapositivas.
We will discuss the arguments available in the next
“internal” means “all servers that are part of this SAP • Cada instancia debe tener sus propios archivos de seguridad, con sus slides.
system” propias reglas, ya que las reglas son aplicadas por el proceso de
gateway de la instancia local. Each instance should have its own security files, with
See also: SAP Note 1408081 - Basic settings for reg_info and sec_info their own rules, as the rules are applied by the
En su lugar, puede usar un archivo central, si las mismas reglas se aplican gateway process of the local instance.
Consejos generales para reginfo y secinfo a todas las instancias del sistema.
You can use a central file instead, if the same rules
• La primera línea del archivo reginfo / secinfo debe ser "# VERSION = 2" • La palabra clave "local" significa "el servidor local".
apply to all instances of the system.
• La primera letra de la regla puede ser P (para Permiso) o D (para Denegar) • Y la palabra clave "interno" significa "todos los servidores que forman
• Cada línea debe ser una regla completa, es decir, no puede dividir la regla en dos parte de este sistema SAP". The keyword “local” means "the local server”.
o más líneas And the keyword “internal” means “all servers that
• La gateway aplicará las reglas en el mismo orden en que aparecen en el archivo, y Si no hay una regla que permita el registro o el inicio del programa, la are part of this SAP system”.
gateway negará la acción. If there is no rule allowing the registration or start of
solo se usará la primera regla coincidente excepto para programas registrados: the program, the gateway will deny the action.
Toda la información de ACCESO de todas las líneas se utilizará si el TP Names en otras palabras, la gateway agrega una regla implícita de "negar todo"
coincide al final durante el tiempo de ejecución. in other words, the gateway adds an implicit “deny
• Cada instancia debe tener sus propios archivos de seguridad, con sus propias all” rule at the end during runtime.
reglas, como las reglas son aplicadas por el proceso de gateway de la instancia
local; sin embargo, también se puede usar un archivo central
• La palabra clave "local" significa "el servidor local";
• la palabra clave "interno" significa "todos los servidores que forman parte de este
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 52
sistema SAP"
The reginfo file has rules related to the registration of

SAP Gateway Security Configuration external programs or systems to the local SAP instance.
For example, when you configure the SLD, the System
Landscape Directory, it will perform the registration of
El archivo reginfo
tiene reglas relacionadas con el registro de programas o sistemas
ACLs the program SLD_UC at the gateway. externos en la instancia local de SAP.
The secinfo file has rules related to the start of programs
Por ejemplo,
reginfo and secinfo by the local SAP instance.
For example, when you import a transport request Cuando configura el SLD, the System Landscape Directory,
 The reginfo file has rules related to the registration of external through the transaction STMS, it will start an SAP tool
called tp at the operating system level. realizará el registro del programa SLD_UC en la gateway.
programs (systems) to the local SAP instance
The default location of both files is the data folder of the
El archivo secinfo
 The secinfo file has rules related to the start of programs by the local SAP local instance.
The gateway reads both security files when it is started. tiene reglas relacionadas con el inicio de programas por parte de la
instance
It is possible to reload these files without having to instancia local de SAP.
restart the instance, which allows dynamic changes to
Default location/name: be made to these security rules. Por ejemplo,
 gw/sec_info = $(DIR_DATA)/secinfo cuando importa una solicitud de transporte a través de la transacción
STMS, iniciará una herramienta SAP llamada tp en el nivel del sistema
 gw/reg_info = $(DIR_DATA)/reginfo operativo.
When the gateway is started, it reads both securityfiles. La ubicación predeterminada de ambos archivos es la carpeta de datos
You can make dynamic changes by changing, adding, or deleting entries in the de la instancia local.
reginfo / secinfo file.
La gateway lee ambos archivos de seguridad cuando se inicia.
Then the file can be immediately activated by reloading the security files.
Es posible volver a cargar estos archivos sin tener que reiniciar la
reginfo y secinfo instancia, lo que permite realizar cambios dinámicos en estas reglas de
seguridad.
El archivo reginfo tiene reglas relacionadas con el registro de programas externos
(sistemas)
en la instancia local de SAP
El archivo secinfo tiene reglas relacionadas con el inicio de programas por parte de
la instancia local de SAP
Ubicación / nombre predeterminado:
 gw / sec_info = $ (DIR_DATA) / secinfo
 gw / reg_info = $ (DIR_DATA) / reginfo
Cuando se inicia la gateway, lee ambos archivos de seguridad.

Puede realizar cambios dinámicos


cambiando, agregando o eliminando entradas en el archivo reginfo / secinfo.

Luego, el archivo se puede activar de inmediato volviendo a cargar los archivos de


seguridad a través de sistema operativo con la herramienta gwmon pf = <ruta al
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 53
perfil de instancia>
SAP Gateway Security Configuration Ahora que vimos los aspectos generales de los archivos reginfo y secinfo, veamos las reglas
Now that we saw the general aspects of the
reginfo and secinfo files,
reginfo (1) de reginfo en detalle. let us see the reginfo rules in detail.

El argumento TP se utiliza para definir el nombre del programa que se registrará en la The TP argument is used to define the name of the
General reginfo rule definition program that will be registered at the gateway.
gateway.
 P (permit) / D (denied) Notice that this program name is just an alias.
Tenga en cuenta que este nombre de programa es solo un alias. It does not necessarily need to be the name of the
 TP=<program name> No necesariamente tiene que ser el nombre del sistema, producto o ejecutable que system, product or executable that will perform
realizará el registro. the registration.
 HOST=<comma separated list of hosts that can register the El argumento TP es obligatorio. The TP argument is mandatory.
program> The next arguments that we will discuss are
optional, and if they are not set, the gateway will
 ACCESS=<comma separated list of hosts that can Los siguientes argumentos que discutiremos son opcionales, assume their value to be a star or an asterisk.
communicate with the program> y si no están configurados, la gateway asumirá que su valor es una estrella o un asterisco. This would mean “all servers”, which might not be
Esto significaría "todos los servidores", lo que podría no ser bueno desde una perspectiva good from a security perspective.
 CANCEL=<comma separated list of hosts that can cancel this Therefore, it is recommended to maintain all
registration> de seguridad.
arguments on every rule, even if you set them to
Por lo tanto, se recomienda mantener todos los argumentos en cada regla, incluso si los “star”, just for clarity purposes.
Usually: establece en "estrella", solo por razones de claridad.
 ACCESS is a list with at least all SAP servers from this SAP *HOST es el argumento utilizado para definir la lista de servidores que pueden realizar el HOST is the argument used to define the list of
system; this can be replaced by the keyword “internal” servers that are allowed to perform the
registro del programa. registration of the program.
 CANCEL is a list with all SAP servers from this system, or the Puede enumerar más de un servidor, separándolos mediante comas. You can list more than one server, separating them
keyword “internal”, and also the same servers as in HOST using commas.
*En el argumento ACCESS, definimos una lista de servidores que pueden comunicarse con ‘
este programa. At the ACCESS argument, we define a list of
Definición de Regla reginfo En la mayoría de los escenarios, ACCESS tendría una lista de todos los servidores SAP del servers that can communicate with this program.
• P (permiso) / D (denegado) sistema donde está registrado el programa. On most scenarios, ACCESS would have a list of all
Puede reemplazar esta lista por la palabra clave "interna". SAP servers of the system where the program is
• TP = <nombre del programa> registered.
• HOST = <lista de hosts separados por comas que pueden registrar el *También es posible definir qué servidores pueden cancelar el registro.
programa> Esto se define en el argumento CANCELAR. You can replace this list by the keyword “internal”.
• ACCESS = <lista de hosts separados por comas que pueden Por lo general, CANCELAR incluye todos los servidores enumerados en el argumento HOST It is also possible to define which servers are
• comunicarse con el programa> allowed to cancel the registration.
y la palabra clave "interna", o la lista de servidores SAP.
This is defined at the CANCEL argument.
• CANCELAR = <lista de hosts separados por comas que pueden Esto se debe a que debemos permitir que el sistema externo o el sistema SAP finalicen el Usually, CANCEL includes all servers listed at the
cancelar este registro> registro de manera agradable. HOST argument and the keyword “internal”, or the
list of SAP servers.
Generalmente: Por ejemplo, si uno de los sistemas se detendrá por mantenimiento, puede desencadenar This is because we need to allow the external
ACCESS es una lista con al menos todos los servidores SAP de este SAP la cancelación del registro del programa. system or the SAP system to terminate the
sistema; esto puede ser reemplazado por la palabra clave "interno“ registration nicely.
For example, if one of the systems will be stopped
for maintenance, it can then trigger the de-
CANCELAR es una lista con todos los servidores SAP de este sistema, o la registration of the program.
palabra clave "interna", y también los mismos servidores que en HOST
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 54
Los cambios realizados directamente en el archivo reginfo Changes made directly to the reginfo file will not take effect immediately.
SAP Gateway Security Configuration no tendrán efecto de inmediato. First you need to reload the file through the transaction SMGW,
->menu Goto,
Primero debe volver a cargar el archivo a través de la
reginfo (2) transacción SMGW,
--> Expert functions
--->External security
Changes to the reginfo rules -> menú Ir a, ---->Maintain ACL Files,

 Changes are not immediately effective, even after having -> Funciones expertas ----->then Goto
------>Reread)
---> Seguridad externa
reloaded the file (transaction SMGW, menu Goto → Expert This will reload both the reginfo and secinfo files.
----> Mantener archivos ACL, Then, if the changes made to the rules are related to a program that is already registered,
functions → External security → Maintain ACL Files, then Goto
-----> luego Goto for example, you have modified the ACCESS argument,
→ Reread); after reloading, de-register all existing registrations all registrations of the program need to be de-registered,
------> Releer
of the affected program, and re-register it again and the program needs to be re-registered.
Esto recargará los archivos reginfo y secinfo. This is because the gateway copies the rule used at the time of the registration to a memory
 For a standalone gateway installation, you can reload the Luego, si los cambios realizados en las reglas están
area of the specific registration.
This means that if the program is registered 10 times and only 5 registrations are restarted, the
security files (reginfo and secinfo) without having to restart the relacionados con un programa que ya está registrado, por 5 new registrations will use the updated rule, and the 5 old registrations will continue to use the
gateway or the ASCS instance: gwmon pf=<path to instance ejemplo, ha modificado el argumento ACCESS, old rule.
profile> This could cause random issues, as it will depend on which registration will be used to process
todos los registros del programa deben ser dados de baja, y the request.
there access “m” Menu → “9” security information → “4” refresh sec. el programa debe volver a registrarse. How to restart the registration depends on the external system, so the support team of the
Esto se debe a que la gateway copia la regla utilizada en el remote system might have to be involved.
To reload the rules at a standalone gateway, execute the gwmon tool and access
See also (videos included): momento del registro en un área de memoria del registro the menu “m”,
– SAP KBA 1850230 - GW: "Registration of tp <program ID> not allowed” específico. then the option 9,
and then the option 4.
– SAP KBA 2075799 - ERROR: Error (Msg EGW 748 not found) Esto significa que si el programa se registra 10 veces y solo There is a video that illustrates how the reginfo rules work attached to both SAP KBAs linked at
Cambios a las reglas de reginfo se reinician 5 registros, this slide.

Los cambios no son efectivos de inmediato, los 5 registros nuevos usarán la regla actualizada
incluso después de haber vuelto a cargar el archivo (transacción SMGW, y los 5 registros antiguos continuarán usando la regla
menú Pasar a anterior.
→ Funciones expertas Esto podría causar problemas aleatorios, ya que dependerá
→ Seguridad externa de qué registro se utilizará para procesar la solicitud.
→ Mantener archivos ACL, La forma de reiniciar el registro depende del sistema
luego Pasar a externo, por lo que el equipo de soporte del sistema
→ Volver a leer); remoto podría tener que participar.
después de volver a cargar,
anule el registro de todos los registros existentes del programa afectado y Para volver a cargar las reglas en una gateway
vuelva a registrarlo nuevamente independiente, ejecute via sistema operativo la
herramienta gwmon y acceda
Para una instalación de Gateway standalone, el menú "m",
puede volver a cargar los archivos de seguridad (reginfo y secinfo) sin tener entonces la opción 9,
que reiniciar la gateway o la instancia de ASCS: y luego la opción 4.
gwmon pf = <ruta al perfil de instancia>
allí acceda al menú "m" Hay un video que ilustra cómo funcionan las reglas de
→ información de seguridad "9" reginfo adjuntas a ambos KBA de SAP vinculados en esta
2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 55
→ sec.©de actualización "4". diapositiva.
SAP Gateway Security Configuration Ahora veremos la sintaxis de las reglas secinfo.
Now we will see the syntax for the secinfo
rules.
Consider that we are creating a rule that will
secinfo allow the start of the program, that is, a rule
Considere que estamos creando una regla que permitirá el inicio del programa, es decir, una regla that starts with the letter P for permit.
que comience con la letra P para permiso.
General secinfo rule definition The TP argument is used to define the name
of the program that is to be started by SAP.
El argumento TP se utiliza para definir el nombre del programa que debe iniciar SAP.
 P (permit) / D (denied)
The username that is allowed to start the
El nombre de usuario que tiene permitido iniciar el programa se define en el argumento USER.
 TP=<program name> program is defined at the USER argument.
Este argumento solo acepta un nombre de usuario único. This argument only accepts a single
username.
 USER=<username that is allowed to start the program>
El argumento HOST define el host de destino donde se iniciará el programa. The HOST argument defines the target host
 HOST=<comma separated list of hosts the program can El sistema SAP puede iniciar programas en el servidor local y también en servidores remotos.
where the program will be started.

be started on> The SAP system can start programs at the


Puede definir más de un servidor, separándolos con comas. local server and at remote servers as well.
 USER-HOST=<comma separated list of hosts the users
can start the program from> USER-HOST puede definirse como un host o una lista de hosts donde el usuario iniciaría sesión You can define more than one server,
separating them with commas.
cuando se envía el comando para iniciar el programa. USER-HOST can be defined to a host or a list
See also (video included): Por ejemplo, puede definir la palabra clave "interna" para que el usuario pueda iniciar el programa of hosts where the user would be logged on
 SAP KBA 2145145 - User is not authorized to start an mientras está conectado a cualquier servidor SAP del sistema.
when the command to start the program is
sent.
external program For example, you can define the keyword
El SAP KBA vinculado en esta diapositiva tiene un video que ilustra cómo funcionan las reglas de “internal” so the user is allowed to start the
secinfo. program while logged on to any SAP server of
Definición general de la regla secinfo the system.

The SAP KBA linked at this slide has a video


• P (permiso) / D (denegado) that illustrates how the secinfo rules work.
• TP = <nombre del programa>
• USUARIO = <nombre de usuario que puede iniciar
el programa>
• HOST = <lista de hosts separados por comas en los
que se puede iniciar el programa>
• USER-HOST = <lista de hosts separados por comas
de los usuarios
• puede iniciar el programa desde>

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 56


The gateway also has an Access Control List that can be
SAP Gateway Security Configuration La gateway también tiene una Lista de control de acceso que se puede usar para used to control the incoming connections at TCP/IP level.
controlar las conexiones entrantes a nivel TCP / IP.
Additional ACLs (1) If SNC is configured, this ACL will be applied to the SNC port
as well.
Si se configura SNC, esta ACL también se aplicará al puerto SNC.
Additional Access Esta es la primera característica de seguridad que se aplicará si está habilitada. This is the first security feature that will be applied if it is
enabled.
Control Lists General Por ejemplo, esta ACL se aplicará incluso antes de considerar las reglas de For example, this ACL will be applied even before the
reginfo. reginfo rules are considered.
gw/acl_file definition
Se utilizará la primera regla que coincida con la conexión entrante. The first rule that matches the incoming connection will be
 Format: <permit|deny><ip-address[/mask]>[trclevel][# comment] used.
Las reglas pueden comenzar con la palabra "permitir" o "negar". Rules can start with the word “permit” or “deny”.
 Controls which IP addresses are allowed to open a TCP/IP Toda la palabra necesita ser escrita. Usar solo "P" o "D" no funcionará. The whole word needs to be written. Using just “P” or “D”
will not work.
connection to this gateway
El siguiente argumento puede ser una única dirección IP, The next argument can be a single IP address, or you can
 The rules are checked sequentially from the “top down”; the first o puede usar una máscara de red para definir un segmento de red o una red use a network mask to define a network segment or an
entire network.
relevant rule determines the result (“first match”) completa. Luego puede definir el nivel de trace de esta regla. You can then define the trace level of this rule.
Este argumento es opcional y la gateway no escribirá nada en su archivo de
 Applied before the reginfo rules This argument is optional and the gateway will not write
Trace, si el nivel de Trace no está establecido. anything to its trace file, if the trace level is not set.
 ip-address: Con el nivel de rastreo establecido en 1, With the trace level set to 1, the gateway will write a line at
IPv4 decimal, '.' separated: e.g. 10.11.12.13 la gateway escribirá una línea en su archivo de rastreo que indica la dirección IP its trace file indicating the IP address of the client, the
IPv6 hexadecimal, ':' separated. '::' is supported del cliente,
action it took and the number of the line with the rule that
was applied.

 mask: if specified, it must be a subnetwork prefix mask la acción que tomó


You can also add a hashtag at the end of the line, followed
y el número de la línea con la regla que se aplicó. by a comment about this rule.
 trclevel: with which ACL hits (matches of addresses based on the subnetwork
mask) are written to the relevant trace file También puede agregar un hashtag al final de la línea, seguido de un comentario A line that starts with hashtag is also considered a
comment.
sobre esta regla.
 Default location/file: empty Una línea que comienza con un hashtag también se considera un comentario. There will be an implicit “deny all” rule at the end, in the
same way as in the reginfo and secinfo files.
Listas de control de acceso adicionales
Definición general de gw / acl_file Habrá una regla implícita de "negar todo" al final, de la misma manera que en los
archivos reginfo y secinfo.
• Formato: <permiso | negar> <dirección IP [/ máscara]> [trclevel] [# comentario]
• Controla qué direcciones IP pueden abrir una conexión TCP / IP a esta gateway
• Las reglas se verifican secuencialmente de "arriba hacia abajo"; la primera la
regla relevante determina el resultado ("primer partido")
• Aplicado antes de las reglas de reginfo
• Direcciones IP:
IPv4 decimal, '.' separados: p. 10.11.12.13
IPv6 hexadecimal, ':' separado. '::' esta Soportado
• máscara: si se especifica, debe ser una máscara de prefijo de subred
• trclevel: con el cual los hits de ACL (coincidencias de direcciones basadas en la
máscara de subred) se escriben en el archivo de rastreo relevante
• Ubicación / archivo predeterminado: vacío
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 57
SAP Gateway Security Configuration The next security feature that we will cover in this unit is
called proxy info.
Additional ACLs (2)
The gateway can be used as an intermediary between two
Additional Access systems or servers. For example, the SAP system “A” will
connect to the SAP system “C” through the gateway of the
Control Lists SAP system “B”.
General You can use the proxy info from system “B” to control such
gw/prxy_info access.

definition: The proxy info rules also start with either P for permit or D
 P (permit) / D (denied) for deny.

 SOURCE = <list of host names and port separated by comma where The SOURCE argument defines the source server and the
TCP/IP connection is allowed from> client that is using this gateway as the intermediary.

 DEST = <list of host names and port separated by comma The DEST argument defines the final target server.
where TCP/IP connection is allowed to>
You can define a list of servers at both arguments,
La siguiente característica de seguridad que cubriremos en esta unidad se llama separating each server with a comma.
Default location/file:
información de proxy.
 $(DIR_DATA)/prxyinfo As usual, there will be the implicit “deny all” rule at the
La gateway se puede utilizar como intermediario entre dos sistemas o servidores. Por end.
Listas de control de acceso adicionales ejemplo, If this file does not exist, then the gateway allows all proxy
Definición general de gw / prxy_info: connections.
el sistema SAP "A" se conectará al sistema SAP "C" a través de la gateway del sistema
• P (permiso) / D (denegado) SAP "B".
• FUENTE = <lista de nombres de host y puerto separados por
comas desde donde se permite la conexión TCP / IP> Puede usar la información del proxy del sistema "B" para controlar dicho acceso.
• DEST = <lista de nombres de host y puertos separados por Las reglas de información de proxy también comienzan con P para permiso o D para
comas denegar.
• donde se permite la conexión TCP / IP a>
Ubicación / archivo predeterminado: El argumento SOURCE define el servidor de origen y el cliente que utiliza esta gateway
$ (DIR_DATA) / prxyinfo como intermediario.

El argumento DEST define el servidor de destino final.


Puede definir una lista de servidores en ambos argumentos, separando cada servidor
con una coma.

Como de costumbre, habrá la regla implícita de "negar todo" al final.


Si este archivo no existe, la gateway permite todas las conexiones proxy.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 58
SAP Gateway Security Configuration La implementación de los archivos de información reginfo, secinfo y proxy en un entorno de producción, puede causar interrupciones si
Simulation estas reglas no están bien definidas o si faltan reglas.
La gateway proporciona un modo de simulación que puede usarse para evitar eso.
Simulation Mode Cuando este modo está activo, la gateway no agrega esa regla final de "negar todo". En cambio, permitirá la acción.
 The parameter that controls the simulation mode Sin embargo, si una regla que existe en el archivo de seguridad relevante coincide con la solicitud, se aplicará la regla.
gw/sim_mode = 0 | 1
Además, los argumentos ACCESS y CANCEL del archivo reginfo se aplicarán como se define en la regla.
 Applies to the registration action only En otras palabras, el modo de simulación se aplica solo a la acción de registrar el programa, para el archivo reginfo.
 If activated (value is 1): after the external program was El parámetro que controla el modo de simulación es
registered, the ACCESS and CANCEL options will be gw / sim_mode.
followed as defined in the rule, if a rule exists
See also:
SAP Note 1689663 - GW: Simulation mode for reg, sec, and
prxy_info

Modo de simulación
gw / sim_mode = 0 | 1

Se aplica solo a la acción de registro


Si está activado (el valor es 1):
después de que se haya registrado el programa externo,
se seguirán las opciones ACCESO y CANCELAR según lo definido en la
regla, si existe una regla

Implementing the reginfo, secinfo and proxy info files at a production environment may
cause disruptions if these rules are not well defined, or if there are missing rules.

The gateway provides a simulation mode that can be used to avoid that.
When this mode is active, the gateway does not add that final “deny all” rule. Instead, it
will allow the action.

However, if a rule that exists in the relevant security file matches the request, the rule will
be applied.

Furthermore, the ACCESS and CANCEL arguments of the reginfo file will be applied as
defined in the rule. In other words, the simulation mode applies only to the action of
registering the program, for the reginfo file.

The parameter that


© 2017 SAP SE controls the simulation
or an SAP affiliate company. All mode is gw/sim_mode.
rights reserved. ǀ PUBLIC 59
SAP Gateway Security Configuration Si los archivos reginfo o secinfo no existen, la gateway utilizará reglas predeterminadas internas.
Parameters
El parámetro gw / acl_mode controla cuáles son esas reglas.
Gateway behavior vs. gateway parameters Si ese parámetro se establece en 0, la gateway utilizará reglas internas que permitirán todo.
Si se establece en 1, que es el valor predeterminado, la gateway permitirá todo desde el servidor local y solo
 gw/acl_mode = 0 | 1
desde el mismo sistema SAP.
The parameter defines the behavior of the gateway if no ACL file
(gw/sec_info, gw/reg_info) exists. Por ejemplo, si un usuario intenta iniciar un programa en un servidor remoto que no pertenece al mismo sistema
If the above ACL files are maintained, the value of this parameter is SAP donde el usuario inició sesión, la gateway negará esta acción.
irrelevant. Pero iniciar el mismo programa en el servidor SAP local estaría permitido.

 gw/sim_mode = 0 | 1 Activates/Deactivates the simulation El diagrama que vemos en la diapositiva muestra el comportamiento de la gateway considerando el valor de estos
mode dos parámetros.
Como podemos ver, ambos parámetros no se consideran si existe el archivo reginfo o secinfo y si hay una regla
Comportamiento de gateway frente a Parámetros de Gateway que coincida con la solicitud.

• gw / acl_mode = 0 | 1
El parámetro define el comportamiento de la gateway si no existe un archivo
ACL (gw / sec_info, gw / reg_info).
Si se mantienen los archivos ACL anteriores, el valor de este parámetro es
irrelevante.

• gw / sim_mode = 0 | 1 Activa / Desactiva el modo de simulación

If the reginfo or secinfo files do not exist, the gateway will use internal default rules.

The parameter gw/acl_mode controls which are those rules.


If that parameter is set to 0, the gateway will use internal rules that will allow everything.

If it is set to 1, which is the default value, the gateway will allow everything from the local
server and from the same SAP system only.
For example, if a user tries to start a program at a remote server that does not belong to the
same SAP system where the user is logged on, the gateway would deny this action.

But starting the same program at the local SAP server would be allowed.

The diagram we see at the slide shows the gateway behavior considering the value of these
two parameters.

As we can see, both parameters are not considered if the reginfo or secinfo file exists and if
there is a rule that matches the request.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 60
SAP Gateway Security Configuration
Logging (1)
Gateway logging
For standalone gateway (ASCS)
 Activate it by
gw/logging=LOGFILE=<name>ACTION=[TERSMPXVCO][MAXSIZEKB=n][SWITCHTF=t][FILEWRAP=on]

For ABAP:
 Start it from SMGW → Goto → Expert Functions
→ Logging
 Define File Name, Log Events, Toggle Criteria, Simulation Mode (switch on/off
simulation mode)
 Activate logging by “magic wand”
See also:
 SAP Note 910919 - Setting up Gateway logging
 Setting Up Gateway Logging (Help portal)

Registro de Gateway
Para gateway independiente (ASCS)
Actívelo mediante gw / logging = LOGFILE = <name> ACTION = [TERSMPXVCO] [MAXSIZEKB = n] [SWITCHTF = t] [FILEWRAP = on]

Para ABAP:
Comience desde SMGW
→ Ir a
→ Funciones expertas
→ Registro
Definir nombre de archivo, eventos de registro, criterios de alternancia, modo de simulación (activar / desactivar el modo de
simulación)
Activar el registro mediante "varita mágica"

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 61


SAP Gateway Security Configuration El siguiente tema es el registro de gateway que hemos mencionado brevemente en la
The next topic is the gateway logging that we
have briefly mentioned in the previous unit.
unidad anterior.
Logging (1) You can configure this feature with the
Puede configurar esta función con el parámetro parameter gw/logging.
gw / logging.
At an ABAP instance, you can activate it
dynamically through the transaction SMGW
En una instancia ABAP, puede activarlo dinámicamente a través de la transacción ->menu Goto,
SMGW -->Expert Functions,
-> menú Ir a, --->Logging.
-> Funciones de expertos, We can see an example of the screen at this
---> Registro. slide.
Podemos ver un ejemplo de la pantalla en esta diapositiva. Here you can define the name of the log file,
which actions are to be logged, the toggle
Aquí puede definir el nombre del archivo de registro, criteria for the log file and even activate the
• qué acciones se deben registrar, simulation mode that we have just discussed.
• los criterios de alternancia para el archivo de registro
• e incluso activar el modo de simulación que acabamos de analizar. Notice that the changes that we do on this
screen will be lost if SAP restarts.

Tenga en cuenta que los cambios que hacemos en esta pantalla se perderán si SAP se What you can do is perform the configuration
reinicia. at this screen, activate it, and then go to the
transaction RZ11 to get the current value of
Lo que puede hacer es realizar la configuración en esta pantalla, activarla y luego ir a the parameter gw/logging.
la transacción RZ11 para obtener el valor actual del parámetro gw / logging.
This way you can easily add the parameter to
the instance profile, with the appropriate
De esta manera, puede agregar fácilmente el parámetro al perfil de instancia, con el value.
valor apropiado.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 62


At this slide, we can see an example of
SAP Gateway Security Configuration how the log looks like. See also:
Logging (2)  SAP Note 910919 - Setting up Gateway logging
The first letter indicates the action that
was logged.  Setting Up Gateway Logging (Help portal)
Gateway logging Log file example: The SAP Note linked at the previous slide
 default name: gw_log-yyyy-mm-dd has a list of the available actions.

 accepted / denied records Then we have the date and time of the
event, followed by the corresponding text
 for reginfo / secinfo explaining the event.

Ejemplo de archivo de registro de registro de gateway:


En esta diapositiva, podemos ver un ejemplo de cómo se ve el registro.
• nombre predeterminado: gw_log-aaaa-mm-dd
• registros aceptados / denegados La primera letra indica la acción que se registró.
• para reginfo / secinfo La nota de SAP vinculada en la diapositiva anterior tiene una lista de las acciones disponibles.

Luego tenemos la fecha y hora del evento, seguido del texto correspondiente que explica el evento.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 63


There is one last parameter that can
SAP Gateway Security Configuration Hay un último parámetro que se puede usar para activar características de seguridad be used to activate additional
adicionales o cambiar el comportamiento de algunas de las características de seguridad que security features or change the
Additional features
hemos discutido. behavior of some of the security
features that we have discussed.
Additional security features El nombre del parámetro es gw / reg_no_conn_info.
The parameter name is
 Deactivated: gw/reg_no_conn_info = 0 Funciona como un valor de máscara de bits, en otras palabras: gw/reg_no_conn_info.
Debe sumar el valor de las funciones que desea activar y luego establecer el parámetro en el It works as a bitmask value, in other
 Activated: gw/reg_no_conn_info = 1 | 64 | 65 | 128 | 129 | 192 | 193 valor resultante. words:
You need to sum the value of the
You can activate the features by summarizing the “Decimal Values” features that you want to activate
associated with “Security feature to be activated”. Example: Por ejemplo, para activar las funciones 1 y 64 que vemos en la diapositiva, tendríamos que
establecer este parámetro en el valor 65. and then set the parameter to the
 Value 1 activates the security feature of SAP Note 1298433 resulting value.

 Value 64 activates the security feature of SAP Note 1697971 La primera nota de SAP que hemos vinculado en esta diapositiva tiene una lista de posibles For example, to activate the
valores de máscara de bits y el número de la nota de SAP correspondiente que proporciona más features 1 and 64 that we see on
 Value 65 (=64+1) will activate both of the above features información sobre la función de seguridad que está activando o cambiando. the slide, we would have to set this
parameter to the value 65.
 and so on...
 Value 193 (=128+64+1) activates all the three features available as of kernel 7.4 The first SAP Note that we have
linked on this slide has a list of
See also: possible bitmask values and the
number of the corresponding SAP
 SAP Note 1444282 - gw/reg_no_conn_info settings Note that provides more
 SAP Note 2269642 - GW: Validity of parameter gw/reg_no_conn_info information about the security
feature it is activating or changing.

Funciones de seguridad adicionales


• Desactivado: gw / reg_no_conn_info = 0
• Activado: gw / reg_no_conn_info = 1 | 64 65 128 129 192 193
• Puede activar las funciones resumiendo los "Valores decimales" asociados con la "Función
de seguridad que se activará". Ejemplo:
• El valor 1 activa la función de seguridad de la nota SAP 1298433
• Value 64 activa la característica de seguridad de SAP Note 1697971
• El valor 65 (= 64 + 1) activará las dos características anteriores
• y así...
• El valor 193 (= 128 + 64 + 1) activa las tres características disponibles a partir del núcleo
7.4
Ver también:
Nota SAP 1444282 - configuración de gw / reg_no_conn_info
Nota SAP 2269642 - GW: Validez del parámetro gw / reg_no_conn_info
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 64
Week 2: Memory Management and Gateway Service
Unit 5: RFC Interface Scenarios
Welcome to Week 2, Unit 5. We will learn about the different RFC scenarios in this unit.

Bienvenido a la Semana 2, Unidad 5. Aprenderemos sobre los diferentes escenarios de RFC en esta unidad.
Let us begin by explaining some
RFC Interface Scenarios Comencemos explicando alguna terminología sobre los RFC. terminology about RFCs.
RFC fundamentals El cliente RFC es el sistema que inicia la conexión RFC.
The RFC client is the system that starts
El sistema que recibe la conexión y procesa la solicitud es el servidor RFC.
the RFC connection.
Tenga en cuenta que un sistema, o incluso una instancia, puede ser tanto el cliente como el servidor al
RFC connection fundamentals mismo tiempo. The system that receives the
 client: where the RFC call is initiated from connection and processes the request
La Gateway "líder“ (The “leading" Gateway) es la Gateway que tiene control sobre el flujo de datos. is the RFC server.
 server: where the RFC call is processed Por defecto, es la Gateway desde el extremo del cliente. Notice that a system, or even an
Esto se puede cambiar configurando las opciones de Gateway ”del destino RFC, en la transacción SM59. instance, can be both, the client and
 “leading” gateway: the local gateway of the client by
Si esas opciones están configuradas, esa será la Gateway "líder". the server at the same time.
default, unless specified otherwise in SM59 at
“Gateway Options” Un bloque CA (A CA block ) The “leading" gateway is the gateway
Es un bloque de comunicación que Contiene los datos asociados a la solicitud. that has control over the data flow.
 CA block: communication block, required for all By default, it is the gateway from the
requests with associated data Streaming client end.
Es una nueva característica que se introdujo en la versión SAP NetWeaver 7.40.
 streaming: CPIC streaming is used for the RFC data Es una optimización del rendimiento, y se utilizará si ambos extremos de la comunicación lo admiten. This can be changed by setting the
transfer; this is a performance optimization Esta característica está controlada por el parámetro de perfil rdisp / cpicStreaming. gateway options”of the RFC
rdisp/cpicStreaming (on), available only for kernel >= destination, at the transaction SM59.
7.4
If those options are set, that will be the
“leading" gateway.
Fundamentos de conexión RFC
A CA block is a communication block. It
• Cliente: desde donde se inicia la llamada RFC holds the data associated to the
• Servidor: donde se procesa la llamada RFC request.
• Gateway “principal”: la gateway local del cliente de manera
predeterminada, a menos que se especifique lo contrario en SM59 Streaming is a new feature that was
en “Opciones de gateway” introduced on the SAP NetWeaver 7.40
• Bloque CA: bloque de comunicación, requerido para todos release.
It is a performance optimization and it
• solicitudes con datos asociados will be used if both ends of the
• Transmisión: la transmisión CPIC se utiliza para la transferencia de communication support it.
datos RFC;
Esta es una optimización de rendimiento rdisp / cpicStreaming This feature is controlled by the profile
(activado), disponible solo para kernel > = 7.4 parameter rdisp/cpicStreaming.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 66


RFC Interface Scenarios The RFC requests can be synchronous or
sRFC, aRFC asynchronous.

RFC síncrono (sRFC) en el nivel ABAP When an RFC client makes a synchronous request, it
Synchronous RFC (sRFC) on ABAPlevel • Espera la respuesta del servidor en el lado del cliente will become blocked and it will wait for the response
from the RFC server.
 wait for the answer of server at client side • Paquete de sincronización cuando el Taskhandler de destino recibió el bloque CA
(= un viaje de ida y vuelta por bloque CA) In this scenario, a synchronization packet is sent by the
 synchronizing package when target taskhandler taskhandler of the target system every time it receives
received the CA block ( = one round trip per CA block) RFC asíncrono (aRFC) en el nivel ABAP a CA block, or data package.
No espere la respuesta del servidor en el lado del cliente
Asynchronous RFC (aRFC) on ABAPlevel When the RFC client makes an asynchronous request,
 don’t wait for the answer of server at client side it will not be blocked and it can execute other tasks
Posibles escenarios
while it waits for the RFC server to send a response.
• gateway "líder" en aRFC en el lado del cliente
Possible scenarios • gateway "líder" en aRFC en el lado del servidor
 "leading" gateway in aRFC on the client side
 "leading" gateway in aRFC on the server side

Las solicitudes de RFC pueden ser síncronas o asíncronas.


Cuando un cliente RFC realiza una solicitud sincrónica,
se bloqueará y esperará la respuesta del servidor RFC.
En este escenario,
el Taskhandler del sistema de destino envía un paquete de
sincronización cada vez que recibe un bloque CA o paquete de
datos.
Cuando el cliente RFC realiza una solicitud asincrónica,
no se bloqueará y puede ejecutar otras tareas mientras espera que
el servidor RFC envíe una respuesta.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 67


Desde el punto de vista del administrador de tareas,
RFC Interface Scenarios cada paquete de datos enviado durante una solicitud RFC sincrónica,
Synchronization se sincronizará entre el Taskhandler en el servidor RFC y la Gateway principal.

Synchronization points in RFC communication Durante una solicitud asincrónica de RFC,


Taskhandler point of view when sRFC: Los puntos de sincronización seguirán ocurriendo durante la transferencia de datos.
En este caso, el Taskhandler en el servidor RFC, inserta un paquete de sincronización en cada 5 paquetes de datos que recibe, si la
 always sync packages between "leading" gateway and server transmisión no es compatible con ambos extremos.
taskhandler for each CA block Este es un valor fijo.
Taskhandler point of view when aRFC: Si el Streaming (transmisión) es compatible con ambos extremos de la comunicación, se inserta un paquete de sincronización en cada
 for kernel < 7.4: sync package inserted after every 5 packages 20 paquetes de datos, de forma predeterminada.
Este valor se puede cambiar a través del parámetro de perfil rdisp / max_async_send.
 for kernel >= 7.4: sync package inserted after
rdisp/max_async_send packages (default value: 20) Desde el punto de vista de la Gateway,
se inserta un paquete de sincronización, si el N° de paquetes de datos que esperan en el búfer alcanza el valor
Gateway point of view: del parámetro gw / req_stack_size.
 “leading” gateway sync when buffer limit is reached for kernel < El valor predeterminado de este parámetro depende de la versión del kernel de SAP en uso por el sistema SAP.
7.4: gw/req_stack_size (default value: 30)
for kernel >= 7.4: gw/req_stack_size (default value: 100)
From the taskhandler point of view,
every data package sent during a synchronous RFC request,
Puntos de sincronización en comunicación RFC will be synched between the taskhandler on the RFC server and the
leading gateway.
Punto de vista del Taskhandler cuando sRFC:
• Sincronice siempre los paquetes entre la gateway "principal" y el Taskhandler del During an asynchronous RFC request,
servidor para cada synchronization points will still occur during the data transfer.
In this case, the taskhandler on the RFC server inserts a
Punto de vista del Taskhandler del bloque CA cuando aRFC: synchronization package at every 5 data packages it receives if
• para kernel < 7.4: paquete de sincronización insertado después de cada 5 streaming is not supported by both ends.
This is a fixed value.
paquetes
If streaming is supported by both ends of the communication, a
• para kernel > = 7.4: paquete de sincronización insertado después de los paquetes synchronization package is inserted at every 20 data packages, by
rdisp / max_async_send (valor predeterminado: 20) default.
This value can be changed through the profile parameter
Punto de vista de la Gateway: rdisp/max_async_send.
• Sincronización de gateway "principal" cuando se alcanza el límite del búfer para el
Kernel < 7.4: gw / req_stack_size (valor predeterminado: 30) From the gateway point of view,
• para kernel > = 7.4: gw / req_stack_size (valor predeterminado: 100) a synchronization package is inserted if the number of data packages
waiting on the buffer reaches the value of the parameter
gw/req_stack_size.
The default value of this parameter depends on the SAP kernel
release in use by the SAP system.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 68
RFC Interface Scenarios Ahora, analicemos algunos temas que influyen en el rendimiento de la
Now, let us discuss some topics that influence the
performance of the data transfer during RFC requests.
Performance transferencia de datos durante las solicitudes de RFC. Creamos algunas Let us create some definitions so we can compare the
definiciones para poder comparar la velocidad durante los diferentes speed during the different scenarios.
Connection speed <v> on network with round-trip time <t> escenarios.
V- is the connection speed, or the speed of the data
Synchronous RFC (sRFC) V- es la velocidad de conexión, o la velocidad de la transferencia de datos. transfer.
 one round trip per CA block: 1block/<t>= 1<v> T- es el tiempo de ida y vuelta, esto significa el tiempo que tardan los T- is the round-trip time, this means the time it takes for
paquetes de datos en llegar al servidor RFC y hasta el momento en que el the data packages to reach the RFC server and until the
time the synch package is received by the RFC client.
Asynchronous RFC (aRFC) cliente RFC recibe el paquete de sincronización. Notice that the client cannot send more data if it is
 “leading” gateway on the client end: 1block/<t>=1<v>(like sRFC) Tenga en cuenta que el cliente no puede enviar más datos si está esperando waiting for a synch package.

 “leading” gateway on the server end: un paquete de sincronización.


For synchronous RFC requests, the connection speed is
Para solicitudes RFC sincrónicas, la velocidad de conexión es de 1v. 1v.
– for kernel < 7.4: every 5 packages, therefore This is because the RFC client can send only one data
5 * <v> = 5<v> (versus 1<v> when leading GW on client end) Esto se debe a que el cliente RFC solo puede enviar un paquete de datos por
package per round-trip.
viaje de ida y vuelta.
– for kernel >= 7.4: rdisp/max_async_send packages, therefore
20 * <v> = 20<v> (versus 1<v> when leading GW on client end) For asynchronous RFC requests, the location of the
Para las solicitudes asíncronas de RFC, leading gateway plays an important role.
Above applies only to mass data transfer in one direction. la ubicación de la Gateway principal juega un papel importante. If it is at the RFC client end, the speed of the data
Si está en el extremo del cliente RFC, la velocidad de transferencia de datos transfer of an asynchronous RFC request is 1v as well,
What it means? With default settings, the streaming is 4times faster, and de una solicitud RFC asíncrona es también 1v, la misma velocidad que para the same speed as for synchronous RFCs.
with proper configuration it can be improved further. los RFC síncronos.
If we move the leading gateway to the RFC server end,
Si movemos la Gateway principal al extremo del servidor RFC, entonces la then the speed is 5v when streaming is not used, and
velocidad es de 5v cuando no se usa la transmisión 20v if streaming is used.
Velocidad de conexión <v> en la red con tiempo de ida y vuelta <t> This means that the streaming feature made the data
y de 20v si se usa la transmisión. transfer of asynchronous RFC request four times faster
RFC síncrono (sRFC) than on previous SAP releases.
• un viaje de ida y vuelta por bloque CA: 1 bloque / <t> = 1 <v> Esto significa que la función de transmisión (Streaming) hizo que la
transferencia de datos de solicitud RFC asíncrona fuera cuatro veces más
RFC asíncrono (aRFC) And this is when we are using the default settings.
rápida que en versiones anteriores de SAP. With the proper configuration, this performance can be
• gateway “líder” en el extremo del cliente: 1block / <t> = 1 <v> (como sRFC) improved even further.
• gateway "líder" en el extremo del servidor: Y esto es cuando estamos usando la configuración predeterminada.
It is important to mention that this applies to data
Con la configuración adecuada, este rendimiento se puede mejorar aún
transfers going in one direction only, meaning that only
 para kernel < 7.4: cada 5 paquetes, por lo tanto 5 * <v> = 5 <v> (frente a 1 <v> más. the RFC client is sending data to the RFC server.
al liderar GW en el extremo del cliente)
 para kernel > = 7.4: paquetes rdisp / max_async_send, por lo tanto 20 * <v> = Es importante mencionar que esto se aplica a las transferencias de datos
20 <v> (frente a 1 <v> al liderar GW en el extremo del cliente) que van en una sola dirección, lo que significa que solo el cliente RFC está
enviando datos al servidor RFC.
Lo anterior se aplica solo a la transferencia de datos en masa en una dirección.
Lo que significa
Con la configuración predeterminada, la transmisión es 4 veces más rápida, y con
la configuración adecuada se puede mejorar aún más.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 69
RFC Interface Scenarios Cuando una instancia ABAP es el servidor RFC, no hay tiempo de espera para las sesiones
When an ABAP instance is the RFC server,
there is no timeout for the RFC sessions.
RFC lifetime RFC. The RFC server sessions will remain
active until they are explicitly closed by
Lifetime of an RFC connection Las sesiones del servidor RFC permanecerán activas, hasta que el cliente RFC las cierre the RFC client, or if the RFC session is an
explícitamente, o si la sesión RFC es una sesión ABAP y aún está activa. ABAP session and it is still active.
 There is no timeout for RFC.
Cuando finaliza una sesión de cliente ABAP RFC, cierra las sesiones RFC asociadas a ella. When an ABAP RFC client session ends, it
 The RFC session remains active as long as: closes the RFC sessions associated with it.
El administrador Basis de SAP, puede finalizar las sesiones de RFC manualmente,
– the (ABAP) client session exists cancelando la ejecución de la tarea del servidor a través de la transacción SM50 si está
The SAP basis administrator can
– the server session is explicitly closed activa en un WP; terminate RFC sessions manually,
al finalizar la sesión correspondiente en la transacción SM04; by cancelling the execution of the server
The RFC session is closed by: o cerrando la conexión correspondiente en la transacción SMGW. task through the transaction SM50 if it is
 terminating the report (the transaction), e.g. cancel via SM50, SM04, Es importante destacar que la aplicación, o el sistema del cliente,
active at a work process;
by ending the corresponding session at
SMGW, ... es responsable de la administración de sus llamadas RFC y los respectivos contextos RFC, the transaction SM04;
 calling the RFC_CONNECTION_CLOSE function module incluida la finalización de las sesiones del servidor RFC cuando ya no son necesarias. or by closing the corresponding
connection at the transaction SMGW.
Every application is responsible for the administrationof its RFC calls
and the respective RFC contexts. It is important to stress that the
application, or the client system is
responsible for the administration of its
Vida útil de una conexión RFC RFC calls and the respective RFC
contexts, including terminating the RFC
• No hay tiempo de espera para RFC. server sessions when they are no longer
• La sesión de RFC permanece activa siempre que: needed.
1. existe la sesión del cliente (ABAP)
2. la sesión del servidor se cierra explícitamente
La sesión de RFC está cerrada por:
• terminando el reporte (o la transacción), o por ejemplo: cancelar a
través de SM50, SM04, SMGW, ...
• llamando al módulo de función RFC_CONNECTION_CLOSE
Cada aplicación es responsable de la administración de sus llamadas RFC y
los respectivos contextos RFC.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 70


RFC Interface Scenarios Una situación común que vemos es un Work Process en estado
• "En espera" con la razón "RFC"
One common situation that we see is a work
processes in status
“On Hold” with reason “RFC”
“On Hold” RFC • o "Detenido" con el motivo "CPIC", or “Stopped” with reason “CPIC”,
depending on the monitoring transaction we are
dependiendo de la transacción de monitoreo que estemos usando. using.
Observations in SAP system:
Otro síntoma de esta situación pueden ser las sesiones vistas en la transacción SM04 con la Another symptom of this situation can be sessions
 sessions in SM50 with status “On Hold” “RFC response” "última solicitud" de hace mucho tiempo. seen at the transaction SM04 with the “last request”
with a long time ago.

 sessions in SM04 with last request a long time ago Las posibles explicaciones para esta situación son: Possible explanations for this situation are:
A) El cliente RFC todavía está esperando la respuesta del servidor RFC. A) The RFC client is still waiting for the response from
What does it point to? the RFC server.
B) Este comportamiento se observa en un Work Process sin diálogo, como un WP en segundo B) This behavior is being observed at a non-dialog
a) the client has been waiting for a server response for a long time plano. work process, like a background work process.
The session on a non-dialog work process cannot be
b) a non-dialog process cannot be rolled out during the RFC La sesión en un Work Process sin diálogo no se puede deshacer. rolled out.
communication and always displays the status “On Hold” Por lo tanto, los WP sin diálogo siempre muestran este estado cuando realizan llamadas RFC. So, non-dialog work processes always show this status
when they are making RFC calls.
“RFC response” Y C) El cliente RFC está haciendo varias llamadas RFC en secuencia, y aunque siempre ve el WP And C) The RFC client is making several RFC calls in
en este estado "En espera", el ID de la conversación cambia constantemente. sequence, and although you always see the process in
c) the communication changes so fast that other conversation IDs this status "On Hold", he conversation ID is constantly
Esta ID de conversación es un identificador único de 8 dígitos creado para cada llamada RFC. changing.
are connected to it This conversation ID is an 8-digit unique identifier
Entonces, ¿estos posibles escenarios representan un problema? No necesariamente. created for every RFC call.
Is this really a problem situation? Los escenarios B y C serían comportamientos normales y esperados. So, do these possible scenarios represent an issue?
 a) the server needs further analysis El escenario A tendría que analizarse más desde la perspectiva del servidor RFC.
Not necessarily.
The scenarios B and C would be normal and expected
 b) and c) does not constitute an error Por ejemplo, si la función que se llamó todavía se está ejecutando, entonces podría estar behaviors.
The scenario A would have to be further analyzed
enfrentando un problema de rendimiento y el estado del cliente RFC es el correcto. from the RFC server perspective.
For example, if the function that was called is still
RFC “En Espera” / ON HOLD Observe que el escenario A también puede encajar en el escenario B, ya que un Work Process running, then it might be facing a performance issue
and the status of the RFC client is the correct one.
sin diálogo también puede ser el cliente RFC. En las siguientes diapositivas, discutiremos las
Observaciones en el sistema SAP:
transacciones de monitoreo que pueden usarse para analizar el escenario A. Notice that the scenario A can also fit in the scenario
• sesiones en SM50 con estado "En espera" "Respuesta RFC" B, as a non-dialog work process can also be the RFC
• sesiones en SM04 con la última solicitud hace mucho tiempo client.
At the next slides, we will discuss monitoring
transactions that can be used to analyze the scenario
¿A qué apunta? A.

• el cliente ha estado esperando una respuesta del servidor durante


mucho tiempo
• un proceso sin diálogo no se puede implementar durante la
comunicación RFC y siempre muestra el estado "En espera" "Respuesta
RFC"
• la comunicación cambia tan rápido que otras ID de conversación están
conectadas a ella
¿Es realmente una situación problemática?
a) el servidor necesita más análisis
b) Y c) no constituye un error
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 71
RFC Interface Scenarios
Information (1)
How to find relevant information?
 SM51
– Highlight instance
– Menu path Goto →
Information → Communication
→ RFC connection
– Sort by “ConvID”
(appears only at RFC client side) See relations
¿Cómo encontrar información relevante?
SM51
• Instancia destacada
• Ruta del menú
Ir a
→ Información
→ Comunicación
→ Conexión RFC
Ordenar por "ConvID"
(aparece solo en el lado del cliente RFC) Ver relaciones

At the transaction SM51, you En la transacción SM51, puede seleccionar la instancia que
can select the instance that has tiene el WP en espera y acceder a la ruta del menú
the process on hold and access
Ir,
the menu path
Goto, → Información,
Information, → Comunicación,
Communication, → Conexión RFC.
RFC connection. Luego puede ubicar la sesión deseada.
You can then locate the desired
session.
Por lo general,
We would usually use the usamos la ID de conversación o la ID de sesión que puede
conversation ID or the session obtener de los detalles del proceso, haciendo doble clic en el
ID that you can get from the Work Process en la transacción SM50.
process details, by double-
clicking at the work process at
the transaction SM50.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 72
RFC Interface Scenarios
Information (2)
How to find relevant information?
 SM04
– Select the user session
– Menu User → Technical information
– modeinfo[n].cpic_no
is the number of RFCs spawned by this context

¿Cómo encontrar información relevante?


SM04
Seleccione la sesión del usuario
Menú Usuario
→ Información técnica
 modeinfo [n] .cpic_no
es la cantidad de RFC generadas por este contexto

At the transaction
SM04, select the
En la transacción SM04, seleccione la sesión deseada,
desired session, y acceda al menú Usuario,
and access the menu Información técnica.
User,
Technical Information. Para cada sesión interna de esta sesión de usuario,
que se denomina modo,
For each internal
session of this user
puede buscar la propiedad llamada cpic_no.
session, that is called a
mode, you can look for Esta propiedad muestra el número de llamadas RFC
the property called creadas por este modo.
cpic_no.

This property shows


the number of RFC calls
created by this mode.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 73


RFC Interface Scenarios
Information (3)
How to find relevant information?
 SM04
– Select the user session
– Menu User → Technical information
– modeinfo[n].appl_info(stack) (m) Incl. the name of
function module currently executed
Only for kernel >= 7.4

¿Cómo encontrar información relevante?


SM04
Seleccione la sesión del usuario
Menú Usuario
→ Información técnica
modeinfo [n] .appl_info (stack) (m) Incl.
el nombre del módulo de funciones actualmente ejecutado
Solo para kernel> = 7.4

You can also verify También puede verificar la propiedad de modo llamada appl_info (stack).
the mode property
called Mostrará el servidor RFC en la propiedad "S" - esto es "S" para el servidor;
appl_info(stack).
It will show the RFC
y el módulo de función que fue llamado en la propiedad "F" - esto es "F" para la
server at the “S” función.
property – this is “S”
for server;
and the function
module that was
called at the “F”
property – this is “F”
for function.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 74


RFC Interface Scenarios
Information (4)

How to find relevant information?


 SMGW
– Sort by “Users”

¿Cómo encontrar información relevante?


SMGW
- Ordenar por "Usuarios"

The initial screen of the


transaction SMGW also La pantalla inicial de la transacción SMGW también muestra
shows useful información útil, como el ID de la conversación.
information, like the
conversation ID. Es importante tener en cuenta que la Gateway solo enumera en
It is important to note esta pantalla las conexiones para las cuales es la Gateway
that the gateway only principal.
lists on this screen the
connections for which it
is the leading gateway.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 75


RFC Interface Scenarios
Information (5)
How to find relevant information?
 SM5A, the all-in-one solution
– Enter the conversation ID
– Execute the transaction to get RFC Chain Analysis
 See also:
– SAP KBA 2180934 - Analysis of Workprocessin "On Hold" RFC, or Stopped CPIC status
– SAP Note 981914 - Using report RSMON000_ANALYSE_
CONVID(_ALV), transaction SM5A

¿Cómo encontrar información relevante?


SM5A, la solución todo en uno
• Ingrese la ID de conversación
• Ejecute la transacción para obtener el análisis de cadena RFC

One scenario that is also common is an RFC chain. Un escenario que también es común es una cadena RFC.
This is when we have RFC sessions that open other RFC
sessions.
Esto es cuando tenemos sesiones de RFC que abren otras sesiones de RFC.
For example, an RFC server also acts as an RFC client Por ejemplo, un servidor RFC también actúa como un cliente RFC al hacer una llamada RFC.
by making an RFC call.
El segundo servidor RFC también puede actuar como un cliente y hacer otra llamada RFC para la cual
The second RFC server can also act as a client and tendremos el tercer servidor RFC en esta cadena, y esto podría continuar.
make another RFC call for which we will have the third La transacción SM5A se puede usar para analizar fácilmente tales cadenas de RFC y obtener la lista de
RFC server on this chain, and this could continue going
sesiones de usuario para todos los contextos de cliente y servidor de RFC, así como los ID de
on.
conversación asociados a cada sesión.
The transaction SM5A can be used to easily analyze De hecho, incluso si no estamos lidiando con un escenario de cadena RFC, la transacción SM5A puede
such RFC chains and get the list of user sessions for all
the RFC client and server contexts, as well as the
ser muy útil.
conversation IDs associated to each session.
SAP KBA y SAP Note que hemos vinculado en esta diapositiva tienen más información sobre el análisis
In fact, even if we are not dealing with an RFC chain de la situación de RFC "En espera".
scenario, the transaction SM5A can be very helpful.

The SAP KBA and SAP Note that we have linked on this
slide have further information about the analysis of
© 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 76
the “On Hold" RFC situation.
Thank you.
Contact information:

open@sap.com

Vous aimerez peut-être aussi