Product Documentation

Virtual Server Based Expressions

Aug 31, 2016
The SYS.VSERVER("<vserver-name>") expression prefix enables you to identify a virtual server. You can use the following functions with this prefix to retrieve information related to the specified virtual server:
  • THROUGHPUT. Returns the throughput of the virtual server in Mbps (Megabits per second). The value returned is an unsigned long number.

    Usage: SYS.VSERVER("vserver").THROUGHPUT

  • CONNECTIONS. Returns the number of connections being managed by the virtual server. The value returned is an unsigned long number.

    Usage: SYS.VSERVER("vserver").CONNECTIONS

  • STATE. Returns the state of the virtual server. The value returned is UP, DOWN, or OUT_OF_SERVICE. One of these values can therefore be passed as an argument to the EQ() operator to perform a comparison that results in a Boolean TRUE or FALSE.

    Usage: SYS.VSERVER("vserver").STATE

  • HEALTH. Returns the percentage of services in an UP state for the specified virtual server. The value returned is an integer.

    Usage: SYS.VSERVER("vserver").HEALTH

  • RESPTIME. Returns the response time as an integer representing the number of microseconds. Response time is the average TTFB (Time To First Byte) from all the services bound to the virtual server.

    Usage: SYS.VSERVER("vserver").RESPTIME

  • SURGECOUNT. Returns the number of requests in the surge queue of the virtual server. The value returned is an integer.

    Usage: SYS.VSERVER("vserver").SURGECOUNT

Example 1

The following rewrite policy aborts rewrite processing if the number of connections at the load balancing virtual server LBvserver exceeds 10000:

add rewrite policy norewrite_pol sys.vserver("LBvserver").connections.gt(10000) norewrite

Example 2

The following rewrite action inserts a custom header, TP, whose value is the throughout at the virtual server LBvserver:

add rewrite action tp_header insert_http_header TP SYS.VSERVER("LBvserver").THROUGHPUT

Example 3

The following audit log message action writes the average TTFB of the services bound to a virtual server, to the newnslog log file:

add audit messageaction log_vserver_resptime_act INFORMATIONAL "\"NS Response Time to Servers:\" + sys.vserver(\"ssllb\").resptime + \" millisec\"" -logtoNewnslog YES -bypassSafetyCheck YES