Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53413
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.028 |
| X-Spam-Evidence | '*H*': 0.94; '*S*': 0.00; 'python.': 0.02; 'third- party': 0.04; 'subject:skip:s 10': 0.07; "'python": 0.09; 'addr': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hostname': 0.16; 'subject:slow': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'seems': 0.21; 'issue.': 0.22; 'config': 0.24; 'nearly': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'am,': 0.29; 'subject:) ': 0.29; 'message- id:@mail.gmail.com': 0.30; 'sep': 0.31; 'linux': 0.33; 'addresses': 0.33; 'trouble': 0.34; 'core': 0.34; 'subject:from': 0.34; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'machine.': 0.36; 'skip:" 50': 0.36; 'shows': 0.36; 'behind': 0.37; 'list': 0.37; 'server': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'anything': 0.39; 'extremely': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'results.': 0.60; 'most': 0.60; 'information': 0.63; 'more': 0.64; 'quicker': 0.84; 'subject:skip:g 10': 0.84; 'you;': 0.84; '2013': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=sI1ok0rmvKnBzgZXBt5AYVySXrH8SEmMAHj+d3aiiCk=; b=XJePUHbLX0hMit8g0hncg3H2bE0ScZgMdvk89PJYIriWQXFKIsAGUWo0+CcqFD/QJX tndc/rBij051moJ5H0ajMiQlsWxLJorSqwOf/96Lw1IqLv+77y+oHFWf0NlrS3p3boHv wWeSWP3V9nJe8YL3xjE3loMHaYnxB+BUPp4jMyLymuL4CegLrmlKdrk7jDSABzcps5TG N7LDDxcUkueJxPdIkO/1QOEXmXHUTnHGnm0cM7vTpZjxNOPVfjP9N3rijzkoupWCj79M 2CBLwMDzHQ/7tXzdK0Yy61DE02l2GOcz4YyA3SLcwQnnxzG9/BVMU7bTBFxeMzix90Az bitA== |
| MIME-Version | 1.0 |
| X-Received | by 10.58.19.162 with SMTP id g2mr17932113vee.12.1378035454457; Sun, 01 Sep 2013 04:37:34 -0700 (PDT) |
| In-Reply-To | <b9f77b6f-3a65-407a-aff5-5677be2ba228@googlegroups.com> |
| References | <b9f77b6f-3a65-407a-aff5-5677be2ba228@googlegroups.com> |
| Date | Sun, 1 Sep 2013 21:37:34 +1000 |
| Subject | Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.446.1378035456.19984.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1378035456 news.xs4all.nl 15899 [2001:888:2000:d::a6]:58252 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:53413 |
Show key headers only | View raw
On Sun, Sep 1, 2013 at 10:03 AM, <anntzer.lee@gmail.com> wrote: > At startup, IPython (qtconsole) calls "socket.gethostbyname_ex(socket.gethostname())[2]" to find a list of IP addresses that point to the machine. On a Linux server that I manage this call is extremely slow (>20s)... which I have trouble understanding as "ip addr show" seems to give the same information nearly instantaneously. Is there anything I can do to make this faster? Can this be a network configuration issue (I am behind a router)? Yes, it most definitely CAN be a network config issue. The C function you want to be calling is getifaddrs(), and I don't think there's a way to call that from core Python. But a Google search for 'python getifaddrs' shows up a few third-party modules that might be of use to you; that'd be a lot quicker and more reliable than trying to look up your own hostname and depending on the results. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) anntzer.lee@gmail.com - 2013-08-31 17:03 -0700
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Roy Smith <roy@panix.com> - 2013-08-31 21:01 -0400
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) anntzer.lee@gmail.com - 2013-08-31 21:51 -0700
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Michael Torrie <torriem@gmail.com> - 2013-08-31 23:06 -0600
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) anntzer.lee@gmail.com - 2013-09-01 10:13 -0700
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Roy Smith <roy@panix.com> - 2013-09-01 06:57 -0400
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Chris Angelico <rosuav@gmail.com> - 2013-09-01 21:37 +1000
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) anntzer.lee@gmail.com - 2013-09-01 13:37 -0700
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Chris Angelico <rosuav@gmail.com> - 2013-09-02 07:03 +1000
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) anntzer.lee@gmail.com - 2013-09-01 22:28 -0700
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Chris Angelico <rosuav@gmail.com> - 2013-09-02 20:42 +1000
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Roy Smith <roy@panix.com> - 2013-09-02 08:45 -0400
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) anntzer.lee@gmail.com - 2013-09-02 10:52 -0700
Re: gethostbyname_ex(hostname) extremely slow (crossposted from stackoverflow) Chris Angelico <rosuav@gmail.com> - 2013-09-03 07:12 +1000
csiph-web