Forum Discussion
maheshme973_569
Nimbostratus
Aug 01, 2013Getting total bandwidth currently utilized in an iRule
Hope someone can help.
I have finite internet bandwidth available. There are times when there are too many incoming user requests. I would like to turn away new users (new login requests)...
nitass
Employee
Aug 01, 2013not sure if this is useful.
since 11.1.0, virtual server or pool AVR statistics can be obtained using ISTATS::get command in irule (e.g. ISTATS::get "VIP virtual-server-name counter type). anyway, it is not realtime statistics because statistics needs at least about 10 seconds to be updated (i.e. it is previous update interval statistics). to see all the types, you can run "istats dump" in bash.
e.g.
root@(B3900-R67-S12)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm virtual bar
ltm virtual bar {
destination 100.100.100.101:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
myanalytics { }
tcp { }
}
rules {
myrule
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 3
}
root@(B3900-R67-S12)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm profile analytics myanalytics
ltm profile analytics myanalytics {
app-service none
collect-geo enabled
collect-ip enabled
collect-max-tps-and-throughput enabled
collect-methods enabled
collect-page-load-time enabled
collect-response-codes enabled
collect-url enabled
collect-user-agent enabled
collect-user-sessions disabled
defaults-from analytics
description none
notification-email-addresses none
partition Common
session-cookie-security ssl-only
session-timeout-minutes 5
traffic-capture {
capturing-for-myanalytics {
captured-protocols all
}
}
}
root@(B3900-R67-S12)(cfg-sync Standalone)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [HTTP::uri] eq "/stats" } {
log local0. "request_throughput: [ISTATS::get "VIP [virtual name] counter request_throughput"]"
log local0. "response_throughput: [ISTATS::get "VIP [virtual name] counter response_throughput"]"
}
}
}
test
[root@B3900-R67-S12:Active:Standalone] config tail -f /var/log/ltm
Aug 1 09:37:47 B3900-R67-S12 info tmm3[9398]: Rule /Common/myrule : request_throughput: 7680
Aug 1 09:37:47 B3900-R67-S12 info tmm3[9398]: Rule /Common/myrule : response_throughput: 339520
istats dump
[root@B3900-R67-S12:Active:Standalone] config istats dump
/var/tmstat/cluster.tm2 [READONLY]: nextBlockId=4064, last update at 2013-08-01 09:39:08
all facts:
[ GEO=N/A ][concurrent_sessions] = 0 (2013-08-01 09:39:08)
[ GEO=N/A ][new_sessions] = 0 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][page_load_time_samples] = 0 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][request_throughput] = 5760 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][response_throughput] = 254640 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][page_load_time] = 0 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][concurrent_sessions] = 0 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][max_page_load_time] = 0 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][server_latency] = 68 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][tps] = 41 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][max_server_latency] = 3000 (2013-08-01 09:39:08)
[ VIP=/Common/bar ][new_sessions] = 0 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][page_load_time_samples] = 0 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][request_throughput] = 5760 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][response_throughput] = 254640 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][page_load_time] = 0 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][max_page_load_time] = 0 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][server_latency] = 68 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][tps] = 41 (2013-08-01 09:39:08)
[ POOL=200.200.200.101:80 ][max_server_latency] = 3000 (2013-08-01 09:39:08)
[ vip=/Common/bar ][page_load_time_samples] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][request_throughput] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][response_throughput] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][page_load_time] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][max_page_load_time] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][server_latency] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][tps] = 0 (2013-08-01 09:39:08)
[ vip=/Common/bar ][max_server_latency] = 70 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][page_load_time_samples] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][request_throughput] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][response_throughput] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][page_load_time] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][max_page_load_time] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][server_latency] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][tps] = 0 (2013-08-01 09:39:08)
[ pool=200.200.200.101:80 ][max_server_latency] = 70 (2013-08-01 09:39:08)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects