Layer7 API Management

Expand all | Collapse all

Number of Threads in a Gateway

  • 1.  Number of Threads in a Gateway

    Posted 07-18-2018 06:38 AM



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




  • 2.  Re: Number of Threads in a Gateway

    Posted 07-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/

    Use as Gateway user!!
    [root@cbpyla7as03:~]# vi /opt/
    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 12-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. 

  - ${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."




    Stephen Hughes

    Broadcom Support