UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2003-07-28 11:25 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: So very slow...

Where the heck is everyone?  Seems the forums as slowed to a veritable crawl over the past couple of weeks... :-/

On that note... and off topic for the lounge... someone on the glibc list was asking for millisecond timeouts to be added to the (dns) resolver code to make it (more) useable for hi-avail systems running on dedicated networks...  already tinkering around with the changes...

BUT...

I have a shortage of test machines...  and was wondering if anyone out there would be interested in doing some QA on the thing if / when I finish it... 

Yeah yeah... no pay... this is the glibc open source stuff... but you could get your name tacked onto the changelogs or something if ya helped... and the code was accepted...

So anyone interested... ?  :-)

Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

#2 2003-07-29 01:15 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: So very slow...

Yeah, I thought it was pretty slow around here recently, too...
Not sure why...  Maybe most of our usual posters are college
kids, who are now all on summer break? ;-)

I'd give those resolver changes a try, but if it involves installing
a new untested glibc, I don't think I quite dare do that to my work
machine... ;-)  Personally, I'm not so worried about millisecond
level timeouts; I just think the whole resolver timeout handling is
a major mess, anyway...  I'd be happy if there were some easy
way to say, "Limit all resolving activity to no more than <x>
amount of time", even if that's in whole seconds...  And, last time
I checked, it was NOWHERE near as easy as all that...  You can
tweak "_res.retry" and "_res.retrans" to limit the number of lookup
attempts and the number of seconds it waits for each one...  But,
the annoying part comes in that with every single retry attempt,
the retrans timeout is effectively doubled...  And, it'll also usually
try to tack on your local domain to any timed out lookups, and
then re-lookup that combination, effectively doubling the total
time spent...  All of this makes it a real bitch to set those values
appropriately up front to try to keep the total time spent in
resolving to some fixed limit... ;-/  I've got a semi-klugey method
of accomplishing it, which seems to work relatively well...  For
one thing, I clear out "_res.dnsrch* " and "_res.defdname", so
no auto-appending of the local domain is done, doubling the
lookups unnecessarily...  (The only cases in which such a feature
is useful is for local hosts, which should all be in your "/etc/hosts"
file anyway, so it should never even get to DNS!)  Then, I just
calculate the appropriate values to set "_res.retry" and
"_res.retrans" to, to achieve a total time limit of some fixed
second value, taking into accound the auto-doubling of retrans
after every retry...  Annoying, but like I say, seems to work...  But,
you know, if you're playing around with the timeouts, a simpler
method of setting some upper limit of resolving time than that
would be nice... ;-)  (Or, is there one already, and I just don't know
WTF it is??  Using the stock resolver stuff, I mean, not using
things like separate threads/processes to do the resolving, where
you can kill them off after whatever timeout you like...)

Offline

#3 2003-08-03 09:55 AM

Uzume
Administrator
Registered: 2002-08-30
Posts: 186

Re: So very slow...

Speaking of slow...

Is it me or does this site itself seem alot slower in response times lately?.

On the libc resolver issue, I would be happy to try and do some testing but no promises on timeframe. And as for the wish list, I would like a non-blocking resolver API that let the client block instead of the API itself blocking. Of course, this would require the API to tell it what events it wants to wait for (for select/poll and friends).

Offline

#4 2003-08-03 05:17 PM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,239

Re: So very slow...

I too would like to have a non-blocking resolver API or gethostbyname variant. There are some libraries that offer the functionality, but I think it should be really default. Something like:

struct stuff {
  int fd;       // default non-blocking
  int events;   // bitmask of READ, WRITE or whatever
  data;         // info for internal usage, like status etc.
  struct hostent h;
}

int gethostbyname_n(stuff* s, const char* name);

e.g. returns 0 when the name is resolved, 1 when it would block and -1 when an error occured.


After this you can use select/poll/etc on s.fd, if you can read or write you just call gethostbyname_n again with the same parameters (or another function, but the same one seems appropriate, all the info it needs is in s and name) till it returns 0.


To go even more off-topic: Anyone knows a non-blocking mysql client library? The default one doesn't seem to support non-blocking operations and forces you to use multiple threads, something I want to avoid. PostgreSQL seems to have a non-blocking API, but I need mysql support.

Offline

#5 2003-08-05 12:24 PM

Encrypted
Member
From: Netherlands
Registered: 2003-04-29
Posts: 45

Re: So very slow...

Offline

#6 2003-08-05 01:21 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: So very slow...

I took a quick look at that cprogramming.com networking forum,
and it looks like most of the people there are more focused on
Windoze programming...  As such, I say thank god for their
existence; maybe they'll help drain the Windoze questions out
of this forum! ;-)

Offline

#7 2003-08-20 09:45 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: So very slow...

Just an update...

I will be out / offline for a few weeks... starting a contract over in Asia and busy taking care of things...

I should be back online with some time to post etc. the first or second week in September...

Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

#8 2003-08-31 09:59 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: So very slow...

Just doing a couple of quick posts...

I should be overseas (semi-permanently) and back online by apx the 7th of the month... or at least that is the target date...

Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

#9 2003-10-24 11:51 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: So very slow...

The 7th of WHAT month, I wonder??  It's now nearly the end of
October, and I still haven't seen you around since this post...  Did
you run off and leave me to answer questions all by myself?? ;-)

Offline

#10 2003-11-13 02:06 PM

bzchevalier
Member
Registered: 2003-09-04
Posts: 40

Re: So very slow...

Offline

#11 2003-11-14 10:01 PM

HectorLasso
Administrator
From: Colombia
Registered: 2002-06-12
Posts: 353

Re: So very slow...

Why don't you like Windowz????
It is so very useful, almost everyone uses it and it never fails....

sorry for the delay in replying, I had to reboot my machine twice and finally had to reinstall the whole thing...

;)

Offline

Board footer

Powered by FluxBB