Operating System - HP-UX
1748224 Members
4403 Online
108759 Solutions
New Discussion юеВ

HP-UX 11.0: unsetting logical IPs speed problem

 
Ronald Bolante
Occasional Advisor

HP-UX 11.0: unsetting logical IPs speed problem

good day! i have a problem and i think someone here can help me out... can anybody help me find a way to speed up the process of clearing logical IPs? i have a program that creates a threads and adds up a logical IP, creates 4 sockets for each thread and bind it in that IP... until i add up to 2,000 logical IPs (so 8,000 sockets and 2,000 threads all in all)... when it is about time to clear those 2,000 existing logical IPs and closing first all the sockets binded to it the system hangs up after clearing about 520 logical IPs but resumes after 10-15 minutes... is there a way to speed up the process of clearing it... i'm not sure if my analysis is correct but i think the system resources has something to do with it (a kernel parameter maybe)... i need to find a way to sped this up... thanks in advance...
5 REPLIES 5
rick jones
Honored Contributor

Re: HP-UX 11.0: unsetting logical IPs speed problem

if you can separate-out the issue of closing sockets from the issue of removing logical IP addresses it might help. also, if you can do this with and without the threads that might help. divide and conquer and all that...

also, as I understand it, there were some perf enahncements in the handling of adding/removing aliases in the latest 11.X patches. you might also try 11i on a test system and see how much that might improve things.

i thought though that the biggest issue with logical IPs was not removing them, but adding them, and that closing sockets shoudl be reasonably fast, but opening them migh get slower as you had more open, so things do sound a bit reversed from my prior experience
there is no rest for the wicked yet the virtuous have no pillows
Ronald Bolante
Occasional Advisor

Re: HP-UX 11.0: unsetting logical IPs speed problem

thanks for your reply... here is one issue... adding logical IPs is not a problem on our part... also, we can not change the design of the existing program which actually uses threads... one more thing, we have modified a kernel parameter named NFILE (which is the number of files open system-wide) to support the number of sockets opened by our program... i think there must be another parameter that should modify in order for us to support the value we have assign to NFILE... maybe it has something to do with the memory... do u know something about this? thanks again...
Brian Hackley
Honored Contributor

Re: HP-UX 11.0: unsetting logical IPs speed problem

Ronald,
I noticed you've posted the same question in multiple locations. Anyways since Rick already replied here, I'll do so too.

I imagine you've already done some work by using tools such as HP GLANCE and tusc (get from http://hp-ux.cs.utah.edu )? I know there are some kernel routine profiling tools we use inside HP on occasion to find out what routings the kernel is spending its time which is visibility beyond the system call level that might help if needed.

As for HPUX Kernel parameters, it appears you have not had the chance to go thru any of the HPUX docs on http://docs.hp.com , specifically the Whitepaper entitled "Configurable Kernel Parameters (HP-UX 11.0)". Take a good read there and also the ITRC Application Note UPERFKBAN00000726 is a good starting point too.

Hope this helps,

-> Brian Hackley
Ask me about telecommuting!
rick jones
Honored Contributor

Re: HP-UX 11.0: unsetting logical IPs speed problem

if you cannot modify the base program, simply extract the parts that do the ip address manipulation and then the parts that do the sockets manipulation.

i doubt that nfile would be an issue for closing the sockets or removing the aliases. it would certainly come into play when you were creating the sockets, but the failure mode there would be that your call to socket() would fail, which presumeably is before you try to close the socket or remove the IP alias :)

it still seems awfully strange that you would have perf issues removing sockets and IPs and not adding them, especially the adding of IPs, but then it has been a little while since i've actually tried the IP's myself - when I did, it was an O(N^2) algorithm, but I though that delete was much lower.
there is no rest for the wicked yet the virtuous have no pillows
Ronald Bolante
Occasional Advisor

Re: HP-UX 11.0: unsetting logical IPs speed problem

thanks for another help rick... but i need some information regarding configurable kernel parameters in SAM... i have read all about them and it seems that they can't help my problem... i need techniques... we have modified the NFILE value to suffice our needs but i think "something" must also be increased to be parallel with its value... maybe memory-wise... with 8,000 sockets opened there can be a possibility of a high memory usage...

clearing logical IPs is an OS job and we can also think that the OS plays a big factor in this problem... we cannot change the way the OS responds to our needs...

anyway, i can give youe the function we are using and i would be thankful if you can help us see its loopholes... this function unclears 40 logical IPs at a time... thanks in advance...



int SCOM_ifconfigunsetpage( devname_cp, ppa_i, msnum_i )
char *devname_cp;
int ppa_i;
int msnum_i;
{
int sd_i;
struct ifreq ifr_s;
struct sockaddr_in *sock_addr_sp;
int result_i;
int i_i;
int j_i;

/* create a socket */
sd_i = socket( AF_INET, SOCK_DGRAM, 0 );
if( sd_i < 0 ){
fprintf( stdout, "ifconfig socket creation for ms number %d
failed\n", msnum_i );
return( 1 );
}

for( i_i = msnum_i, j_i = 0; i_i < ( msnum_i + 40 ); i_i++, j_i++ ) {

/* construct the if data */
memset( &ifr_s, 0x00, sizeof( struct ifreq ) );
sock_addr_sp = ( struct sockaddr_in * )&( ifr_s.ifr_addr );
sprintf( ifr_s.ifr_name,"%s%d:%d", devname_cp, ppa_i, i_i );

/* set the if flags */
ifr_s.ifr_flags &= ~IFF_UP;
result_i = ioctl( sd_i, SIOCSIFFLAGS, &ifr_s );
if( result_i < 0 ) {
fprintf( stdout, "ifconfig flag setting for ms number %d
failed\n", i_i );
close( sd_i );
return( 1 );
} /* if */

/* set the ip address of the if to 0 */
ifr_s.ifr_addr.sa_family = AF_INET;
sock_addr_sp->sin_addr.s_addr = ( unsigned long )0;
result_i = ioctl( sd_i, SIOCSIFADDR, &ifr_s );
if( result_i < 0 ) {
fprintf( stdout, "ifconfig for ms number %d failed\n", i_i );
close( sd_i );
return( 1 );
} /* if */

} /* for */

close( sd_i );
return( 0 );
}