Forum Discussion

Wendell_Huang's avatar
Wendell_Huang
Icon for Nimbostratus rankNimbostratus
Feb 27, 2017

The difference between "NEW connections" and "Active connections"?

Hello,everyone: AS a new I want to konw the difference between "NEW connections" and "Active connections"? and at the same time,which command can show these iterms or how to calculate them?

 

6 Replies

  • Active Connections are that already exists and currently active

     

    New connections are newly established connections that were not there before.

     

    Try this command, you can see many options there

     

    (tmos) show sys connection ?

     

    • Wendell_Huang's avatar
      Wendell_Huang
      Icon for Nimbostratus rankNimbostratus

      This command is just show the active connections ,but how to check the new connections?

       

    • Michele_Jetz's avatar
      Michele_Jetz
      Icon for Nimbostratus rankNimbostratus

      how do you want to get "new" connections via any show command. at the moment where you enter the command, the system is just available to check the number of current active connections. so any connection that is established till you enter the command is converted from new to active :)

       

      if you have any requirement to report how many connections are build in a time to any vs you could create an iRule which will log a statement to /var/log/ltm each time, a client connects to the vs

       

      then just grep and count the number of results in the respective time out of the logfile.

       

      Then you will see in the last hour for example were 50 connections created

       

      Best Regards

       

  • The difference can be found out by comparing the (client IP address, client TCP port, server IP address, server TCP port) parameters, existing connections will retain this. New connections changes the port.

     

    Command

     

    tmsh show /sys connection

     

  • OK, i think there is an easy way to find out. Try just

    show sys performance
    and narrow down with more options

    • Wendell_Huang's avatar
      Wendell_Huang
      Icon for Nimbostratus rankNimbostratus

      Thanks,I get it. In the older version through 9.0.0 to 10.2.4, I edit a shell script for calculating these new connections or active connections. This is the shell:

      !/bin/bash
      function ACT_Conn()
      {
      
          h="localhost"
          cmd="snmpwalk -cpublic -v2c"
          sysStatClientCurConns=".1.3.6.1.4.1.3375.2.1.1.2.1.8"
          act_swap=$($cmd $h $sysStatClientCurConns)
          act_conn=${act_swapF5-BIGIP-SYSTEM-MIB::sysStatClientCurConns.0 = Counter64: }
          echo "Active connestions are:$act_conn"
      
      }
      function NEW_conn()
      {
          h="localhost"
          cmd="snmpwalk -cpublic -v2c"
          sysTcpStatAccepts=".1.3.6.1.4.1.3375.2.1.1.2.12.6"
          sysStatServerTotConns=".1.3.6.1.4.1.3375.2.1.1.2.1.14"
      
          cli_acc_swap1=$($cmd $h $sysTcpStatAccepts)
          cli_accept1=${cli_acc_swap1F5-BIGIP-SYSTEM-MIB::sysTcpStatAccepts.0 = Counter64: }
          ser_conn_swap1=$($cmd $h $sysStatServerTotConns)
          ser_conn1=${ser_conn_swap1F5-BIGIP-SYSTEM-MIB::sysStatServerTotConns.0 = Counter64: }
          sleep 10s
          cli_acc_swap2=$($cmd $h $sysTcpStatAccepts)
          cli_accept2=${cli_acc_swap2F5-BIGIP-SYSTEM-MIB::sysTcpStatAccepts.0 = Counter64: }
          ser_conn_swap2=$($cmd $h $sysStatServerTotConns)
          ser_conn2=${ser_conn_swap2F5-BIGIP-SYSTEM-MIB::sysStatServerTotConns.0 = Counter64: }
      
          delta_c_a=$(($cli_accept2-$cli_accept1))
          delta_s_conn=$(($ser_conn2-$ser_conn1))
          echo "$delta_c_a $delta_s_conn" |awk '{printf "ClientSideCon:%.1f\tSerSideCon:%.1f\n",$1/10,$2/10}'
      }
      
      ACT_Conn
      NEW_conn