Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024.
Monitoring Mendix Runtime
1 Introduction
The Mendix Runtime monitoring actions can be called by sending a JSON request to the admin handler. This is accomplished by sending a request to the admin port which is specified in the application configuration (defaults to 8090).
You can change the admin port from the Desktop Modeler by navigating to Project > Settings > Configurations > your configuration > Server > Admin port.
The request needs to be of the POST type with No Authorization and the following headers:
- Content-Type: application/json
- X-M2EE-Authentication: yourM2EEPassword_Base64Encoded
The M2EE password is NOT the super administrator password, but a separate password. If you have the application deployed on premises, you can set this password in the settings.yaml file, which is located in the Apps/YourProject folder. If you are running the application from the Desktop Modeler, the M2EE password is set automatically by Mendix, and you can retrieve it from the environment variables of your application process.
Read the next sections to find out which monitoring actions are supported.
2 Current Executions
Request
|
|
Response
|
|
This request returns the current executions of actions known by the Mendix Runtime. Actions can amongst others be microflows, Java actions, web service calls and scheduled events. For each execution the following is reported:
- The “duration” of the execution in milliseconds.
- The “type” of execution. Possible types are “CLIENT”, “CLIENT_ASYNC”, “CLIENT_ASYNC_MONITORED”, “CUSTOM”, “WEB_SERVICE”, “SCHEDULED_EVENT” and “UNKNOWN”. “CLIENT_ASYNC” is the asynchronous microflow call triggered from the web client, “CLIENT_ASYNC_MONITORED” is the actual execution of the asynchronous microflow in the Mendix Runtime, which happens in a different thread.
- The “user” is the name of the user associated with the session executing the action. In case of a non-user session the name “System” is displayed.
- The “action_stack” shows the stack of actions for this execution. For each action in this stack detailed information is displayed, for example, for a microflow the current activity and the name of the microflow are shown.
3 Runtime Statistics
Request
|
|
Response
|
|
Requests Displays information about the request per handler. The value field shows the number of requests per handler. Since Mendix 5.3, the last_request_timestamp field shows the timestamp in milliseconds of the last handled request. If there are no requests handled, this field shows the moment the handler is registered. The empty handler represents the resource request handler, which handles images, forms etc. (only in use when no reverse proxy is used for static content handling). “file” handles file uploads and downloads, “xas/” processes CRUD actions and microflow execution calls issued by the web client and “ws/” and “ws-doc/” handle web service requests and provide web service documentation.
Cache
Shows the total number of objects which are currently part of the runtime state (all session together). The runtime state either resides in memory (non-clustered runtime) or in Redis or the database (clustered runtime). Too many objects in the state could slow down the performance of the Mendix Runtime.
Sessions The “user_sessions” sections shows the current user sessions with their user agents. The other sections show the number of sessions per category. Categories are “named users” (the number of user instances), “named_user_sessions” (the number of non-anonymous concurrent sessions) and “anonymous_sessions” (the number of anonymous concurrent sessions).
Connectionbus Number of database requests. Distinguishes between “select”, “update”, “insert”, “delete” commands and started database transactions.
Memory
Represents the number of bytes allocated to the specified memory sections. For a general explanation, see the Oracle documentation on tuning garbage collection. For the heap and non-heap fields see the memory usage page. The “memorypools” section contains an ordered list of all the memory pools exactly as we receive them from the JVM, in the same order and with some fields of the MemoryPoolMxBean:
- “usage”: returns an estimate of the memory usage of this memory pool (in bytes).
- “is_heap”: is this memory pool part of the heap or not?
- “name”: the description of the memory pool as received by the JVM. These names can be different depending on for example JDK,memory manager or garbage collection options.
- “index”: the index in the JSON Array. This field is not strictly needed as the pools are returned in a list so you can, and should, rely on the order of the list in case you are processing them in a program.
If you are automatically processing the “memorypools” section to for example display in a graph, you should ideally not make any assumptions about the kind of memory pool based on its order in the list or its name as these may change depending on for example garbage collector settings or Java version.
In case you do want to develop a strategy on interpreting these pools anyway based on Java version: you can get the Java version from the ‘about’ admin action.
4 State Statistics
Request
|
|
Response
|
|
This monitoring action gives more detailed information about objects which are currently in the state of the Mendix Runtime. In “totals” the total number of objects per sessions are shown, in “user_totals” the number of objects per entity for a particular sessions are shown. This information can be an aid in figuring out which objects cause a lot of memory usage.
5 Server Statistics
Request
|
|
Response
|
|
The server statistics monitor action gives information about the embedded Jetty web server. The “jetty” section lists the number of current open connections and the maximum number of open connections. In addition, the maximum idle time of connection before it’s being closed is listed, for when Jetty is under normal circumstances. Please note that in Mendix 7.9 and above, information about the maximum idle time of connections before it’s being closed for when Jetty is low on resources (“max_idle_time_s_low_resources”) is removed as part of the Jetty upgrade, because it is no longer provided by Jetty.
The “threadpool” section gives information about the threadpool of the handler which processes all requests which go through the runtime port. See the Jetty QueuedThreadPool documentation for more information.
6 Logged-In Users
Request
|
|
Response
|
|
Shows which users are currently logged in. If a user has multiple sessions, this user will be list once for every session.
7 Thread Stack Traces
Request
|
|
Response
|
|
Returns all the current thread stack traces by name. This is useful to low level analyze what is happening in the application. Use the “get_current_runtime_executions” request to retrieve information on a higher level (microflows and other actions). {#check-health}
8 Runtime Status
Request
|
|
Response
|
|
Returns the current Mendix Runtime status. Possible status values are: “created”, “starting”, “broken”, “running”, “stopping” and “stopped”. This information can be used to track in what state the Mendix Runtime is when the command to start or stop was given or to check whether the runtime is still running.
9 Check Health
Request
|
|
Response
|
|
In the Mendix Desktop Modeler, a health check microflow can be configured. This microflow can report on the functional status of the application: does the general functionality of the application work, and are the necessary remote services available?
If a health check microflow has been configured, this request will report on the current health status. The “health” value can be either “healthy,” “sick,” or “unknown” (when no health microflow was configured). For the value “sick,” the “diagnosis” value will give the reason the application is not healthy. This reason is the return value of the health check microflow.
The health check microflow gets invoked multiple times per minute. Therefore, it is recommended to make it light-weight and run quickly. Heavy operations may have a significant impact on your application’s performance.
10 About Runtime
Request
|
|
Response
|
|
Returns feedback about the Mendix Runtime.