[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question (not necessarily related to -amd64)



This one time, at band camp, mike said:
> Is an /etc/hosts lookup negligible? I'd like to assign "friendly
> names" to my servers "i.e. 'mysql' for the mysql server" - right now I
> use IPs. But it would make it more portable (as well as make it easier
> for my hosting clients to remember) - but if it's going to add a lot
> of overhead, then I'd rather not... I know it isn't as "expensive" as
> a normal DNS lookup, but it has to be more expensive than just a
> straight IP address.
> 
> This would mainly be used from PHP scripts, some are accessed hundreds
> of times per minute - maybe this information gets cached and I'm
> worrying for nothing?

You'll quickly find when you start doing any debugging that most
programs call gethostbyname() at some point during their execution
anyway, so this is already being done behind the scenes, and you're just
not noticing.  Putting it in /etc/hosts is as cheap as it gets, besides
nscd (when that's not crashing).

HTH,
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        sgran@debian.org |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature


Reply to: