Jerome Schevingt | 1 Jan 08:02 2004

no solutions ....

Hi
 
Please help me ;=) i don't see the solution. DLZ on my server don't works ...
 
The error :
 
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076430c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076426c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: query.c:1746: fatal error:
Jan  1 08:57:50 ns1 named[31893]: RUNTIME_CHECK(result == 0) failed
Jan  1 08:57:50 ns1 named[31893]: exiting (due to fatal error in library)
I have deleted all of my database and my conf ... i use the configuration posted by teszter
2003-11-23 without success !
 
A error in compilation ?
 
bye
 
Rob Butler | 4 Jan 00:06 2004
Picon
Picon

Re: no solutions ....

Jerome,
 
Send the DLZ section of your named.conf, a SMALL sample of the data in your database (it should include SOA, NS, and A records within the sample at least), and a BRIEF description of the DLZ related tables in your database.  I will take a look at them and try to find out what's wrong with your setup.  Without the above information I can't do anything to help you.
 
Later
Rob
----- Original Message -----
Sent: Thursday, January 01, 2004 2:02 AM
Subject: [Bind-dlz-testers] no solutions ....

Hi
 
Please help me ;=) i don't see the solution. DLZ on my server don't works ...
 
The error :
 
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076430c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076426c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: query.c:1746: fatal error:
Jan  1 08:57:50 ns1 named[31893]: RUNTIME_CHECK(result == 0) failed
Jan  1 08:57:50 ns1 named[31893]: exiting (due to fatal error in library)
I have deleted all of my database and my conf ... i use the configuration posted by teszter
2003-11-23 without success !
 
A error in compilation ?
 
bye
 
Jerome Schevingt | 4 Jan 07:04 2004

Re: no solutions ....

Hi
 
Ok thanks.
 
i run on Bind 9.2.2-P3 on a Mandrake Linux 9.2 (Kernel 2.4.22 SMP Bi Xeon 2,67 Ghz) and
MySQL 4.0.17 (ns1.phibee.net).
 
My named.conf (DLZ Section):
 
