Status Monitoring for SAP Netweaver - Java Systems

Summary

While running BI Web templates or running any Java based applications, the resources in Java needs to be monitored to find any issues or bottlenecks.
The cycle starts when a user initiates a request by accessing a web template or a java application. The request passes through different resources in the Java stack before it reaches the Database.
The scenario for monitoring may be different for each landscape. If you are experiencing performance issues or downtime for Java systems in a production environment, or if you are performing a load or stress test for Java reports on a Test system, it's required to monitor each resource in the Java process cycle. If you find any of the resource being highly utilized, you would be able to tweak the parameters to make the system stable.
You can use Wily Introscope with Solution Manager for extensive Java monitoring and alerting. This document will help you monitor Java systems with the Monitoring service in Visual Administrator

How to access the Monitoring Service in Visual Administrator?

In folder usr\sap\SID\DVEBMGS00\j2ee\admin execute go.bat
Configure your connections and enter the password to access the visual administrator
After entering the Visual administrator, navigate to services (in Dispatcher or Server Node). Expand Services and select the Monitoring Service. The monitoring services will be displayed in the right side.

Do we need to use all of these monitors to know the status of the system?

Understanding on how the cycle works is a must to know. If you know how a request moves through each component in the cycle, you will also know what all areas need to be monitored. Following areas explains the details on how the request gets processed.

How does a Request get processed?


 

Request processing in the Dispatcher

1) A client request is sent via HTTP to the Java system
2) Server Socket Listeners accept it at the HTTP port in the dispatcher
Info- If so many requests occur at the same time that they cannot be transferred immediately, they wait in a socket queue
3) The request is transferred to the Connections Manipulator and is provided with a connection there.4) Every request provided with a connection is assigned a system thread in System Thread Manager
            Info- If all threads are already active, the request in the WaitingTasksQueue waits for a free system thread5) The SessionQueue in which the system thread has stored the request belongs to Cluster Management.
Info - This is where communication is controlled between dispatcher and server
6) The dispatcher cluster management transfers the session with the corresponding data to the cluster management of server

Request Processing in the Server

7) The incoming request is transferred with the data to be sent to the System Thread Manager and is assigned a system thread
8) The HTTP Service Provider in the server counts the incoming requests since the server start and returns response codes
9) The request is now transferred to an Application Thread. Like the system thread, the Application Thread Manager possesses a pool of threads
Info- If all threads are already active, the request in the WaitingTasksQueue waits for a free application thread
10) Depending on the application, the thread is then transferred to the EJB container, Web Container etc
11) The actual program initiation starts while the database access starts according the JDBC Connector service
Note: While going through this whole process from the connection manipulator to where the request reaches the database, memory is used very heavily. You should monitor the Memory Monitors in each Server Node to see the usage
As not all monitors needed to be treated with the same urgency, the following list gives the classification of the list of monitors
Important Alert Monitors
Connections Manipulator Monitor (in Dispatcher)
HTTP Provider Service Monitor (in Dispatcher)
System Threads Pool Monitor (in Dispatcher)
Application Threads Pool Monitor (in Server)
Cluster Management Monitor (in Server)
Memory Monitor (in Services)

What can you monitor in the Connections Manipulator for Dispatcher?


In Visual Administrator, Expand Dispatcher > Services > Monitors In Root > Kernel > Connections Manipulator
CurrentPoolSize
No. of connections maintained in the pool
HTTP Connections count
Current number of HTTP connections
P4ConnectionsCount
Current number of P4 connections
 
These are informative monitors. You can monitor the connections with this service

What can you monitor in System Thread Manager for Dispatcher?


In Visual Administrator, Expand Dispatcher > Services > Monitors
In Root > Kernel > System Thread Manager  
ActiveThreadsCount
Number of threads currently used
MaximumThreadPoolSize
Maximum size of the system thread pool
ThreadPoolPercentage
Percentage Load of the thread Pool
WaitingTasksCount
The number of tasks for which there is no thread available


This is an important monitor. More importantly you will need to monitor the system threads in the server node.
Info- You can increase or decrease the number of System Threads via ConfigTool. Make sure you follow all the recommendations while changing the values.

What can you monitor in the Cluster Management monitor for Dispatcher?


