Forum Discussion
Sunit_Tailor_11
Nimbostratus
Aug 03, 2006What tofind other way to reduce execution time for enabling and disabling pool members
Hi,
I have Java application which takes "Pool Member"(A) and "desire Session Status"(B) as arguments.
The Primary functionality of this program is to set desired session status for given pool member on each Virtual Server it is defined irrespective of its priority.
This Programs gets all defined BigIPs from database and for each BigIP it dose following for given Pool Member:
1) Opens the secure connection to given BigIP.
2) Runs Command to get all the Virtual Servers.
String[] VserverList = v_server.get_list();
3) For each Virtual it gets default pool.
parms[0] = VserverList[v].trim();
String[] Default_Pool_Name = v_server.get_default_pool_name(parms);
4) For this default pool it does :
parms[0] = Default_Pool_Name[0];
memberStatList = m_poolMember.get_all_statistics(parms);
memberState = m_poolMember.get_session_enabled_state(parms);
iControl.LocalLBPoolMemberMemberStatisticEntry[] memberEntryList = memberStatList[0].getStatistics();
5) For each "memberEntryList" it does:
iControl.CommonIPPortDefinition member = memberEntryList[j].getMember();
6) It compares this member with "A" ("Pool Member" provided as an argument to this script.)
7) If it matches then it does following:
if "C" ("desired status" provided as an argument) is "ENABLED" then:
memberState[0][j].setSession_state(iControl.CommonEnabledState.STATE_ENABLED);
if "C" ("desired status" provided as an argument) is "DIABLED" then:
memberState[0][j].setSession_state(iControl.CommonEnabledState.STATE_DISABLED);
Is there a way I can reduce the execution time for this program? Is there a way to execute this same functionality with less time.
Currently It takes for us about 2 Minute to do this for one pool member. In our enviroment One Pool Member is defined two times with different priorities at two different Virtual servers on each BigIP. We have four BigIPs. So basically this program affects session status of a given poll member at 16 location.
Any inpput on this question is appreciated.
Thanks.
- Sunit_Tailor_11
Nimbostratus
Hi Joe, - Both methods will return the full array list for each of the members in the requested pools. Here's some code that will enumerate the response from get_session_enabled_state()
public void getPoolMembers(String pool_name) throws Exception { String [] pool_list = new String[1]; pool_list[0] = pool_name; System.out.println("Querying pool " + m_pool); iControl.LocalLBPoolMemberMemberSessionState [][] stateAofA = m_poolMember.get_session_enabled_state(pool_list); Loop over first dimension (pools) for(int i=0; i { iControl.LocalLBPoolMemberMemberSessionState [] state_list = stateAofA[ i ]; Next, loop over the pool members for pool i for(int j=0; j { iControl.CommonIPPortDefinition member = state_list[j].getMember(); iControl.CommonEnabledState session_state = state_list[j].getSession_state(); System.out.println("[" + i + "][" + j + "] - " + member.getAddress() + ":" + member.getPort() + " => " + session_state ); } } }
- Sunit_Tailor_11
Nimbostratus
Hi Joe,
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