Forum Discussion

fraguet_53463's avatar
fraguet_53463
Icon for Nimbostratus rankNimbostratus
Jul 06, 2012

Using one statistic profile in severals vs

Hello

 

 

First..... be indulgent with my english... I'm french

 

 

 

I wonder if we can assign a same statistic profile in several virtuals servers.

 

 

I explain my case :

 

 

I have an internet application divided in two séparates ways. One for smartphones user-agent and one for non-smartphones user-agent.

 

Smartphones users are asking if they want to go to the smartphone environnement or in the classic environnement when they access by the classic way.

 

 

This will be a new offer, so the communication department wants to have statistics of numbers of smartphones users accessing via classic way, how many accepts redirection to smartphones application and how many prefers using the classic one.

 

 

So...

 

 

On the virtual server acceding the classic application I have configured a statistic profile which contains 3 fields. I have writen an Irule which modify two of the three fields and makes a html page presenting the stats (based on the exemple give in the dev central).

 

 

It works well.

 

 

The third field of the profile has to be modify with another Irule applies in the virtual server acceding the smartphone application.

 

 

But when I apply the second Irule and the same statistic profile in the second virual server, the visualisation of the html page gives erratics, changing and wrong information.

 

 

Each refresh of the getstat page give different values even if no traffic is made on the two vs.

 

 

 

So I wondering if we can use the same statistic profile in two differents VS.

 

 

 

My statistic profile name : conn_mobiles

 

the fields are :

 

- conn_mobile

 

- access_mobile

 

- access_classic

 

 

 

here is my first Irule applies in the classic application VS:

 

 

"

 

when HTTP_REQUEST {

 

 

switch [HTTP::uri] {

 

 

"/" {

 

if { [matchclass [HTTP::header User-Agent] contains $::user_mobile] } {

 

STATS::incr conn_mobiles conn_mobile 1

 

HTTP::uri "/PortailClassic/AskIfAccessMobileApplication.jsp"

 

}

 

}

 

 

"/PortailClassic/" {

 

if { [matchclass [HTTP::header User-Agent] contains $::user_mobile] } {

 

STATS::incr conn_mobiles conn_mobile 1

 

HTTP::uri "/PortailClassic/AskIfAccessMobileApplication.jsp"

 

}

 

}

 

 

 

"/PortailClassic/LoginClassic" {

 

STATS::incr conn_mobiles access_classic 1

 

HTTP::uri "/PortailClassique/login"

 

}

 

 

"/getstats" {

 

HTTP::respond 200 content "

 

Statistiques connexions mobiles

 

 

 

 

 

 

 

 

Nombre acces mobiles via site classique [STATS::get conn_mobiles conn_mobile]

 

Nombre acces mobiles via site classique [STATS::get conn_mobiles access_mobile]

 

Nombre connexions mobiles sur site classique [STATS::get conn_mobiles access_classic]

 

"

 

}

 

"/resetstats" {

 

 

STATS::set conn_mobiles conn_mobile 0

 

STATS::set conn_mobiles access_mobile 0

 

STATS::set conn_mobiles access_classic 0

 

 

HTTP::respond 200 content "

 

HTTP Status Code Control

 

 

Statistiques remises a zero

 

"

 

}

 

 

default {

 

HTTP::uri [HTTP::uri]

 

}

 

}

 

}

 

"

 

 

 

The second Irule applies in the second VS :

 

 

"when HTTP_REQUEST {

 

if {[HTTP::uri] eq "/PortalMobile/"} {

 

STATS::incr conn_mobiles access_mobile 1

 

}

 

}

 

"

 

 

 

in this case, without any connexion, when I refresh the /getstats page it gives :

 

conn_mobile : 1

 

access_mobile : 0

 

access_classic : 0

 

 

another refresh makes

 

conn_mobile : 0

 

access_mobile : 0

 

access_classic : 1

 

 

the following refresh

 

conn_mobile : 0

 

access_mobile : 0

 

access_classic : 0

 

 

 

And so on.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5 Replies

  • I wonder if we can assign a same statistic profile in several virtuals servers.yes, we can.

     

     

    anyway, you know stats profile is not (fully) compatible, don't you?

     

     

    CMP Compatibility (Statistics Profiles section)

     

    https://devcentral.f5.com/wiki/iRules.cmpcompatibility.ashx

     

     

    by the way, there is a new feature called istats in v11.

     

     

    Introduction to iStats Part 1: Overview by Colin

     

    https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1088514/Introduction-to-iStats-Part-1-Overview.aspx
  • Hi Nitass.

     

     

    Thanks for this quick answer

     

     

    Well... we're in 10.1.... managing upgrade in 11 at the second part of this year.... but the portal opens soon.

     

     

    The explaination of the CMP compatibility could explain the fact that there's a rotation of result because of the 4 TMM within the use of the 2 VS.

     

     

    But the use of one VS does'nt have the same result... no rotation of result....

     

     

    Strange

     

     

  • But the use of one VS does'nt have the same result... no rotation of result.... i am not sure why it did not happen when applying to one virtual server. anyway, would you mind trying to demote cmp and apply the stats profile to two virtual servers for testing?

     

     

    sol7751: Overview of Clustered Multi-Processing (9.x - 10.x)

     

    http://support.f5.com/kb/en-us/solutions/public/7000/700/sol7751.html
  • I will try.

     

     

    You must be right, because in the link you transmitted in the "CMP restrictions in BIG-IP version 10.x" a point explains :

     

     

    In BIG-IP version 10.x, if a virtual server uses any of the following BIG-IP features, CMP is disabled for that virtual server and handled by TMM0 only:

     

     

    - An iRule which refers to a Data Group List (class) using the $:: global variable prefix

     

     

     

    In my first Irule I use :

     

    if { [matchclass [HTTP::header User-Agent] contains $::user_mobile] }

     

     

    $::user_mobile is a data group list. So CMP is disables for this VS. So that's why it doesn't happen with one VS

     

     

    I disable CMP and tell you