In Visual Administrator, Expand Dispatcher > Services > Monitors In Root > Kernel > Cluster Management > SessionContextCommunication > http

CurrentSessionQueueSize
Current number of sessions in this processor in the session queue
TotalSessionBytesRecieved
The number of Bytes received in the session
TotalSessionBytesSent
The number of Bytes sent during the session
These are informative monitors. The Bytes sent from the dispatcher and the bytes received from the server node will be displayed. The Byes received will be greater than the Bytes sent.

 What can you monitor in System Thread Manager for the Server?


In Visual Administrator, Expand Server Node > Services > Monitors
In Root > Kernel > System Thread Manager
ActiveThreadsCount
Number of threads currently used
MaximumThreadPoolSize
Maximum size of the system thread pool
ThreadPoolPercentage
Percentage Load of the thread Pool
WaitingTasksCount
The number of tasks for which there is no thread available
This is a very important monitor. You can view the Minimum and Maximum Thread pool size. You can monitor the Active Threads in the system with reference to the Maximum available threads. If the system has to wait for Threads, the Waiting Tasks Count will increase and alert. The signal lights would change from Green to Yellow and then to Red.
Info- You can increase or decrease the number of System Threads via ConfigTool. Make sure you follow all the recommendations while changing the values.

 What can you monitor in the HTTP Service Provider?


In Visual Administrator, Expand Server Node > Services > Monitors
In Root > Services > Http Provider
ReturnedResponseCounts
2xx, 3xx, 4xx, 5xx response codes or errors
AllRequestsCount
The number of requests since the server start
This is also and informative monitor. Before the end users or the testers could come to you with an error message, you can monitor and see how many web requests have errors. This would help you to proactively find any issues in the test scripts or in the application

What can you monitor in Application Thread Manager?


In Visual Administrator, Expand Dispatcher > Services > Monitors In Root > Kernel > Application Thread Manager
ActiveThreadsCount
Number of threads currently used
MaximumThreadPoolSize
Maximum size of the application thread pool
ThreadPoolPercentage
Percentage Load of the thread Pool
WaitingTasksCount
The number of tasks for which there is no thread available
This is another important monitor set. You can monitor the Minimum and Maximum Thread pool size. If the numbers of required threads required are not available with reference to the Maximum threads, the request goes to Waiting. This will be visible in the WaitingTasksCount monitor. The signal lights change from green to yellow and to red according to the severity of the issue. If the Applcation threads are completely used up, this could create critical issues in the system.
Info - You can change the number of Application Threads in Configtool. Please follow the SAP recommendations before any changes are made.

What can you monitor in the Memory Monitor?


In Visual Administrator, Expand Dispatcher > Services > Monitors In Root >Services >Memory
Allocated Memory
Part of the Memory which is ready for use
Available Memory
The total available memory
Used Memory
Used Memory
This is a very important monitor. You can view the Minimum (Xms) and Maximum (Xmx) Heap memory in this monitor. The memory used can be monitored in percentile in the Used Memory monitor. The allocated memory monitor will be the Xmx. The Available memory is the free heap memory within Java.
When the memory is used up to 80%, the alert monitor changes to Yellow and if the memory available reaches the critical mark, the signal light will change to red. A Full GC is usually triggered by the system when the memory usage reaches high. This would allocate more heap memory in the system. If the GC cannot help, your Java instance could even shut down.
Info - You can increase or decrease your memory settings in Config Tool. Heap memory, Xmx, Xms etc are the settings to alter the memory values. Be very careful to follow SAP recommendations before you change the values.

History 

The History Tab in each monitor set will show you information on the Maximum usage. You can also set the configurations in the configuration button.
* *

Recommendations:

  • If you are having issues with a custom Java application, make sure the application is completely tuned before you try changing the Java parameters
  • If you have issues with a BI Web Template, analyse the report carefully and tune it before you change the Java parameters
  • If you are executing Java tests via Loadrunner or any other Testing tool, make sure your script is working in order. Some of the Java errors which you see would relate to the script issues
  • If you are having issues with Application Threads, System Threads or Memory, try to increase the server nodes rather than increasing the Heap memory or Applcaition threads     

No comments: