免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3449 | 回复: 4
打印 上一主题 下一主题

[DNS] dns报错“out of memory”停止服务 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-11 16:59 |只看该作者 |倒序浏览
dns服务器机器为sun, 系统为solaris9  安装bind-9.2.3-sol9-sparc-loca
运行1年多一直很好,最近突然莫名其妙的停止解析服务,进程还在,需要重新启动才能使用,查看日志有如下错误:

Sep 10 18:02:02.212 client: warning: client 58.194.122.159#11909: no more recurs
ive clients: quota reached
Sep 10 18:02:02.213 client: warning: client 58.194.122.159#11909: no more recurs
ive clients: quota reached
Sep 10 18:02:02.332 client: warning: client 210.46.92.43#45228: no more recursiv
e clients: quota reached
Sep 11 13:33:44.810 general: error: resolver.c:2334: unexpected error:
Sep 11 13:33:44.810 general: error: isc_timer_create: out of memory
Sep 11 15:20:42.811 general: critical: mem.c:1560: INSIST(mpctx->allocated > 0)
failed
Sep 11 15:20:42.811 general: critical: exiting (due to assertion failure)

请高手指点如何解决?
dns的部分配植文件如下:
options {
                  directory  "/var/named/";
                  pid-file   "/var/named/named.pid";
                  #named-xfer "/usr/sbin/named-xfer";
                  datasize 40M;
                  #transfers-in     10;
                  #allow-query { local;cernet;cnc;localip; };
                  allow-transfer {slaverdns;};
                  allow-recursion {local;cernet;cnc;localip;cernet2; };
                  recursive-clients 1000;
                  recursion yes;
                  allow-notify {local;cernet;cnc;localip;cernet2;};
                  version "who knows?";
                  auth-nxdomain no;
          };

论坛徽章:
0
2 [报告]
发表于 2008-09-16 08:47 |只看该作者
把这两个调大些:

datasize 40M;
recursive-clients 1000;

如果系统负载较大,建议增加服务器分担负载。

论坛徽章:
0
3 [报告]
发表于 2008-09-17 11:33 |只看该作者
我也查了一些资料,都是英文的,由于外语水平一般,所以没有弄的太清楚。
其中有一个例子和我的类似,其配置也是
datasize 40M;
但实际内存消耗达到700多M
他调整了datasize 20M
但消耗内存依然很大,问题没有解决。
后来经人指点他重新编译设置了:
disable threads
说问题解决了 内存消耗很低

但我的系统为solairs使用源代码编译很麻烦,系统没有C(需要购买),所以我安装使用的是二进制版本,直接安装:
所以不能设置disable threads ,而且我查了资料说disable threads是默认设置。
所以我现在想弄清楚的是:
产生这种想象到底是软件的编译配置问题,还是由于服务器负载过大而产生的。
如果是配制问题该如何调整,将
datasize 40M;
recursive-clients 1000;
调大还是调小。
多谢!!

论坛徽章:
3
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:19
4 [报告]
发表于 2008-09-17 13:10 |只看该作者
no more recursive clients: quota reached 是因为你的 recursive-clients 值太小,这个根据你的用户数量调大一些。

datasize 这个项的作用是设置服务器可以使用的最大数据内存量。默认值为default。这是一个在服务器系统内存中已经设置了的参数。如果服务器要超过这个限制的内,则会失败,这将使服务器不能提供DNS 服务。所以,这个选项作为一种限制服务器所使用的内存量的方式就不太有效,但是它能够将操作系统设置的太小的缺省数据尺寸增大。如果要限制服务器使用的内存量,可以使用max-cache-size 和 recursive-clients 选项。如果你的服务器没用其他用途建议不要配这个。

solaris上可以用gcc,sparc和x86的版本都有,如果不想自己编译bind话可以到 www.sunfreeware.com 去下编译好的二进制版本。

低版本的bind往往存在各种问题,实际生产环境中建议用9.4以上的版本比较好。

论坛徽章:
0
5 [报告]
发表于 2008-09-17 14:57 |只看该作者
多谢!说的很透彻,

令人烦恼的是今天dns又停止了解析,而且又出现了新的错误
……
Sep 16 21:22:37.395 dispatch: error: dispatch 9a70d8: shutting down due to TCP r
eceive error: connection reset
Sep 17 09:11:06.431 dispatch: error: dispatch 9a70d8: shutting down due to TCP r
eceive error: connection reset
Sep 17 09:12:17.313 dispatch: error: dispatch 9a70d8: shutting down due to TCP r
eceive error: connection reset
Sep 17 09:39:11.177 dispatch: error: dispatch 9a70d8: shutting down due to TCP r
eceive error: connection reset
Sep 17 11:54:28.050 database: warning: cache cleaner could not create iterator:
out of memory
Sep 17 11:54:28.050 general: error: cache.c:594: unexpected error:
Sep 17 11:54:28.050 general: error: cache cleaner: dns_dbiterator_first() failed
: out of memory
Sep 17 12:54:28.060 database: warning: cache cleaner could not create iterator:
out of memory
Sep 17 12:54:28.060 general: error: cache.c:594: unexpected error:
Sep 17 12:54:28.060 general: error: cache cleaner: dns_dbiterator_first() failed
: out of memory
Sep 17 13:33:53.883 general: critical: mem.c:1560: INSIST(mpctx->allocated > 0)
failed
Sep 17 13:33:53.890 general: critical: exiting (due to assertion failure)


“dispatch 9a70d8: shutting down due to TCP r
eceive error: connection reset”是什么原因造成的呢?

我准备把database注释掉,并把recursive-clients 调整大一些,观察一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP