djbdns 真是个好东西,困扰好久的sendmail发信速度慢的问题解决!

引用本文请注明出处:Just Do IT (http://www.toplee.com) < Michael Lee @ toplee.com >

前几天服务器更换了电信的ip和dns之后,速度有了很大提高,系统发信的速度也基本达到了正常可以接受的水平,但是如果要应付大量的邮件列表功能,还是感觉有些吃力,于是考虑进一步提高dns解析速度,因为sendmail响应慢很大程度跟dns反向解析解析有关,在网上查了很多资料都提到受sendmail发信慢的困扰,但是都没有看到好的解决办法。

偶然间从freebsd的ports/dns/下看到了djbdns这个包,一查资料发现有个dnscache功能,于是决定一试,没想效果出奇的好,非常值得推荐给大家!

下面是我安装过程,和大家分享!

全部都是使用root用户操作下面的命令!

[coolcode]
#cd /usr/ports/dns/djbdns
#make install clean
#mkdir /var/service
#csh (或者exit退出再登陆,或者运行bash也可以)
#dnscache-conf nobody nobody /var/service/dnscache 127.0.0.1
#vi /etc/rc.conf 里加入 svscan_enable=”YES”
#/usr/local/etc/rc.d/svscan.sh start 启动服务,完成安装
下面检查服务启动情况
#netstat -anl |grep LISTEN
看看里面是否有53端口的监听服务,如果有就ok了
接着修改/etc/reslove.conf文件,把127.0.0.1加入到第一行,如下
nameserver 127.0.0.1
nameserver xx.xx.xx.xx (其他的公网dns)

这时测试一下效果
dig www.sina.com.cn
你会发现可能第一次稍微时间长一点,第二次反应时间都基本是0.000msec或者0.001msec,这就是取到了本地的缓存,效果好得不行!

[/coolcode]

接着测试了sendmail的大量并发发信,结果非常的喜人,完全能满足中等网站的并发业务处理了,朋友们可以自己测试一下:)

djbdns其他的功能我还没有研究到,欢迎大家和我一起学习和交流!

7 thoughts on “djbdns 真是个好东西,困扰好久的sendmail发信速度慢的问题解决!”

  1. 往外连接你还需要限制? 你可以指定协议UDP到 target的port是53的都开放,具体书写语句看ipfw的man吧。理论上这个规则是默认都会打开的,要不你的机器怎么做dns解析.

  2. First off I want to say excellent blog! I had a quick question in which
    I’d like to ask if you do not mind. I was curious to know how you center yourself and clear your thoughts prior
    to writing. I’ve had difficulty clearing my mind in getting
    my thoughts out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are generally wasted simply just trying to
    figure out how to begin. Any suggestions or hints?
    Thanks!

  3. I’ve been surfing online more than 4 hours today, yet I never found any interesting article like
    yours. It is pretty worth enough for me. In my view, if all site
    owners and bloggers made good content as you did, the net will be
    a lot more useful than ever before.

  4. It’s perfect time to make a few plans for the long run and it is time to
    be happy. I have read this submit and if I may I desire to
    suggest you few fascinating issues or suggestions.
    Maybe you can write next articles regarding this article.

    I desire to learn even more things about it!

  5. Just desire to say your article is as astonishing. The clearness to your post is just excellent and that
    i can think you are a professional in this subject. Well along with your permission let
    me to take hold of your RSS feed to stay updated
    with approaching post. Thanks 1,000,000 and please continue the enjoyable work.

  6. Hello this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors
    or if you have to manually code with HTML.
    I’m starting a blog soon but have no coding knowledge so I wanted to
    get advice from someone with experience. Any help would be
    enormously appreciated!

  7. An intriguing discussion is definitely worth comment.
    I do believe that you ought to write more on this issue, it might not be a taboo subject but usually people don’t talk about these issues.
    To the next! All the best!!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image