==================================================================
//#######################################################################
//##  Configuration de la base de données DLZ                          ##
//#######################################################################
dlz "Mysql zone" {
  database "mysql
  {host=localhost user=bind pass=XXXXXXX dbname=Phibee ssl=false}
  {select id from zone where zone = '%zone%'}
  {select ttl, type, mx_priority, case when lower(type)='txt' then
  concat('\"', data, '\"') when lower(type)='soa' then CONCAT_WS('
  ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
  zone,dns_records where id=zone_id and zone = '%zone%' and host =
 '%record%'}
  {}
  {select ttl, type, host, mx_priority, case when lower(type)='txt' then
  concat('\"', data, '\"') when lower(type)='soa' then CONCAT_WS('
  ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
  zone,dns_records where id=zone_id and zone = '%zone%'}
  {select '%client%' from zone where zone = '%zone%'}
  {}";
};
==================================================================
My syslog when i start named:
 
Jan  4 07:50:33 ns1 named[17045]: starting BIND 9.2.2-P3 -u named
Jan  4 07:50:33 ns1 named[17045]: using 2 CPUs
Jan  4 07:50:33 ns1 named[17047]: loading configuration from '/etc/named.conf'
jan  4 07:50:33 ns1 named: Démarrage de named succeeded
Jan  4 07:50:33 ns1 named[17047]: no IPv6 interfaces found
Jan  4 07:50:33 ns1 named[17047]: listening on IPv4 interface lo, 127.0.0.1#53
Jan  4 07:50:33 ns1 named[17047]: listening on IPv4 interface eth0, 213.41.42.129#53
Jan  4 07:50:33 ns1 named[17047]: Loading 'Mysql zone' using driver mysql
Jan  4 07:50:33 ns1 named[17047]: command channel listening on 127.0.0.1#953
Jan  4 07:50:33 ns1 named[17047]: zone 0.0.127.in-addr.arpa/IN: loaded serial 2003122001
Jan  4 07:50:33 ns1 named[17047]: zone 26/128.42.41.213.in-addr.arpa/IN: loaded serial 2003122002
Jan  4 07:50:33 ns1 named[17047]: running
Jan  4 07:50:33 ns1 named[17047]: zone 26/128.42.41.213.in-addr.arpa/IN: sending notifies (serial 2003122002)
==================================================================
 
I use a example of data structure of DLZ Mailing List, two table into my database "Phibee".
The user are bind and the access are Ok.
 
Table zone:
CREATE TABLE `zone` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `ttl` int(11) unsigned NOT NULL default '86400',
  `zone` varchar(50) NOT NULL default '',
  `resp_person` varchar(255) default 'hostmaster',
  `serial` int(11) unsigned NOT NULL default '0',
  `refresh` int(11) unsigned NOT NULL default '86400',
  `retry` int(11) unsigned NOT NULL default '7200',
  `expire` int(11) unsigned NOT NULL default '604800',
  `minimum` int(11) unsigned NOT NULL default '86400',
  PRIMARY KEY  (`id`),
  KEY `zona` (`zone`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;

INSERT INTO `zone` VALUES (1, 86400, 'phibee.info', 'hostmaster', 2004010301, 86400, 7200, 604800, 86400);
 
 
 
and the table dns_records with data for the zone "phibee.info":
 
CREATE TABLE `dns_records` (
  `zone_id` int(11) unsigned NOT NULL default '0',
  `type` enum('SOA','NS','MX','A','CNAME','TXT','HINFO','PTR') NOT NULL default 'SOA',
  `host` varchar(255) default NULL,
  `mx_priority` int(3) unsigned default NULL,
  `data` varchar(255) default NULL,
  KEY `zh` (`zone_id`,`host`)
) TYPE=MyISAM;

INSERT INTO `dns_records` VALUES (1, 'SOA', ' <at> ', NULL, 'ns1.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'NS', ' <at> ', NULL, 'ns1.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'NS', ' <at> ', NULL, 'ns2.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'MX', ' <at> ', 10, 'mx1.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'MX', ' <at> ', 20, 'mx2.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'A', ' <at> ', NULL, '213.41.42.160');
INSERT INTO `dns_records` VALUES (1, 'A', 'www', NULL, '213.41.42.160');
INSERT INTO `dns_records` VALUES (1, 'CNAME', 'test', NULL, 'www.phibee.info.');
==================================================================
 
and when i test with nslookup my server, we have :
 
[root <at> ns1 etc]# !nslo
nslookup - localhost
> www.phibee.info
Server:         localhost
Address:        127.0.0.1#53
 
Name:   www.phibee.info
Address: 213.41.42.160
>
 
immediatly i have this in /var/log/syslog
 
Jan  4 07:45:49 ns1 named[32320]: dns_rdata_fromtext: buffer-0x4056430c:1: near eol: unexpected end of input
Jan  4 07:45:49 ns1 named[32320]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
and when i want SOA information:
>set query=soa
> phibee.info
Jan  4 07:49:39 ns1 named[17010]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: dns_rdata_fromtext: buffer-0x4076426c:1: near eol: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: query.c:1746: fatal error:
Jan  4 07:49:39 ns1 named[17010]: RUNTIME_CHECK(result == 0) failed
Jan  4 07:49:39 ns1 named[17010]: exiting (due to fatal error in library)
and named crash .......
 
==================================================================
in named debug mode, this is information :
 
jan  4 07:56:11 ns1 named: Query String: select id from zone where zone = 'phibee.info'
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581 dns_rdata_fromtext: buffer-0x4056452c:1: near eol: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581 dns_sdlz_putrr returned error. Error code was: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581
jan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  '*'
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582
jan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  ' <at> '
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 dns_rdata_fromtext: buffer-0x4056426c:1: near eol: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 dns_sdlz_putrr returned error. Error code was: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582
jan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  '*'
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 query.c:1746: fatal error:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 RUNTIME_CHECK(result == 0) failed
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 exiting (due to fatal error in library)
jan  4 07:56:11 ns1 named: Démarrage de named failedjan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  ' <at> '

 
when i put into mysql client the request :
 
mysql> select id from zone where zone = 'phibee.info';
+----+
| id |
+----+
|  1 |
+----+
1 row in set (0.00 sec)
 
mysql>
 
mysql> select ttl, type, mx_priority, case when lower(type)='txt' then
    -> concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
    '> ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
    -> zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
    -> ' <at> '
    -> ;
+-------+------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ttl   | type | mx_priority | case when lower(type)='txt' then
concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
',data,resp_person,serial,refresh,retry,expire,minimum) else data end |
+-------+------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 86400 | SOA  |        NULL | ns1.phibee.net.
hostmaster
2004010301
86400
7200
604800
86400                                                                                                         |
| 86400 | NS   |        NULL | ns1.phibee.net.                                                                                                                                                       |
| 86400 | NS   |        NULL | ns2.phibee.net.                                                                                                                                                       |
| 86400 | MX   |          10 | mx1.phibee.net.                                                                                                                                                       |
| 86400 | MX   |          20 | mx2.phibee.net.                                                                                                                                                       |
| 86400 | A    |        NULL | 213.41.42.160                                                                                                                                                         |
+-------+------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)
 
mysql>
 
if you want more information, don't hesitate ;=)
 
thanks for your help
 
 
 
 
 
 
 
 
 
 

----- Original Message -----
From: Rob Butler
Sent: Sunday, January 04, 2004 12:06 AM
Subject: Re: [Bind-dlz-testers] no solutions ....

Jerome,
 
Send the DLZ section of your named.conf, a SMALL sample of the data in your database (it should include SOA, NS, and A records within the sample at least), and a BRIEF description of the DLZ related tables in your database.  I will take a look at them and try to find out what's wrong with your setup.  Without the above information I can't do anything to help you.
 
Later
Rob
----- Original Message -----
Sent: Thursday, January 01, 2004 2:02 AM
Subject: [Bind-dlz-testers] no solutions ....

Hi
 
Please help me ;=) i don't see the solution. DLZ on my server don't works ...
 
The error :
 
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076430c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076426c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: query.c:1746: fatal error:
Jan  1 08:57:50 ns1 named[31893]: RUNTIME_CHECK(result == 0) failed
Jan  1 08:57:50 ns1 named[31893]: exiting (due to fatal error in library)
I have deleted all of my database and my conf ... i use the configuration posted by teszter
2003-11-23 without success !
 
A error in compilation ?
 
bye
 
Rob Butler | 8 Jan 04:09 2004
Picon
Picon

Re: no solutions ....

Jerome,
 
Sorry for taking so long to get back to you.  I've been busy with the holidays / vacation, and then getting back to work things are always busy.
 
You have two problems.
 
Problem #1 you probably aren't even experiencing yet.  Your allow zone transfer query won't work right.  It should be something along the lines of
 
select id from zone_transfer_table where zone = '%zone%' and client = '%client%'
 
You need to search for a match to both %zone% and %client% so that the zone transfer will only be allowed if the zone and client are listed together in a single row.
 
Problem #2 - the more important "dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input" & crash error has me stumped for the moment.  Try doing a make clean, then re-doing your ./configure and then do a make, followed by make install.  See if that clears things up because it looks like your data is ok - or at least the segment you sent is.  Generally I can spot the data / configuration issue right off and once fixed DLZ works fine.  This has almost always been the case - there have been relatively few bugs and those do get squashed quickly.  A few more bugs will be squashed in the next release but the release that is out now is fairly stable.
 
If you can try DLZ on another machine..  Perhaps there is something odd on that particular machine causing a problem.  Let me know what you find and if I can be any more help in getting things to work for you.
 
Later
Rob
----- Original Message -----
Sent: Sunday, January 04, 2004 1:04 AM
Subject: Re: [Bind-dlz-testers] no solutions ....

Hi
 
Ok thanks.
 
i run on Bind 9.2.2-P3 on a Mandrake Linux 9.2 (Kernel 2.4.22 SMP Bi Xeon 2,67 Ghz) and
MySQL 4.0.17 (ns1.phibee.net).
 
My named.conf (DLZ Section):
 
==================================================================
//#######################################################################
//##  Configuration de la base de données DLZ                          ##
//#######################################################################
dlz "Mysql zone" {
  database "mysql
  {host=localhost user=bind pass=XXXXXXX dbname=Phibee ssl=false}
  {select id from zone where zone = '%zone%'}
  {select ttl, type, mx_priority, case when lower(type)='txt' then
  concat('\"', data, '\"') when lower(type)='soa' then CONCAT_WS('
  ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
  zone,dns_records where id=zone_id and zone = '%zone%' and host =
 '%record%'}
  {}
  {select ttl, type, host, mx_priority, case when lower(type)='txt' then
  concat('\"', data, '\"') when lower(type)='soa' then CONCAT_WS('
  ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
  zone,dns_records where id=zone_id and zone = '%zone%'}
  {select '%client%' from zone where zone = '%zone%'}
  {}";
};
==================================================================
My syslog when i start named:
 
Jan  4 07:50:33 ns1 named[17045]: starting BIND 9.2.2-P3 -u named
Jan  4 07:50:33 ns1 named[17045]: using 2 CPUs
Jan  4 07:50:33 ns1 named[17047]: loading configuration from '/etc/named.conf'
jan  4 07:50:33 ns1 named: Démarrage de named succeeded
Jan  4 07:50:33 ns1 named[17047]: no IPv6 interfaces found
Jan  4 07:50:33 ns1 named[17047]: listening on IPv4 interface lo, 127.0.0.1#53
Jan  4 07:50:33 ns1 named[17047]: listening on IPv4 interface eth0, 213.41.42.129#53
Jan  4 07:50:33 ns1 named[17047]: Loading 'Mysql zone' using driver mysql
Jan  4 07:50:33 ns1 named[17047]: command channel listening on 127.0.0.1#953
Jan  4 07:50:33 ns1 named[17047]: zone 0.0.127.in-addr.arpa/IN: loaded serial 2003122001
Jan  4 07:50:33 ns1 named[17047]: zone 26/128.42.41.213.in-addr.arpa/IN: loaded serial 2003122002
Jan  4 07:50:33 ns1 named[17047]: running
Jan  4 07:50:33 ns1 named[17047]: zone 26/128.42.41.213.in-addr.arpa/IN: sending notifies (serial 2003122002)
==================================================================
 
I use a example of data structure of DLZ Mailing List, two table into my database "Phibee".
The user are bind and the access are Ok.
 
Table zone:
CREATE TABLE `zone` (
  `id` int(11) unsigned NOT NULL auto_increment,
  `ttl` int(11) unsigned NOT NULL default '86400',
  `zone` varchar(50) NOT NULL default '',
  `resp_person` varchar(255) default 'hostmaster',
  `serial` int(11) unsigned NOT NULL default '0',
  `refresh` int(11) unsigned NOT NULL default '86400',
  `retry` int(11) unsigned NOT NULL default '7200',
  `expire` int(11) unsigned NOT NULL default '604800',
  `minimum` int(11) unsigned NOT NULL default '86400',
  PRIMARY KEY  (`id`),
  KEY `zona` (`zone`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;

INSERT INTO `zone` VALUES (1, 86400, 'phibee.info', 'hostmaster', 2004010301, 86400, 7200, 604800, 86400);
 
 
 
and the table dns_records with data for the zone "phibee.info":
 
CREATE TABLE `dns_records` (
  `zone_id` int(11) unsigned NOT NULL default '0',
  `type` enum('SOA','NS','MX','A','CNAME','TXT','HINFO','PTR') NOT NULL default 'SOA',
  `host` varchar(255) default NULL,
  `mx_priority` int(3) unsigned default NULL,
  `data` varchar(255) default NULL,
  KEY `zh` (`zone_id`,`host`)
) TYPE=MyISAM;

INSERT INTO `dns_records` VALUES (1, 'SOA', ' <at> ', NULL, 'ns1.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'NS', ' <at> ', NULL, 'ns1.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'NS', ' <at> ', NULL, 'ns2.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'MX', ' <at> ', 10, 'mx1.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'MX', ' <at> ', 20, 'mx2.phibee.net.');
INSERT INTO `dns_records` VALUES (1, 'A', ' <at> ', NULL, '213.41.42.160');
INSERT INTO `dns_records` VALUES (1, 'A', 'www', NULL, '213.41.42.160');
INSERT INTO `dns_records` VALUES (1, 'CNAME', 'test', NULL, 'www.phibee.info.');
==================================================================
 
and when i test with nslookup my server, we have :
 
[root <at> ns1 etc]# !nslo
nslookup - localhost
> www.phibee.info
Server:         localhost
Address:        127.0.0.1#53
 
Name:   www.phibee.info
Address: 213.41.42.160
>
 
immediatly i have this in /var/log/syslog
 
Jan  4 07:45:49 ns1 named[32320]: dns_rdata_fromtext: buffer-0x4056430c:1: near eol: unexpected end of input
Jan  4 07:45:49 ns1 named[32320]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
and when i want SOA information:
>set query=soa
> phibee.info
Jan  4 07:49:39 ns1 named[17010]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: dns_rdata_fromtext: buffer-0x4076426c:1: near eol: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  4 07:49:39 ns1 named[17010]: query.c:1746: fatal error:
Jan  4 07:49:39 ns1 named[17010]: RUNTIME_CHECK(result == 0) failed
Jan  4 07:49:39 ns1 named[17010]: exiting (due to fatal error in library)
and named crash .......
 
==================================================================
in named debug mode, this is information :
 
jan  4 07:56:11 ns1 named: Query String: select id from zone where zone = 'phibee.info'
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581 dns_rdata_fromtext: buffer-0x4056452c:1: near eol: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581 dns_sdlz_putrr returned error. Error code was: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.581
jan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  '*'
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582
jan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  ' <at> '
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 dns_rdata_fromtext: buffer-0x4056426c:1: near eol: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 dns_sdlz_putrr returned error. Error code was: unexpected end of input
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582
jan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  '*'
jan  4 07:56:11 ns1 named:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 query.c:1746: fatal error:
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 RUNTIME_CHECK(result == 0) failed
jan  4 07:56:11 ns1 named: Jan 04 07:56:11.582 exiting (due to fatal error in library)
jan  4 07:56:11 ns1 named: Démarrage de named failedjan  4 07:56:11 ns1 named: Query String: select ttl, type, mx_priority, case when lower(type)='txt' then
jan  4 07:56:11 ns1 named:   concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
jan  4 07:56:11 ns1 named:   ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
jan  4 07:56:11 ns1 named:   zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
jan  4 07:56:11 ns1 named:  ' <at> '

 
when i put into mysql client the request :
 
mysql> select id from zone where zone = 'phibee.info';
+----+
| id |
+----+
|  1 |
+----+
1 row in set (0.00 sec)
 
mysql>
 
mysql> select ttl, type, mx_priority, case when lower(type)='txt' then
    -> concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
    '> ',data,resp_person,serial,refresh,retry,expire,minimum) else data end from
    -> zone,dns_records where id=zone_id and zone = 'phibee.info' and host =
    -> ' <at> '
    -> ;
+-------+------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ttl   | type | mx_priority | case when lower(type)='txt' then
concat('"', data, '"') when lower(type)='soa' then CONCAT_WS('
',data,resp_person,serial,refresh,retry,expire,minimum) else data end |
+-------+------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 86400 | SOA  |        NULL | ns1.phibee.net.
hostmaster
2004010301
86400
7200
604800
86400                                                                                                         |
| 86400 | NS   |        NULL | ns1.phibee.net.                                                                                                                                                       |
| 86400 | NS   |        NULL | ns2.phibee.net.                                                                                                                                                       |
| 86400 | MX   |          10 | mx1.phibee.net.                                                                                                                                                       |
| 86400 | MX   |          20 | mx2.phibee.net.                                                                                                                                                       |
| 86400 | A    |        NULL | 213.41.42.160                                                                                                                                                         |
+-------+------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)
 
mysql>
 
if you want more information, don't hesitate ;=)
 
thanks for your help
 
 
 
 
 
 
 
 
 
 

----- Original Message -----
From: Rob Butler
Sent: Sunday, January 04, 2004 12:06 AM
Subject: Re: [Bind-dlz-testers] no solutions ....

Jerome,
 
Send the DLZ section of your named.conf, a SMALL sample of the data in your database (it should include SOA, NS, and A records within the sample at least), and a BRIEF description of the DLZ related tables in your database.  I will take a look at them and try to find out what's wrong with your setup.  Without the above information I can't do anything to help you.
 
Later
Rob
----- Original Message -----
Sent: Thursday, January 01, 2004 2:02 AM
Subject: [Bind-dlz-testers] no solutions ....

Hi
 
Please help me ;=) i don't see the solution. DLZ on my server don't works ...
 
The error :
 
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076430c:1: near eol: unexpected end of input
Jan  1 08:48:17 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076452c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_rdata_fromtext: buffer-0x4076426c:1: near eol: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: dns_sdlz_putrr returned error. Error code was: unexpected end of input
Jan  1 08:57:50 ns1 named[31893]: query.c:1746: fatal error:
Jan  1 08:57:50 ns1 named[31893]: RUNTIME_CHECK(result == 0) failed
Jan  1 08:57:50 ns1 named[31893]: exiting (due to fatal error in library)
I have deleted all of my database and my conf ... i use the configuration posted by teszter
2003-11-23 without success !
 
A error in compilation ?
 
bye
 
jwrascoe | 8 Jan 12:57 2004

ODBC Driver- Truly Multi Threaded?

Hello,

First of all I want to say it has been a pleasure working with this code. 

However I have a question about its ability to truly multi-thread
requests...

Platform - NT
Database - SQL Server via the ODBC Interface

I am testing the system for high volume queries and find that it is
necessary to use the -n option (number of cpu's) in bind startup to keep up
with the number of inbound requests.  I have tested on 1 and 2 cpu Machines

But I am still having time-out problems when answering high volume
requests...

I saw this note in dlz_odbc_init....

		/* Driver is always threadsafe.  When multithreaded all
functions use
		 * multithreaded code.  When not multithreaded, all
functions can only
		 * be entered once, but only 1 thread of operation is
available in Bind.
		 * So everything is still threadsafe.
		 */

This part of the comment "but only 1 thread of operation is available in
Bind.  So everything is still threadsafe." does it truly mean that all
requests are handled 1 at a time?

I know this... when I am in a high volume situation... I can ALWAYS get a
answer back from bind when I go in thru another IP address... let me
explain...

lets say I have High volume requests coming in on 216.204.xxx.xxx (A NIC
card on the internet) when I fire enough DNS requests to this IP I start
getting timeouts...

However.. I have another NIC card in the machine at 192.168.xxx.xxx and I
can get it to answer queries all day as well as on the local interface
127.0.0.1 on the machine itself because bind is watching thoes interfaces
too so... I know the database can handle the requests...

How can I control the number of connections that the NIC interface and the
Database can handle concurrently?

Thanks,

Jim

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Rob Butler | 8 Jan 15:59 2004
Picon
Picon

Re: ODBC Driver- Truly Multi Threaded?

> 
> Hello,
> 
> First of all I want to say it has been a pleasure working with this code.

Thanks!

> 
> However I have a question about its ability to truly multi-thread
> requests...

All the drivers with the exception of the MySQL driver are fully multi-thread capable & tested.  

> 
> Platform - NT
> Database - SQL Server via the ODBC Interface

Is the database on the same machine as DLZ, or is it running on a separate box?

> 
> I am testing the system for high volume queries and find that it is
> necessary to use the -n option (number of cpu's) in bind startup to keep up
> with the number of inbound requests.  

The -n option controls how many threads bind uses.  On Windows Bind is always built to support mult-threaded
operation.  Bind will by default use 1 thread per cpu in the system.  So if you have a single CPU Bind will
normally start 1 thread.  Two CPU's Bind will normally start 2 threads.  However, if you have a
hyperthreading CPU and have hyperthreading on Bind will start a thread for each "virtual" cpu.  I.E. with
hyperthreading enabled NT will see a single CPU as 2 cpu's.  Thus in this situation Bind will start 2 threads
on NT (one for each "virtual" CPU).

Now, increasing the -n option can potentially improve your performance because the threads within DLZ are
most likely I/O bound with accesses to your database.  More threads are thus able to be "active" while the
other threads are waiting for I/O to complete.

> But I am still having time-out problems when answering high volume
> requests...

DLZ is fairly efficient.  I guarantee that the largest impact to your performance is your database / sql
queries.  Obviously DLZ will never be able to perform faster than your SQL server can perform.  One option
you can try to provide even better performance is to use stored procedures.  DLZ does not take advantage of
any "prepared query" capability in ODBC, so the SQL server must parse a new query and create a new execution
plan each time.  If you use a stored procedure the database should be able to store or cache the execution
plan and provide better throughput.

Also of critical importance is indexing.  You should of course create an index on the columns used for zone
lookups, and also for host lookups.  Joins on those two columns (needed in the lookup function) can be
expensive.  If your database supports creating multi-column indexes be sure to create on for the zone &
host column together this should provide a very big speed increase.  Some databases allow a multi-column
index to be used when only one column is being searched (the findzone lookup) if you create the index
properly.  i.e. if I create an index of zone & host this index can be used when searching on the zone, or when
searching on the zone & host.  But cannot be used when searching on the host only.  Similarly, if I create an
index of host & zone (reversed order) I could use the index when searching on host, or host & zone, but not
when searching on zone only.  So by carefully cre
 ating your indexes, and creating multi-column indexes in the proper order (zone, host) you can obtain
major speed benefits, as well as not waste disk space by having too many indexes or creating indexes in a
wasteful manner.

> I saw this note in dlz_odbc_init....
> 
> 		/* Driver is always threadsafe.  When multithreaded all
> functions use
> 		 * multithreaded code.  When not multithreaded, all
> functions can only
> 		 * be entered once, but only 1 thread of operation is
> available in Bind.
> 		 * So everything is still threadsafe.
> 		 */
> 
> This part of the comment "but only 1 thread of operation is available in
> Bind.  So everything is still threadsafe." does it truly mean that all
> requests are handled 1 at a time?

Yes - re-read the statement carefully.  If bind is built multi-threaded, then the multi-threaded code is
included in the build.  Thus DLZ's drivers can handle multiple threads.  If however bind is built to only
support single threaded operation (an option only available on UN*X like systems - Bind on NT is always
built multi-threaded) then the code needed to support multi-threaded operation is not included.  This
removes the additional overhead of managing the DB connection pool, etc. when it's not needed because of
single threaded build.  Now, if you do infact build bind single threaded it doesn't matter what you pass as a
-n option you can't get more than a single thread running....  So the DLZ code is still "thread safe" because
there is only 1 thread and no posibility for two threads to ever try and use the methods simultaneously.

> 
> I know this... when I am in a high volume situation... I can ALWAYS get a
> answer back from bind when I go in thru another IP address... let me
> explain...
> 
> lets say I have High volume requests coming in on 216.204.xxx.xxx (A NIC
> card on the internet) when I fire enough DNS requests to this IP I start
> getting timeouts...
> 
> However.. I have another NIC card in the machine at 192.168.xxx.xxx and I
> can get it to answer queries all day as well as on the local interface
> 127.0.0.1 on the machine itself because bind is watching thoes interfaces
> too so... 

Sounds like you have a problem or traffic on your network segments, or the network card, or the software
tcp/ip stack / driver for that network card.  Bind / DLZ will answer as fast as it can to any / all queries and
should provide the same performance without regard to which interface you query it over.  If you are seeing
different results on different network cards / ip addresses then there is something else causing this
difference.  If your other network segment has a high volume of traffic this will definetly impact
performance.  Also different network cards / drivers have very different performance results.  Several
cheap network cards (the kind you pick up for 10-50 dollars at the local computer store) don't do a lot of
work on the network card itself.  They do a great deal of their work in the driver software (which uses your
computers CPU).  More expensive network cards do their 
 work on dedicated cpu's on the card itself.  There drivers use less of your computers CPU time and thus
provide higher performance.  There are several factors (of which I have listed only some) that can effect
the performance of your network.  I really doubt Bind / DLZ is causing the performance difference on the
different network cards.

I know the database can handle the requests...

Are you sure?  Be absolutely sure you allocate a database connection for each and every thread that you start
in DLZ or your results will be bad.

If DLZ has more threads running than database connections then you will APPEAR to get very high performance
from DLZ, but your not getting what you really think you are.  When DLZ has more threads than database
connections, the thread will try to get a database connection a few times.  If it can't get one after 3
attempts it gives up and fails the DNS request.  So if you have 3 threads, but only 2 database connections all
of a sudden DLZ will seem to perform very fast, but almost all of your DNS query responses will be failure
messages.  However, you did sucessfully receive a response - just not one you wanted.  So always check that
the DNS response was a success response, and not a failure one.

There is a tool (only compilable on UN*X systems) called queryperf that can be found in the
contrib/queryperf directory of Bind.  Once built you can run it on a UN*X system but query an NT system to
test DNS server performance.  All versions up to and including bind-9.2.2 do not include any means of
seeing what the returned DNS status codes were.  The version of Queryperf included in Bind-9.2.3 includes
a new command line option that will output the dns response code percentages.  DLZ is still only at 9.2.2,
but there is nothing preventing you from downloading 9.2.3 and building / using the query perf tool from
it.  

> How can I control the number of connections that the NIC interface and the
> Database can handle concurrently?

You can only "control" it by reducing the number of threads / database connections.  If you are attempting to
get more performance you need to tune everything you can.  This means tuning DLZ's settings to provide the
optimum number of threads / database connections.  Tuning your SQL queries / stored procedures & indexes
to execute as quickly as possible.  Tweaking any of the settings in your database software to provide the
best performance.  Memory cache size is probably the most important one to get right.  Too big, and your
system will start disk thrashing because it is using virtual memory.  Too little and your system will disk
thrash because it has a low cache hit rate.  Anytime you need to go to disk performance suffers.

Hope this helps out.

Later
Rob

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
jwrascoe | 8 Jan 17:14 2004

RE: ODBC Driver- Truly Multi Threaded?

Rob,

Your you have a fantastic understanding of my situation....Thankyou for the
response....

Ok.. Let me give you more info... to help understand where the bottle neck
is...

>> Is the database on the same machine as DLZ, or is it running on a
separate box?
Separate box - Quad Xeon Windows/2000

>> Also of critical importance is indexing. 
Yes, I agree... Infact because of the overhead of dynamic SQL... I put
stored procedures in place for each call rather thatn SQL Statements... It
is way faster...  I am good in this department and know the importance... I
know the box when under load still has plendy of power to reply to the
requests... I have monitors that watch for this bottleneck.

>> Yes - re-read the statement carefully.
OK, Thanks for the clarification...

>> Sounds like you have a problem or traffic on your network segments
Yes, I am sending a very large number of requests... I can handle more when
I increase the -n option higher than the number of CPU's actually in the
machine...

I can also MASK the problem and have NO timeouts by putting 5 machines
behind a load balancer and letting multiple machines handle the requests...
So this is another reason why I know that I have not overloaded the DB..
(besides the other test of querying on the local interface of the machine
while it is under load)

** Is there a way in BIND to monitor if I pending packets that the task
manager cant respond to?

>> Be absolutely sure you allocate a database connection for each and every
thread
I have done so - I use the option in the named.conf section... and verified
via a debugger that it actually allocates the statement handles.

>> When DLZ has more threads than database connections, the thread will try
to get a database connection a few times.
Yes I have seen the message when they are not in line that loggs... actually
I think it trys 30 times...

>> Memory cache size is probably the most important one to get right.
Are you refering to a BIND option? Or is this a comment for the database
server?

Bottom line is that I am fairly sure that I am overwhelming Binds Ability to
handle IP requests and being able to even send them to the DLZ Driver...
Your driver seems to be rock solid... it just isnt getting called. again
more info for you...

When under load (that is bind not answering / giving timeouts )
- I can use OTHER ports on the same IP - Like VNC into the box (so I know
the network card is not flooded)
- I can also send requests OUT of the same IP to do things like view web
pages... ftp into another server, etc...
This leads me to believe that the NIC card can handle the load... I just
cant see to figure out how to get bind submit the requests..

I have even tried setting -n 20 / 30/ 40 etc... but it just seems to cause
more overhead in bind itself..

Do you know if a way to have bind log how many client requests are in
progress/pending/unable to answer?

Thanks again for all the help.

Jim

-----Original Message-----
From: Rob Butler [mailto:robert.butler5 <at> verizon.net]
Sent: Thursday, January 08, 2004 10:00 AM
To: bind-dlz-testers <at> lists.sourceforge.net
Subject: Re: [Bind-dlz-testers] ODBC Driver- Truly Multi Threaded?

> 
> Hello,
> 
> First of all I want to say it has been a pleasure working with this code.

Thanks!

> 
> However I have a question about its ability to truly multi-thread
> requests...

All the drivers with the exception of the MySQL driver are fully
multi-thread capable & tested.  

> 
> Platform - NT
> Database - SQL Server via the ODBC Interface

Is the database on the same machine as DLZ, or is it running on a separate
box?

> 
> I am testing the system for high volume queries and find that it is
> necessary to use the -n option (number of cpu's) in bind startup to keep
up
> with the number of inbound requests.  

The -n option controls how many threads bind uses.  On Windows Bind is
always built to support mult-threaded operation.  Bind will by default use 1
thread per cpu in the system.  So if you have a single CPU Bind will
normally start 1 thread.  Two CPU's Bind will normally start 2 threads.
However, if you have a hyperthreading CPU and have hyperthreading on Bind
will start a thread for each "virtual" cpu.  I.E. with hyperthreading
enabled NT will see a single CPU as 2 cpu's.  Thus in this situation Bind
will start 2 threads on NT (one for each "virtual" CPU).

Now, increasing the -n option can potentially improve your performance
because the threads within DLZ are most likely I/O bound with accesses to
your database.  More threads are thus able to be "active" while the other
threads are waiting for I/O to complete.

> But I am still having time-out problems when answering high volume
> requests...

DLZ is fairly efficient.  I guarantee that the largest impact to your
performance is your database / sql queries.  Obviously DLZ will never be
able to perform faster than your SQL server can perform.  One option you can
try to provide even better performance is to use stored procedures.  DLZ
does not take advantage of any "prepared query" capability in ODBC, so the
SQL server must parse a new query and create a new execution plan each time.
If you use a stored procedure the database should be able to store or cache
the execution plan and provide better throughput.

Also of critical importance is indexing.  You should of course create an
index on the columns used for zone lookups, and also for host lookups.
Joins on those two columns (needed in the lookup function) can be expensive.
If your database supports creating multi-column indexes be sure to create on
for the zone & host column together this should provide a very big speed
increase.  Some databases allow a multi-column index to be used when only
one column is being searched (the findzone lookup) if you create the index
properly.  i.e. if I create an index of zone & host this index can be used
when searching on the zone, or when searching on the zone & host.  But
cannot be used when searching on the host only.  Similarly, if I create an
index of host & zone (reversed order) I could use the index when searching
on host, or host & zone, but not when searching on zone only.  So by
carefully creating your indexes, and creating multi-column indexes in the
proper order (zone, host) you can obtain major speed benefits, as well as
not waste disk space by having too many indexes or creating indexes in a
wasteful manner.

> I saw this note in dlz_odbc_init....
> 
> 		/* Driver is always threadsafe.  When multithreaded all
> functions use
> 		 * multithreaded code.  When not multithreaded, all
> functions can only
> 		 * be entered once, but only 1 thread of operation is
> available in Bind.
> 		 * So everything is still threadsafe.
> 		 */
> 
> This part of the comment "but only 1 thread of operation is available in
> Bind.  So everything is still threadsafe." does it truly mean that all
> requests are handled 1 at a time?

Yes - re-read the statement carefully.  If bind is built multi-threaded,
then the multi-threaded code is included in the build.  Thus DLZ's drivers
can handle multiple threads.  If however bind is built to only support
single threaded operation (an option only available on UN*X like systems -
Bind on NT is always built multi-threaded) then the code needed to support
multi-threaded operation is not included.  This removes the additional
overhead of managing the DB connection pool, etc. when it's not needed
because of single threaded build.  Now, if you do infact build bind single
threaded it doesn't matter what you pass as a -n option you can't get more
than a single thread running....  So the DLZ code is still "thread safe"
because there is only 1 thread and no posibility for two threads to ever try
and use the methods simultaneously.

> 
> I know this... when I am in a high volume situation... I can ALWAYS get a
> answer back from bind when I go in thru another IP address... let me
> explain...
> 
> lets say I have High volume requests coming in on 216.204.xxx.xxx (A NIC
> card on the internet) when I fire enough DNS requests to this IP I start
> getting timeouts...
> 
> However.. I have another NIC card in the machine at 192.168.xxx.xxx and I
> can get it to answer queries all day as well as on the local interface
> 127.0.0.1 on the machine itself because bind is watching thoes interfaces
> too so... 

Sounds like you have a problem or traffic on your network segments, or the
network card, or the software tcp/ip stack / driver for that network card.
Bind / DLZ will answer as fast as it can to any / all queries and should
provide the same performance without regard to which interface you query it
over.  If you are seeing different results on different network cards / ip
addresses then there is something else causing this difference.  If your
other network segment has a high volume of traffic this will definetly
impact performance.  Also different network cards / drivers have very
different performance results.  Several cheap network cards (the kind you
pick up for 10-50 dollars at the local computer store) don't do a lot of
work on the network card itself.  They do a great deal of their work in the
driver software (which uses your computers CPU).  More expensive network
cards do their work on dedicated cpu's on the card itself.  There drivers
use less of your computers CPU time and thus provide higher performance.
There are several factors (of which I have listed only some) that can effect
the performance of your network.  I really doubt Bind / DLZ is causing the
performance difference on the different network cards.

I know the database can handle the requests...

Are you sure?  Be absolutely sure you allocate a database connection for
each and every thread that you start in DLZ or your results will be bad.

If DLZ has more threads running than database connections then you will
APPEAR to get very high performance from DLZ, but your not getting what you
really think you are.  When DLZ has more threads than database connections,
the thread will try to get a database connection a few times.  If it can't
get one after 3 attempts it gives up and fails the DNS request.  So if you
have 3 threads, but only 2 database connections all of a sudden DLZ will
seem to perform very fast, but almost all of your DNS query responses will
be failure messages.  However, you did sucessfully receive a response - just
not one you wanted.  So always check that the DNS response was a success
response, and not a failure one.

There is a tool (only compilable on UN*X systems) called queryperf that can
be found in the contrib/queryperf directory of Bind.  Once built you can run
it on a UN*X system but query an NT system to test DNS server performance.
All versions up to and including bind-9.2.2 do not include any means of
seeing what the returned DNS status codes were.  The version of Queryperf
included in Bind-9.2.3 includes a new command line option that will output
the dns response code percentages.  DLZ is still only at 9.2.2, but there is
nothing preventing you from downloading 9.2.3 and building / using the query
perf tool from it.  

> How can I control the number of connections that the NIC interface and the
> Database can handle concurrently?

You can only "control" it by reducing the number of threads / database
connections.  If you are attempting to get more performance you need to tune
everything you can.  This means tuning DLZ's settings to provide the optimum
number of threads / database connections.  Tuning your SQL queries / stored
procedures & indexes to execute as quickly as possible.  Tweaking any of the
settings in your database software to provide the best performance.  Memory
cache size is probably the most important one to get right.  Too big, and
your system will start disk thrashing because it is using virtual memory.
Too little and your system will disk thrash because it has a low cache hit
rate.  Anytime you need to go to disk performance suffers.

Hope this helps out.

Later
Rob

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Bind-dlz-testers mailing list
Bind-dlz-testers <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
jwrascoe | 8 Jan 17:16 2004

RE: ODBC Driver- Truly Multi Threaded?

Rob...

Sorry... I missed this in your last post...

Queryperf included in Bind-9.2.3 includes a new command line option that
will output the dns response code percentages.  DLZ is still only at 9.2.2,
but there is nothing preventing you from downloading 9.2.3 and building /
using the query perf tool from it.  

So I can use this to query BIND while it is running? and get stats?

I will test/try...

Jim

-----Original Message-----
From: Rob Butler [mailto:robert.butler5 <at> verizon.net]
Sent: Thursday, January 08, 2004 10:00 AM
To: bind-dlz-testers <at> lists.sourceforge.net
Subject: Re: [Bind-dlz-testers] ODBC Driver- Truly Multi Threaded?

> 
> Hello,
> 
> First of all I want to say it has been a pleasure working with this code.

Thanks!

> 
> However I have a question about its ability to truly multi-thread
> requests...

All the drivers with the exception of the MySQL driver are fully
multi-thread capable & tested.  

> 
> Platform - NT
> Database - SQL Server via the ODBC Interface

Is the database on the same machine as DLZ, or is it running on a separate
box?

> 
> I am testing the system for high volume queries and find that it is
> necessary to use the -n option (number of cpu's) in bind startup to keep
up
> with the number of inbound requests.  

The -n option controls how many threads bind uses.  On Windows Bind is
always built to support mult-threaded operation.  Bind will by default use 1
thread per cpu in the system.  So if you have a single CPU Bind will
normally start 1 thread.  Two CPU's Bind will normally start 2 threads.
However, if you have a hyperthreading CPU and have hyperthreading on Bind
will start a thread for each "virtual" cpu.  I.E. with hyperthreading
enabled NT will see a single CPU as 2 cpu's.  Thus in this situation Bind
will start 2 threads on NT (one for each "virtual" CPU).

Now, increasing the -n option can potentially improve your performance
because the threads within DLZ are most likely I/O bound with accesses to
your database.  More threads are thus able to be "active" while the other
threads are waiting for I/O to complete.

> But I am still having time-out problems when answering high volume
> requests...

DLZ is fairly efficient.  I guarantee that the largest impact to your
performance is your database / sql queries.  Obviously DLZ will never be
able to perform faster than your SQL server can perform.  One option you can
try to provide even better performance is to use stored procedures.  DLZ
does not take advantage of any "prepared query" capability in ODBC, so the
SQL server must parse a new query and create a new execution plan each time.
If you use a stored procedure the database should be able to store or cache
the execution plan and provide better throughput.

Also of critical importance is indexing.  You should of course create an
index on the columns used for zone lookups, and also for host lookups.
Joins on those two columns (needed in the lookup function) can be expensive.
If your database supports creating multi-column indexes be sure to create on
for the zone & host column together this should provide a very big speed
increase.  Some databases allow a multi-column index to be used when only
one column is being searched (the findzone lookup) if you create the index
properly.  i.e. if I create an index of zone & host this index can be used
when searching on the zone, or when searching on the zone & host.  But
cannot be used when searching on the host only.  Similarly, if I create an
index of host & zone (reversed order) I could use the index when searching
on host, or host & zone, but not when searching on zone only.  So by
carefully creating your indexes, and creating multi-column indexes in the
proper order (zone, host) you can obtain major speed benefits, as well as
not waste disk space by having too many indexes or creating indexes in a
wasteful manner.

> I saw this note in dlz_odbc_init....
> 
> 		/* Driver is always threadsafe.  When multithreaded all
> functions use
> 		 * multithreaded code.  When not multithreaded, all
> functions can only
> 		 * be entered once, but only 1 thread of operation is
> available in Bind.
> 		 * So everything is still threadsafe.
> 		 */
> 
> This part of the comment "but only 1 thread of operation is available in
> Bind.  So everything is still threadsafe." does it truly mean that all
> requests are handled 1 at a time?

Yes - re-read the statement carefully.  If bind is built multi-threaded,
then the multi-threaded code is included in the build.  Thus DLZ's drivers
can handle multiple threads.  If however bind is built to only support
single threaded operation (an option only available on UN*X like systems -
Bind on NT is always built multi-threaded) then the code needed to support
multi-threaded operation is not included.  This removes the additional
overhead of managing the DB connection pool, etc. when it's not needed
because of single threaded build.  Now, if you do infact build bind single
threaded it doesn't matter what you pass as a -n option you can't get more
than a single thread running....  So the DLZ code is still "thread safe"
because there is only 1 thread and no posibility for two threads to ever try
and use the methods simultaneously.

> 
> I know this... when I am in a high volume situation... I can ALWAYS get a
> answer back from bind when I go in thru another IP address... let me
> explain...
> 
> lets say I have High volume requests coming in on 216.204.xxx.xxx (A NIC
> card on the internet) when I fire enough DNS requests to this IP I start
> getting timeouts...
> 
> However.. I have another NIC card in the machine at 192.168.xxx.xxx and I
> can get it to answer queries all day as well as on the local interface
> 127.0.0.1 on the machine itself because bind is watching thoes interfaces
> too so... 

Sounds like you have a problem or traffic on your network segments, or the
network card, or the software tcp/ip stack / driver for that network card.
Bind / DLZ will answer as fast as it can to any / all queries and should
provide the same performance without regard to which interface you query it
over.  If you are seeing different results on different network cards / ip
addresses then there is something else causing this difference.  If your
other network segment has a high volume of traffic this will definetly
impact performance.  Also different network cards / drivers have very
different performance results.  Several cheap network cards (the kind you
pick up for 10-50 dollars at the local computer store) don't do a lot of
work on the network card itself.  They do a great deal of their work in the
driver software (which uses your computers CPU).  More expensive network
cards do their work on dedicated cpu's on the card itself.  There drivers
use less of your computers CPU time and thus provide higher performance.
There are several factors (of which I have listed only some) that can effect
the performance of your network.  I really doubt Bind / DLZ is causing the
performance difference on the different network cards.

I know the database can handle the requests...

Are you sure?  Be absolutely sure you allocate a database connection for
each and every thread that you start in DLZ or your results will be bad.

If DLZ has more threads running than database connections then you will
APPEAR to get very high performance from DLZ, but your not getting what you
really think you are.  When DLZ has more threads than database connections,
the thread will try to get a database connection a few times.  If it can't
get one after 3 attempts it gives up and fails the DNS request.  So if you
have 3 threads, but only 2 database connections all of a sudden DLZ will
seem to perform very fast, but almost all of your DNS query responses will
be failure messages.  However, you did sucessfully receive a response - just
not one you wanted.  So always check that the DNS response was a success
response, and not a failure one.

There is a tool (only compilable on UN*X systems) called queryperf that can
be found in the contrib/queryperf directory of Bind.  Once built you can run
it on a UN*X system but query an NT system to test DNS server performance.
All versions up to and including bind-9.2.2 do not include any means of
seeing what the returned DNS status codes were.  The version of Queryperf
included in Bind-9.2.3 includes a new command line option that will output
the dns response code percentages.  DLZ is still only at 9.2.2, but there is
nothing preventing you from downloading 9.2.3 and building / using the query
perf tool from it.  

> How can I control the number of connections that the NIC interface and the
> Database can handle concurrently?

You can only "control" it by reducing the number of threads / database
connections.  If you are attempting to get more performance you need to tune
everything you can.  This means tuning DLZ's settings to provide the optimum
number of threads / database connections.  Tuning your SQL queries / stored
procedures & indexes to execute as quickly as possible.  Tweaking any of the
settings in your database software to provide the best performance.  Memory
cache size is probably the most important one to get right.  Too big, and
your system will start disk thrashing because it is using virtual memory.
Too little and your system will disk thrash because it has a low cache hit
rate.  Anytime you need to go to disk performance suffers.

Hope this helps out.

Later
Rob

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Bind-dlz-testers mailing list
Bind-dlz-testers <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Rob Butler | 8 Jan 19:24 2004
Picon
Picon

RE: ODBC Driver- Truly Multi Threaded?


> Rob...
> 
> Sorry... I missed this in your last post...
> 
> Queryperf included in Bind-9.2.3 includes a new command line option that
> will output the dns response code percentages.  DLZ is still only at 9.2.2,
> but there is nothing preventing you from downloading 9.2.3 and building /
> using the query perf tool from it.  
> 
> So I can use this to query BIND while it is running? and get stats?
> 
> I will test/try...

Yes, but you can only compile / run it from a UN*X box (linux, freebsd, etc).  Make sure you use the "-c" option
to count response codes.  

Later
Rob

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Rob Butler | 8 Jan 19:19 2004
Picon
Picon

RE: ODBC Driver- Truly Multi Threaded?


> Rob,
> 
> Your you have a fantastic understanding of my situation....Thankyou for the
> response....

;) - Compliments always welcome.  Send complaints to /dev/null.  (Or recycle bin on windows) hehe.

> >> Is the database on the same machine as DLZ, or is it running on a
> separate box?
> Separate box - Quad Xeon Windows/2000

What network card/segment are you using to communicate with the database?  Is it the one you are seeing the
lower performance on?  If so that is to be expected.  You should have a separate dedicated connection
between your DLZ servers and your database server(s) if you have them on separate boxes.

> I am good in this department and know the importance... I
> know the box when under load still has plendy of power to reply to the
> requests... I have monitors that watch for this bottleneck.
> ...
> I can also MASK the problem and have NO timeouts by putting 5 machines
> behind a load balancer and letting multiple machines handle the requests...
> So this is another reason why I know that I have not overloaded the DB..

Have you checked the response codes on the DNS replies to verify you are getting a success response, and not
an error response?  Just want to make sure.

> ** Is there a way in BIND to monitor if I pending packets that the task
> manager cant respond to?

No I don't think so, I think the problem is not internal to Bind, but is at the OS / driver network code /
hardware level.  So even if there was a way to monitor it, you wouldn't have any useful results.  I know you can
use the NT performance monitor to check network stats.  Try watching the UDP stats on your DLZ box they may
provide some useful info.

> I have done so - I use the option in the named.conf section... and verified
> via a debugger that it actually allocates the statement handles.

When running in the debugger you will always get a connection because the operation of the software is
slowed by the debugger and user verification.  It is only when running at speed that you have the potential
for connection starvation.  If you have the number of threads set equal to the number of database
connections then connection starvation cannot happen.  As long as you are not getting any messages in the
logs about it you are ok too.

> >> Memory cache size is probably the most important one to get right.
> Are you refering to a BIND option? Or is this a comment for the database
> server?

Yes I was talking about the database server.

> 
> Bottom line is that I am fairly sure that I am overwhelming Binds Ability to
> handle IP requests and being able to even send them to the DLZ Driver...
> Your driver seems to be rock solid... it just isnt getting called. again
> more info for you...

What I suspect is happening is that the network is dropping UDP requests on the network itself, or at the
network card.  This is not necessarily a "bad" thing.  First of all UDP is unreliable so on a busy network udp
packets can get dropped.  But also - and this is what I suspect is the problem - the socket buffers will drop
packets when they are full with too many pending requests.  Each socket has its own buffer (software socket
- not network card).  So if you are receiving many requests on a particular socket it is conceivable that you
still have available bandwidth on the network segment / network card, but the network card cannot accept
and queue the packet because the network card / driver / ip stack / socket cache for that particular network
service is full and must wait for more space to be made.

If your CPU & DLZ have more working time available and are thus sitting idle for some period of time (milli /
nano second durations) but DLZ is not receiving more requests AND your network card is dropping packets
because of full caches this would seem to point to an in-efficient network card firmware / driver.  This is
more likely to happen with cheaper cards...  But seeing as you have a quad xeon you are probably not using
cheap network cards.

If you are experiencing a problem of lower performance on one card compared to other cards in that system
then it is definetly the network card hardware / driver.  If you are able to obtain more throughput by
sending requests to multiple cards in the same system then I would have to suspect that the "bottle neck" is
the network cards themselves or the network segments.  If they are all on the same network segment then the
bottleneck has to be the cards. While generally not considered a potential "bottle neck" point it is
possible that your network segment & cpu / server software are able to perform more work than your network
card can handle.  Especially with many many small packets like UDP DNS queries.

> 
> Do you know if a way to have bind log how many client requests are in
> progress/pending/unable to answer?

Nope.  See paragraph above regarding "Is there a way in BIND to monitor if I pending packets ".

Hope this helps some more.

Just for my own curiosity what are the configs of the boxes you are running DLZ on, and how many Queries Per
Second (QPS) are you getting from each them?  Also how many QPS is your database server capable of handling?

Later
Rob

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

Gmane