cURL / Mailing Lists / curl-library / Single Mail

curl-library

Performance issue on machine with lots of interfaces.

From: Ben Greear <greearb_at_candelatech.com>
Date: Wed, 16 Jan 2013 09:48:27 -0800

I'm running a lib-curl application on a Linux machine with 2000 virtual interfaces.

Startup was taking forever and bogging down the system.. It seems
that it is slurping all interface information for each connect attempt.

It looks like I can fix the issue below by prefixing the device name with 'if!',
but then it will still call Curl_if2ip which gets all of the ifaddrs
again.

My application already goes to lots of work to know the IP addr,
so I'd like to pass that in to curl as well (and, for any interface
with multiple IPs, we should be able to tell curl anyway)

Any suggestions on an acceptable way to do this? I don't mind
writing the code..just hoping to get the API right the first time.

Thanks,
Ben

Breakpoint 1, 0x0000003108ef2630 in recvmsg () from /lib64/libc.so.6
(gdb) bt
#0 0x0000003108ef2630 in recvmsg () from /lib64/libc.so.6
#1 0x0000003108f1360d in __netlink_request () from /lib64/libc.so.6
#2 0x0000003108f138d6 in getifaddrs_internal () from /lib64/libc.so.6
#3 0x0000003108f14600 in getifaddrs () from /lib64/libc.so.6
#4 0x000000000046c248 in Curl_if_is_interface_name (interf=0x21a8928 "eth2#950") at if2ip.c:80
#5 0x0000000000444b62 in bindlocal (conn=0x21c6c08, sockfd=6, af=2) at connect.c:306
#6 0x0000000000445c85 in singleipconnect (conn=0x21c6c08, ai=0x21e5468, timeout_ms=300000, sockp=0x7fff62af43a4,
     connected=0x7fff62af4463) at connect.c:938
#7 0x00000000004460fc in Curl_connecthost (conn=0x21c6c08, remotehost=0x21e5438, sockconn=0x21c6db0,
     addr=0x7fff62af4418, connected=0x7fff62af4463) at connect.c:1080
#8 0x00000000004677c6 in ConnectPlease (data=0x21c9888, conn=0x21c6c08, connected=0x7fff62af4463) at url.c:3366
#9 0x000000000046b1f5 in Curl_setup_conn (conn=0x21c6c08, protocol_done=0x7fff62af44ea) at url.c:5313
#10 0x000000000046b3be in Curl_connect (data=0x21c9888, in_connect=0x7fff62af4538, asyncp=0x7fff62af44eb,
     protocol_done=0x7fff62af44ea) at url.c:5395
#11 0x0000000000479369 in connect_host (data=0x21c9888, conn=0x7fff62af4538) at transfer.c:1944
#12 0x00000000004796b8 in Curl_do_perform (data=0x21c9888) at transfer.c:2091
#13 0x0000000000479a3e in Curl_perform (data=0x21c9888) at transfer.c:2238
#14 0x0000000000442fcb in curl_easy_perform (curl=0x21c9888) at easy.c:536
#15 0x000000000040e017 in HL4Endp::doReadWriteRound (this=0x21c74f0, now=@0x7fff62af47a0: 1358357714299) at l4Endp.cc:289
#16 0x000000000040fceb in HL4Endp::doTrafficRound (this=0x21c74f0, now=@0x7fff62af47a0: 1358357714299) at l4Endp.cc:478
#17 0x000000000041deb3 in L4HelperMgr::doTrafficRound () at l4Manager.cc:289
#18 0x000000000040a453 in do_big_while () at l4helper.cc:279
#19 0x0000000000409b97 in main (argc=15, argv=0x7fff62af4bd8) at l4helper.cc:182

-- 
Ben Greear <greearb_at_candelatech.com>
Candela Technologies Inc  http://www.candelatech.com
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-01-16