Forum Discussion
Chunking queries
Do I need to chuck data into multiple queries? or just send one query using an array?
I am trying to write a perl script to pull a list of virtuals and their status/default pool etc..
-Ed
7 Replies
- mhite_60883
Cirrocumulus
Can you be more specific? Your question is a bit vague. - Michael_Yates
Nimbostratus
Hi Ed,
I think that I understand what you are trying to do and the output of each query in some cases will be the input for the next.
Get a list of Virtual Servers: LocalLB::VirtualServer - get_list
- Foreach Virtual Server: LocalLB::VirtualServerl - get_default_pool_name
- Foreach Pool: LocalLB::Pool - get_member (get_member_v2)
etc..
So you will need to build multiple queries (It will get fun when you are dealing with the Pool Mmebers with the CommonIPPortDefinition's).
Hope this helps. - Ed_Royce_116493
Nimbostratus
hi. thanks for your replies.
Sorry, what i mean is, say I have 150 Virtuals on the LTM and I want to use iControl to pull stats on them all. Do I send the query all at once (for 150 Virtuals) or should I break it up into smaller groups and send multiple queries to the LTM?
I think its fine to send all at once, but I have seen some scripts that do chuck the requests.
(I am new to iControl)
:) - mhite_60883
Cirrocumulus
Note that there is a method to pull statistics on all virtual servers:
LocalLB.VirtualServer.get_all_statistics()
and another method to pull statistics for a given set of virtual servers:
LocalLB.VirtualServer.get_statistics()
It is fine to pull them all at once in my experience. - Derek_21893
Nimbostratus
I have used LocalLB.VirtualServer.get_all_statistics() for *thousands* of Virtual Servers on one LTM without any issues. If you are storing the statistics in something like RRD, then obviously you need to have this call complete in time for whatever your polling period is. Even with thousands of vservers the call will complete (given your network latency isn't insane) in time to make a 5 minute polling period.
Hope that helps!
-Derek - Ed_Royce_116493
Nimbostratus
Thanks All. How you "chunk" your methods is really up to your configuration. For systems that are highly utilitized and you are querying 10000 objects, doing a single bulk query may be too overtaxing. For 150 objects, doing a single query most likely won't cause any issues and would perform better from the client side.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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