# Wildfly HTTP Seesions

See articles: 

- https://www.mastertheboss.com/jbossas/jboss-cluster/jboss-monitoring-http-session-replication/
- https://blog.arkey.fr/2020/10/27/maxrampercentage-is-not-what-i-wished-for/
- https://techdocs.broadcom.com/us/en/symantec-security-software/identity-security/identity-manager/14-4/reference/performance-tuning/performance-tuning-for-jboss-or-wildfly.html

# Collect metrics 

Use curl: 

```
curl -s http://localhost:9990/metrics
```

wildfly_undertow_active_sessions{deployment="office-alexander-logistics.war",subdeployment="office-alexander-logistics.war",microprofile_scope="vendor"} 184.0



## Check all active Sessions:

```
curl -s http://localhost:9990/metrics | grep -e "^wildfly_undertow_.*_sessions" 
```








# Neue Memory Options:

```yaml
        - name: JAVA_OPTS
          value: >
            -Xms5g
            -Xmx7g
            -XX:+UseG1GC
            -XX:MaxGCPauseMillis=200
            -XX:G1HeapRegionSize=16m
            -XX:InitiatingHeapOccupancyPercent=45
            -XX:+HeapDumpOnOutOfMemoryError
            -XX:HeapDumpPath=/tmp/heapdump
            -Dnashorn.args=--no-deprecation-warning
```



# Memory Analyse


```
curl -s http://localhost:9990/metrics | grep -e "^wildfly_undertow_.*_sessions" 
```


| Zeit      |  Mem      | Sessions  |
|-----------|:---------:|:---------:|
| Mo 18:22  |  3947     |  31       |
| Mo 18:34  |  3951     |  42       |
| Mo 18:39  |  3955     |  48       |
| Mo 18:39  |  3957     |  59       |
| Mo 18:54  |  3983     |  62       |
| Mo 18:54  |  4024     |  66       |
| Mo 19:14  |  4040     |  66       |



# Debug

Test Heap size:

    $ curl -s http://localhost:9990/metrics | grep base_memory_usedHeap_bytes





# HELP base_memory_usedHeap_bytes Displays the amount of used memory.
# TYPE base_memory_usedHeap_bytes gauge
base_memory_usedHeap_bytes 1.605052856E9
base_memory_usedHeap_bytes 3.031116216E9
base_memory_usedHeap_bytes 1.910524016E9
base_memory_usedHeap_bytes 1.291952224E9