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