corner image corner image
corner image corner image
corner image corner image
corner image corner image
corner image corner image
corner image corner image
corner image corner image

pdnsd versus dnsmasq on Debian for DNS caching

Most likely my experience will be similar if I tried it on Ubuntu. I used pdnsd for a very long time for dns caching, almost 6 months. The speed gains one will get from DNS caching is tremendous especially if you are running a server that mirrors or copies content from a remote server periodically.

My real estate website hosts almost 900,000 pictures for the listings displayed. Every listing has between 1 and 20 pictures, in three resolutions. Mirroring that number of pictures without a DNS cache requires for every request a name server lookup outside my local network, which adds up to almost three weeks to copy that much files. By using a DNS cache things go much faster, so the same amount of data can be downloaded in three days approximately.

pdnsd is an awesome package. My troubles with it were very specific: memory usage. I need the memory for the database and apache serving the requests, and I don’t want to waste it with pdnsd although I need pdnsd. It used to run on almost 30MBytes of memory, and I had no justification of why it needs all of this when I’m limiting the maximum time to live for its cache, and limiting the memory cache to 64KBytes.

After lots of trials with its config file, I decided to look for an alternative. dnsmasq was unbelievable to me. I didn’t configure a thing. I just installed it using apt-get. It caches the dns requests with a response comparable to pdnsd. Memory usage is almost non-existent. I use gmemusage to display the resource usage graphically, the its no where on the display.

mosama@debian:/home$ dig blogflux.com

; < <>> DiG 9.2.4 < <>> blogflux.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 15760
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;blogflux.com.                  IN      A

;; ANSWER SECTION:
blogflux.com.           14400   IN      A       204.11.52.71

;; Query time: 61 msec
;; SERVER: 192.167.0.110#53(192.167.0.110)
;; WHEN: Tue Apr 24 20:43:32 2007
;; MSG SIZE  rcvd: 46

mosama@debian:/home$ dig blogflux.com

; <<>> DiG 9.2.4 < <>> blogflux.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 9201
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;blogflux.com.                  IN      A

;; ANSWER SECTION:
blogflux.com.           14394   IN      A       204.11.52.71

;; Query time: 2 msec
;; SERVER: 192.167.0.110#53(192.167.0.110)
;; WHEN: Tue Apr 24 20:43:38 2007
;; MSG SIZE  rcvd: 46

The speed of response of the cache is very fast. The first dig to blogflux.com took 61 msec because its a cache miss. The following one took only 2 msecs.

gmemusage after installing dnsmasq

Technorati Tags: , , , , , , , , , , ,
corner image corner image

corner image corner image

One Response to “pdnsd versus dnsmasq on Debian for DNS caching”

  1. Postgresql is really beating my expectations » Mohamed Ibrahim Says:

    [...] I updated the website this weekend and it’s been downloading images from MRIS non-stop. In a previous post I said that I had around 900,000 images. I later on discovered that I had dangling images whose [...]

Leave a Reply

corner image corner image
6,191 spam comments
blocked by
Akismet