Layer7 API Management

 View Only
  • 1.  Number of Threads in a Gateway

    Posted Jul 18, 2018 06:38 AM

    Hello,

     

    Is there a way to measure the threads in a Gateway as in the concurrency?

     

    Regards

    Malvina



  • 2.  Re: Number of Threads in a Gateway

    Posted Jul 18, 2018 09:44 AM

    Hi, I have these two 'commands' that I use: the first one is for an overall check of the opened connections at the time of the run of the command:

    [root@ssg9 ~]# ps h -Led -o user| sort | uniq -c | sort -r -n
    637 gateway
    122 root
    46 fndsrv
    26 mysql
    21 layer7
    6 nslcd
    3 ssgconfig
    2 postfix
    1 ncsnmpd

    ##### ===
    This other one, is a little script that I have created that I can run and as you can see it gathers thread dumps every 20 seconds (you can change the interval) and then use any thread analyser software (I use the IBM one) to compare the threads so that it gives you a look at the thread utilisation, giving you a good view of the threads that are busy and what are free. (run the script as the gateway user!)
    su gateway -c /opt/rotateDump.sh

    Use as Gateway user!!
    [root@cbpyla7as03:~]# vi /opt/rotateDump.sh
    #!/bin/bash
    while true ; do file="/tmp/thread-$(date +%Y%m%d-%H.%M.%S).dump"; ps awwx | grep Gateway.jar | grep -v grep | awk '{print $1}' | xargs -I{} /opt/SecureSpan/JDK/bin/jstack {} > $file ; gzip -9 $file ; sleep 20 ; done

     



  • 3.  Re: Number of Threads in a Gateway

    Broadcom Employee
    Posted Dec 13, 2018 06:57 PM

    Good evening,

     

    You can look to also use the context variable ${request.listener.concurrency} in either a scheduled job or global policy that tracks and writes this data out to a log or data source. 

     

    https://docops.ca.com/ca-api-gateway/9-4/en/reference/context-variables/message-layer-context-variables - ${request.listener.concurrency} - "For inbound HTTP and HTTPS requests, this returns the number of request threads active within the thread pool that is handling the current request, at the time the current request was dispatched to a handler thread."

     

    Sincerely,

     

    Stephen Hughes

    Broadcom Support