<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8521094831945337729</id><updated>2012-02-27T20:31:48.980-08:00</updated><category term='Proposals'/><category term='Thoughts'/><category term='Technical'/><category term='Final Files'/><category term='General'/><title type='text'>Jia Jun Goes GSoC</title><subtitle type='html'>His Google Summer of Code 2009 experience…</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default?start-index=26&amp;max-results=25'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-1644844591077636739</id><published>2009-08-20T14:35:00.002-07:00</published><updated>2012-01-14T09:20:04.015-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>geodns-new.pl</title><content type='html'>modified the geodns.pl from the original setup. Most of the file is still largely the same as the original. Added in some functions to support the new views management functions and modified the old ones to support weight configuration.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mYTQ2MTQ5OTAtM2YzMy00OTM0LThlOTItODExZTA1NGVkNTlh" target="_blank"&gt;geodns-new.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;30/10/2009: Updated the file link, no change in content though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-1644844591077636739?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/1644844591077636739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/geodns-newpl_6670.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1644844591077636739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1644844591077636739'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/geodns-newpl_6670.html' title='geodns-new.pl'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-8710246240400784471</id><published>2009-08-18T17:38:00.002-07:00</published><updated>2012-01-14T09:20:49.400-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>web UI</title><content type='html'>Finally publishing the web UI.&lt;br /&gt;This is a PHP script, hence, PHP need to be installed on the server. PHP 5 to be exact&lt;br /&gt;The database configuration can be done by modifying the variables in sql.php&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMDQyNjQ2ZGEtY2E5YS00NmExLWJhMjAtMzI0MWNhZGI4OGY4" target="_blank"&gt;Web UI&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-8710246240400784471?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/8710246240400784471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/web-ui_5283.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/8710246240400784471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/8710246240400784471'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/web-ui_5283.html' title='web UI'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-7195183550601619263</id><published>2009-08-11T23:15:00.002-07:00</published><updated>2012-01-14T09:21:11.364-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>Configuration Download Script</title><content type='html'>to automate the comparison and download process of the generated configuration file (from WebUI), the following shell script could be used.&lt;br /&gt;simply replace the following to use the script.&lt;br /&gt;filePath="/var/named/downloaded.views"; #change the filepath to the destination file desired.&lt;br /&gt;replace all http://12.7.0.0.1 with the location where the webUI is hosted.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNzNjNmNkOGItYzU5MS00N2ZhLTgyYzItNDE0MWNlZGQxM2Ni" target="_blank"&gt;getConfig.sh&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-7195183550601619263?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/7195183550601619263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/configuration-download-script_2409.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7195183550601619263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7195183550601619263'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/configuration-download-script_2409.html' title='Configuration Download Script'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-9204468437748136242</id><published>2009-08-11T22:57:00.002-07:00</published><updated>2012-01-14T09:33:58.523-08:00</updated><title type='text'>testing tool</title><content type='html'>custom created a testing tool that performs simple load testing on the DNS server.&lt;br /&gt;The main feature of the tool allows the results to be saved into the database table (schema provided below) and then displaying the statistics of each result at the end of the test. This allows easy verification of the weights configured on the records.&lt;br /&gt;sample output:&lt;br /&gt;&lt;blockquote&gt;Retriving results for test: 4      &lt;br /&gt;Number of results:100000       &lt;br /&gt;Formatting output...       &lt;br /&gt;Query: releases.geo.mozilla.com       &lt;br /&gt;Test started on: 2009-08-05 20:41:41       &lt;br /&gt;155.98.64.83&amp;nbsp;&amp;nbsp;&amp;nbsp; 17699(17.70%)       &lt;br /&gt;149.20.20.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 17613(17.61%)       &lt;br /&gt;129.101.198.59&amp;nbsp; 13460(13.46%)       &lt;br /&gt;128.61.111.9&amp;nbsp;&amp;nbsp;&amp;nbsp; 13320(13.32%)       &lt;br /&gt;204.152.184.113 6751(6.75%)       &lt;br /&gt;202.177.202.154 6693(6.69%)       &lt;br /&gt;131.188.12.212&amp;nbsp; 6564(6.56%)       &lt;br /&gt;156.56.247.196&amp;nbsp; 4437(4.44%)       &lt;br /&gt;64.50.236.214&amp;nbsp;&amp;nbsp; 2365(2.37%)       &lt;br /&gt;64.50.238.52&amp;nbsp;&amp;nbsp;&amp;nbsp; 2268(2.27%)       &lt;br /&gt;64.50.236.52&amp;nbsp;&amp;nbsp;&amp;nbsp; 2264(2.26%)       &lt;br /&gt;204.152.184.196 2231(2.23%)       &lt;br /&gt;216.165.129.141 2191(2.19%)       &lt;br /&gt;204.246.0.136&amp;nbsp;&amp;nbsp; 2144(2.14%)       &lt;br /&gt;Average Query Time: 0.00868 seconds&lt;/blockquote&gt;Files:&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMDUwMjE1NDEtNzZjOC00ZmU0LWIzYTMtOTQyNDE0YjE5NzQ5" target="_blank"&gt;loadDNS.pl&lt;/a&gt;     &lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMjg5MjczNzQtOTk4My00Yzc0LWE4YzMtYTAzY2UyYzJiZjJk" target="_blank"&gt;database-testLoad.sql&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-9204468437748136242?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/9204468437748136242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/testing-tool_9361.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/9204468437748136242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/9204468437748136242'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/testing-tool_9361.html' title='testing tool'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-5771609065142538635</id><published>2009-08-07T15:58:00.002-07:00</published><updated>2012-01-14T09:23:16.450-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>database countries</title><content type='html'>To populate the countries in the geoip_geo table, the following file can be used to insert all countries available in the GeoLite Country database into the table.&lt;br /&gt;&lt;br /&gt;geoip_geo is used to provide the countries available for matching to views.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNzY5MzEwNjAtODdiZS00Yjc0LWFlNWMtZjhmMjFiNWQ3MWEx" target="_blank" title="databsae-geoip-countries.sql"&gt;databsae-geoip-countries.sql&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-5771609065142538635?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/5771609065142538635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/database-countries_6819.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/5771609065142538635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/5771609065142538635'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/database-countries_6819.html' title='database countries'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-9000803129197035946</id><published>2009-08-05T03:51:00.002-07:00</published><updated>2012-01-14T09:26:27.197-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>database schema (upgrade)</title><content type='html'>If the database were already containing the old table. Perform the following to upgrade the database&lt;br /&gt;&lt;br /&gt;update releases-geo using the upgrade file    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [jiajun@sm-geodnssoc ~]$ mysql -u user -p geo-mozilla-com&amp;lt; database-upgrade.sql&lt;br /&gt;&lt;br /&gt;create the new tables and stored procedures    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [jiajun@sm-geodnssoc ~]$ mysql -u user -p geo-mozilla-com&amp;lt; database.sql&lt;br /&gt;&lt;br /&gt;rebuild the views either from geodns.pl/web UI/mysql before restarting the DNS server    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [jiajun@sm-geodnssoc ~]$ mysql –u user –p     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mysql&amp;gt; call buildViews();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mYjI4MDNjODAtYWY2Zi00MjZlLThhZGQtYjY4NWI4YmI3YWJj" target="_blank"&gt;database-upgrade.sql&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMmQ2MTJkNGYtMGY2Ny00N2FjLTk2MzUtZWVhZTI5Mzk5Mjhh" target="_blank"&gt;database.sql&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-9000803129197035946?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/9000803129197035946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/database-schema-upgrade_905.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/9000803129197035946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/9000803129197035946'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/database-schema-upgrade_905.html' title='database schema (upgrade)'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-1687810392111286030</id><published>2009-08-02T19:31:00.002-07:00</published><updated>2012-01-14T09:25:38.095-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>database schema</title><content type='html'>Uploading the database schema. To create the MySQL DB for Bind’s usage, simply create and database and use the file to create the tables and stored procedures.&lt;br /&gt;Example.&lt;br /&gt;[jiajun@sm-geodnssoc ~]$ mysql –u user –p    &lt;br /&gt;mysql&amp;gt; CREATE DATABASE `geo-mozilla-com`;     &lt;br /&gt;mysql&amp;gt; exit     &lt;br /&gt;[jiajun@sm-geodnssoc ~]$ mysql -u user -p geo-mozilla-com&amp;lt; database.sql &lt;br /&gt;rebuild the views either from geodns.pl/web UI/mysql before restarting the DNS server    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [jiajun@sm-geodnssoc ~]$ mysql –u user –p     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mysql&amp;gt; call buildViews();&lt;br /&gt;NOTE: I had reuploaded the schema file on 5 Aug 2337 hrs (GMT +8).&lt;br /&gt;Changes:&lt;br /&gt;- the new version does not drop the table if it exists. It will create the table only if it does not exists. However, stored procedures will always be recreated.&lt;br /&gt;&lt;br /&gt;Files:&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMTUzMDM3NzUtMTZiYi00NWI0LTgxZTYtNzdmYzM5MmM5YzRk" target="_blank" title="Database Schema"&gt;Database Schema&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-1687810392111286030?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/1687810392111286030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/database-schema_6639.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1687810392111286030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1687810392111286030'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/database-schema_6639.html' title='database schema'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-2312067002589059284</id><published>2009-08-01T22:15:00.002-07:00</published><updated>2012-01-14T09:27:07.183-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Final Files'/><title type='text'>Generated Diff</title><content type='html'>finished testing the diff file yesterday.&lt;br /&gt;Downloaded bind-9.4.3-P3.tar.gz and made sure the codes work against it and the generated the patch by comparing the original files with the modified ones.&lt;br /&gt;The diff included modifications to enable the dlz driver so that the vanilla codes can be changed without much intervention.&lt;br /&gt;To replicate the results, the instructions are as follows:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;download bind-9.4.3-P3.tar.gz &lt;/li&gt;&lt;li&gt;download mysql-bind.tar.gz &lt;/li&gt;&lt;li&gt;copy bind-9.4.3-P3.tar.gz to &amp;lt;Base Directory&amp;gt; &lt;/li&gt;&lt;li&gt;copy mysql-bind.tar.gz to &amp;lt;Base Directory&amp;gt; &lt;/li&gt;&lt;li&gt;cd &amp;lt;Base Directory&amp;gt; &lt;/li&gt;&lt;li&gt;tar -zxvf bind-9.4.3-P3.tar.gz &lt;/li&gt;&lt;li&gt;tar -zxvf mysql-bind.tar.gz &lt;/li&gt;&lt;li&gt;patch -p0 &amp;lt; ../allpatch.diff &lt;/li&gt;&lt;li&gt;cd bind-9.4.3-P3/bin/named/ &lt;/li&gt;&lt;li&gt;ln -s ../../../mysql-bind/mysqldb.c mysqldb.c &lt;/li&gt;&lt;li&gt;cd include/named/ &lt;/li&gt;&lt;li&gt;ln -s ../../../../../mysql-bind/mysqldb.h mysqldb.h &lt;/li&gt;&lt;li&gt;cd &amp;lt;Base Directory&amp;gt;/bind-9.4.3-P3 &lt;/li&gt;&lt;li&gt;./configure&amp;nbsp; --disable-openssl-version-check CFLAGS="-I/usr/local/include/" LDFLAGS="-L/usr/local/lib -lGeoIP" &lt;/li&gt;&lt;li&gt;make &lt;/li&gt;&lt;li&gt;sudo make install &lt;/li&gt;&lt;/ul&gt;The software requirements before the software to compile is that the geoIP API must be installed.&lt;br /&gt;The files:&lt;br /&gt;- &lt;a href="https://www.isc.org/downloadables/11" target="_blank" title="Bind 9.4.3-P3"&gt;Bind 9.4.3-P3&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://sourceforge.net/projects/mysql-bind/files/mysql-bind/mysql-bind-0.2%20src/mysql-bind.tar.gz/download" target="_blank" title="MySQL-BIND DLZ"&gt;MySQL-BIND DLZ&lt;/a&gt;&lt;br /&gt;- &lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMmYyMTNiNWYtOTg5MC00NGFhLTg3MjYtNTdhZDAxZjYzNzNk" target="_blank"&gt;THE patch&lt;/a&gt;:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-2312067002589059284?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/2312067002589059284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/generated-diff_5847.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/2312067002589059284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/2312067002589059284'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/08/generated-diff_5847.html' title='Generated Diff'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-7283682967036491930</id><published>2009-07-28T04:18:00.002-07:00</published><updated>2012-01-14T09:29:57.952-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>Config Gen</title><content type='html'>completed the prototype of the configuration generator so that it can be used to update Bind.&lt;br /&gt;&lt;br /&gt;When a new zone A.K.A domain is added, or a new view is added, the configuration file for Bind must be changed in addition to storing the records in the database. Otherwise, Bind would simply not know of their existence.&lt;br /&gt;&lt;br /&gt;What the configuration generator does is to generate the configuration file based on the views that should be available and add the zones in the database to the view. Very view configuration will have the same set of zones, except that the zones in different views would look up different database table to use records configured for different region or country.&lt;br /&gt;&lt;br /&gt;The last but important configuration would be the match statement. It provides the interface to the geoip elements. In summary, matching the ip of the client to the country. E.g. all ip from Australia would use the view that matches country_AU.&lt;br /&gt;&lt;br /&gt;The PHP script would then be able to output the configuration in the HTML format for display, with all the menus and links etc. Or, it could output in text file format so that the output can be easily downloaded to the server (wget or curl). The MD5 will also be available. &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-I5xlzs86t-I/TxG7hA7NKrI/AAAAAAAAbCw/SwHY2FgCSnM/s1600/configgen.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="440" src="http://1.bp.blogspot.com/-I5xlzs86t-I/TxG7hA7NKrI/AAAAAAAAbCw/SwHY2FgCSnM/s640/configgen.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To allow the “match” to be stored in database, i loaded all the possible country from geoip’s database into a table in the database. By using a join table to join the viewname to the countryname, the web ui now knows which view would match which country. The join table is used instead of simply adding a column so that a single view can match multiple countries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-7283682967036491930?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/7283682967036491930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/config-gen_6835.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7283682967036491930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7283682967036491930'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/config-gen_6835.html' title='Config Gen'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-I5xlzs86t-I/TxG7hA7NKrI/AAAAAAAAbCw/SwHY2FgCSnM/s72-c/configgen.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-9117775071207015223</id><published>2009-07-22T03:10:00.002-07:00</published><updated>2012-01-14T08:55:50.045-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>22 July 2009</title><content type='html'>&lt;p&gt;can’t wait to put these stuff into real use. :-)&lt;/p&gt;  &lt;p&gt;Trying to validate the code as much as i can. The Bind portion seems fine.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-9117775071207015223?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/9117775071207015223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/22-july-2009_8882.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/9117775071207015223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/9117775071207015223'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/22-july-2009_8882.html' title='22 July 2009'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-7810668152102608843</id><published>2009-07-22T02:38:00.002-07:00</published><updated>2012-01-14T09:30:18.428-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>managing views in WebUI</title><content type='html'>Over the last few days, i added the functionality to manage the views using the Web UI.&lt;br /&gt;And of course, more bug shooting. The record data was not validated before forming the sql query, allowing things like empty rdata. Fixed this one.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-G296cUIlYBU/TxG7BDDXTFI/AAAAAAAAbCg/pZClFNdwU8c/s1600/webuiviewpage.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="440" src="http://3.bp.blogspot.com/-G296cUIlYBU/TxG7BDDXTFI/AAAAAAAAbCg/pZClFNdwU8c/s640/webuiviewpage.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-7810668152102608843?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/7810668152102608843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/managing-views-in-webui_967.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7810668152102608843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7810668152102608843'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/managing-views-in-webui_967.html' title='managing views in WebUI'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-G296cUIlYBU/TxG7BDDXTFI/AAAAAAAAbCg/pZClFNdwU8c/s72-c/webuiviewpage.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-5076252094647972876</id><published>2009-07-19T17:30:00.002-07:00</published><updated>2012-01-14T09:30:54.632-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>WebUI Use Case Diagram</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-qjsl0GcpjhI/TxG7w4hmqTI/AAAAAAAAbC4/D3N1UBXw0Uo/s1600/webui.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-qjsl0GcpjhI/TxG7w4hmqTI/AAAAAAAAbC4/D3N1UBXw0Uo/s400/webui.jpg" width="356" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-5076252094647972876?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/5076252094647972876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/webui-use-case-diagram_1391.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/5076252094647972876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/5076252094647972876'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/webui-use-case-diagram_1391.html' title='WebUI Use Case Diagram'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-qjsl0GcpjhI/TxG7w4hmqTI/AAAAAAAAbC4/D3N1UBXw0Uo/s72-c/webui.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-8545978000171713253</id><published>2009-07-17T17:31:00.002-07:00</published><updated>2012-01-14T08:55:50.033-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>18 July</title><content type='html'>&lt;p&gt;working on the final documentation, not really final, but in process.&lt;/p&gt;  &lt;p&gt;Looking at the stuff over again to see if i missed out anything.&lt;/p&gt;  &lt;p&gt;For example, discovered i did not provide a way to create new region and CC in the Web UI. So spent a bit of time yesterday to tweak that.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-8545978000171713253?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/8545978000171713253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/18-july_7547.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/8545978000171713253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/8545978000171713253'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/18-july_7547.html' title='18 July'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-6970753127891082938</id><published>2009-07-16T21:34:00.002-07:00</published><updated>2012-01-14T08:55:49.996-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>perl and stored procedure</title><content type='html'>&lt;p&gt;had upgrade DBD::mysql on the vm using the rpm perl-DBD-mysql-4.005-1.el5.rf.i386.rpm so that geoDNS.pl can call the buildViews stored procedure.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-6970753127891082938?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/6970753127891082938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/perl-and-stored-procedure_4817.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/6970753127891082938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/6970753127891082938'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/perl-and-stored-procedure_4817.html' title='perl and stored procedure'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-4352366306679206639</id><published>2009-07-14T15:45:00.002-07:00</published><updated>2012-01-14T08:55:49.981-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>managing named.conf with php</title><content type='html'>&lt;p&gt;Was thinking if i should create something that manage named.conf. The interest in this started when i remembered that to add a zone into the DNS server, i will need to declare the zone in named.conf and create the zone file.&lt;/p&gt;  &lt;p&gt;The zone file portion is settled by the Web UI. But right now, the named.conf will still need to be changed manually.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-4352366306679206639?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/4352366306679206639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/managing-namedconf-with-php_9283.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/4352366306679206639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/4352366306679206639'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/managing-namedconf-with-php_9283.html' title='managing named.conf with php'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-7510591296398878859</id><published>2009-07-09T01:31:00.002-07:00</published><updated>2012-01-14T09:33:29.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>Sql &amp; Perl Scripts</title><content type='html'>1. procedure-buildviews.sql    &lt;br /&gt;This is a stored procedure that i implemented into the database. what it does is to read a table that is populated with the regions/countries for which views will be created for. What is does is similar to the rebuild_views function in geodns.pl. &lt;br /&gt;This can be used as a common method that all Perl and PHP script can call to create the views.&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mZWQzZDRlMjYtMTIyMC00YjU3LTk0NDQtOGM4YWI3N2FlMDUz" target="_blank"&gt;procedure-buildviews.sql&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. releases-geo.sql     &lt;br /&gt;This is the latest schema that i worked on. It includes the propose addition of unique constrains on column so that duplicate mirror(same name,rdtype and rdata) cannot be added for the same region. Another change which i did not mentioned earlier (only found this flaw 2 days ago) was the addition of the worldWeight field. What i found out after working on the web UI was that simply having one weight field was insufficient. The weight field would be weighting the mirrors in the same region. However, in views like GLOBAL or where there are no mirror available in that region, mirrors with the world field set to 1 would be used. In this case, the world mirror might come from more then one region. This is why a worldWeight is added so that when the mirror is used in a GLOBAL situation, the worldWeight would take effect. Hope the explanation is clear. :-) &lt;br /&gt;&lt;br /&gt;The way i implemented it was for the view to use worldWeight (then renamed to weight) when there is less than 1 non-soa and non-ns record in the region or when auto_geo_global is constructed. &lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNDVlOTBmNTgtYTIyYi00OTc1LTk2OTMtOTA2OGJiZTQ5YzIx" target="_blank"&gt;releases-geo.sql&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. zones.sql     &lt;br /&gt;This is the table that holds the interesting regions and countries, with the corresponding code (e.g. JP,US,CN) &lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mOTM4MWFiMjQtZjYxOC00Y2FiLWJmZTctNzQ1MzNmYjRlNWZj" target="_blank"&gt;zones.sql&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. createsp.pl [not in used]    &lt;br /&gt;The earlier implementation of using a stored procedure to perform the random weighted selection of mirror used temporary table to overcome the inability for the mysql cursor to use a variable table (or view in our case). However, that consumes memory and impact performances. Furthermore, i had no yet managed to ascertain the effect of creating 1 temporary table for each query on the master-slave mysql configuration. Hence, instead of having one stored procedure to do the job, this perl script would read the zones table (ref: zones.sql) to create a stored procedure for each view. I had corresponding modified the the bind mysql sdb driver to call the correct stored procedure (e.g. selectMirror_auto_geo_US). Hope this reduces the chance for problems to occur.     &lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mMDk5ZmYzNDUtYTNhZC00NTlhLTlmYTUtOTUwZDExZjkwMDY4" target="_blank"&gt;createsp.pl&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. loaddns.pl    &lt;br /&gt;This is the query tool that i created. what it does is to perform the required iteration of queries and log the delay and result of each query to a table in the database. This allows me to check if the distribution of results is according to the configured weight. And also, it gives a gauge of the respond time.     &lt;br /&gt;e.g.     &lt;br /&gt;./loadDNS.pl&amp;nbsp; --id 2 --query releases.geo.mozilla.com --count 100000 --server 127.0.0.1 -type AAAA     &lt;br /&gt;for looking up AAAA records     &lt;br /&gt;./loadDNS.pl&amp;nbsp; --id 2 --query releases.geo.mozilla.com --count 100000 --server 127.0.0.1 -type A     &lt;br /&gt;for looking up A records&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNzQ3OTc5NzQtZWIxMy00ZjBiLWJkOTAtMzIwYTQ1ZTVmZDVh" target="_blank"&gt;loadDNS.pl&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-7510591296398878859?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/7510591296398878859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/sql-perl-scripts_8404.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7510591296398878859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7510591296398878859'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/sql-perl-scripts_8404.html' title='Sql &amp;amp; Perl Scripts'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-1526388138655588363</id><published>2009-07-09T01:02:00.002-07:00</published><updated>2012-01-14T08:55:49.950-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>Why the Delay</title><content type='html'>&lt;p&gt;there are some stuff i wanted to post up on this blog for a couple of days now. But unfortunately, i had landed myself in hospital. A bit better now, hence starting to get back to speed on the GSoC project.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-1526388138655588363?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/1526388138655588363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/why-delay_1586.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1526388138655588363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1526388138655588363'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/why-delay_1586.html' title='Why the Delay'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-3251054650562049716</id><published>2009-07-01T03:39:00.002-07:00</published><updated>2012-01-14T09:46:26.343-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>Test Results</title><content type='html'>just completed a new test on a new implementation.&lt;br /&gt;Spent the past few days trying to optimize the solution. I think i had reached the balance solutions.&lt;br /&gt;&lt;br /&gt;Test #1:&lt;br /&gt;Algorithm was &lt;a href="http://goes-gsoc.blogspot.com/2009/06/bug-shooting-1_295.html"&gt;flawed&lt;/a&gt;. Discarded the results&lt;br /&gt;Results distribution: Not Close. Not all available records are used.&lt;br /&gt;&lt;br /&gt;Test #2:&lt;br /&gt;Random weight algorithm was implemented in MySQL as a stored procedure. A temporary table containing all the interesting (A records belonging to the same name) would be create. The temporary table works as a workaround for the MySQL’s cursor inability to be decalre using dynamic sql. Bind takes the id for the random record for selection along with the other records (NS and SOA). The results are then fed to Bind and returned as a query result.&lt;br /&gt;Average time taken per query: 0.008112291 seconds&lt;br /&gt;Results distribution: Very close&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNDEwZjkyY2UtNGFhMy00NmMxLWJmZjgtY2JkZjAwMDdiN2Nm" target="_blank"&gt;Analysis File&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Test #3:&lt;br /&gt;Improvement from Test #2, the stored procedure will now pass through A and AAAA records. 2 id (A and AAAA) will be returned for selection. Temporary table contains AAAA and A records now.&lt;br /&gt;Average time taken per query: 0.018336635 seconds&lt;br /&gt;Results distribution: Very close&lt;br /&gt;&lt;a href="http://goes-gsoc.zerothree.net/files/2009/07/a2-test2-analysis.pdf" target="_blank"&gt;Analysis File&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Test #4:&lt;br /&gt;Created a storage procedure for randomly selecting record for each zone in an attempt to remove the need for temporary table (which might be bad for the load balancing of MySQL table). The load on cpu becomes high (to the extend that the whole VM slows down) and the average time taken was high (around 0.8 seconds). Performance was bad even after using the same random number for both A record and AAAA record selection. The test was never completed&lt;br /&gt;Average time taken per query: -&lt;br /&gt;Results distribution: -&lt;br /&gt;&lt;br /&gt;Test #5:&lt;br /&gt;Moved the random weight selection to the C code in mysql.c. A new stored procedure to return the total weight for A and AAAA record is created. mysql.c would first call the stored procedure and retrieve the total weights. It would then select all the A record with the same name from the respective view. No temporary tables are used.&lt;br /&gt;Looping through the available records to select the record is done on Bind instead of MySQL. The same process is repeated for AAAA record. The random records for selection along with the other records (NS and SOA) are then selected and used. The select statement at this stage had also been optimized to remove the need for UNION.&lt;br /&gt;Average time taken per query: 0.01798024 seconds&lt;br /&gt;Results distribution: Very Close&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNDEwZjkyY2UtNGFhMy00NmMxLWJmZjgtY2JkZjAwMDdiN2Nm" target="_blank"&gt;Analysis File&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The way the test is conducted when testing both A and AAAA records is that both loadDNS.pl is ran at the same time. So that would be 2 threads actively querying the DNS server. The time taken per query would be roughly 1/2 if there is only one thread querying the server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-3251054650562049716?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/3251054650562049716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/test-results_1506.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/3251054650562049716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/3251054650562049716'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/07/test-results_1506.html' title='Test Results'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-7905310384661487639</id><published>2009-06-29T22:20:00.002-07:00</published><updated>2012-01-14T08:55:50.023-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>cpu load issue</title><content type='html'>&lt;p&gt;did some finalization of sql schema. and in my attempt to improve the query performance by creating a stored procedure for each view, i had seem to created another big problem.&lt;/p&gt;  &lt;p&gt;The cpu load during my test goes as high as 99%. This is bad. Average query time now stands at 0.52 seconds.&lt;/p&gt;  &lt;p&gt;I am currently conducting more test and optimize the solution, which otherwise seems to be great.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-7905310384661487639?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/7905310384661487639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/cpu-load-issue_7439.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7905310384661487639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7905310384661487639'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/cpu-load-issue_7439.html' title='cpu load issue'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-1317291016696845443</id><published>2009-06-26T05:42:00.002-07:00</published><updated>2012-01-14T09:38:25.759-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>1st glimpse of web UI</title><content type='html'>the web UI for managing the DNS records!!!&lt;br /&gt;1st time the world is seeing it.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-BSrIH6QEqnc/TxG8tt_ew_I/AAAAAAAAbDY/l4na8gYkK3Y/s1600/1stglimpseregion.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="384" src="http://3.bp.blogspot.com/-BSrIH6QEqnc/TxG8tt_ew_I/AAAAAAAAbDY/l4na8gYkK3Y/s640/1stglimpseregion.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Listing the records by region &amp;amp; country&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nrGfvKo9vJY/TxG8tPCZzLI/AAAAAAAAbDM/6zAw23Ql6bw/s1600/1stglimpselist.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="384" src="http://2.bp.blogspot.com/-nrGfvKo9vJY/TxG8tPCZzLI/AAAAAAAAbDM/6zAw23Ql6bw/s640/1stglimpselist.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Listing a zone&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-4SiorJQooWs/TxG8seOygZI/AAAAAAAAbDA/IJ-3nh6cqSU/s1600/1stglimpseadd_thumb.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="386" src="http://1.bp.blogspot.com/-4SiorJQooWs/TxG8seOygZI/AAAAAAAAbDA/IJ-3nh6cqSU/s640/1stglimpseadd_thumb.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Adding a new record&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-572QAMW4bbo/TxG8svbEQGI/AAAAAAAAbDE/kKYBnVVY3n8/s1600/1stglimpseaddzone.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="384" src="http://3.bp.blogspot.com/-572QAMW4bbo/TxG8svbEQGI/AAAAAAAAbDE/kKYBnVVY3n8/s640/1stglimpseaddzone.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;Adding a new zone with the default values&lt;br /&gt;&lt;br /&gt;Preparing to start testing it this weekend. What you are seeing here is not final, there are still many possibilities for changes to take place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-1317291016696845443?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/1317291016696845443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/1st-glimpse-of-web-ui_3979.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1317291016696845443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/1317291016696845443'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/1st-glimpse-of-web-ui_3979.html' title='1st glimpse of web UI'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-BSrIH6QEqnc/TxG8tt_ew_I/AAAAAAAAbDY/l4na8gYkK3Y/s72-c/1stglimpseregion.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-2586612964792386441</id><published>2009-06-21T21:35:00.002-07:00</published><updated>2012-01-14T08:55:49.975-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>lighttpd + fastcgi + php</title><content type='html'>&lt;p&gt;just got lighttpd and php installed on the vm in preparation of the web console that i will be implementing soon.&lt;/p&gt;  &lt;p&gt;trouble was that the vm can’t access the internet. had to download the packages onto my computer before scp it into the vm. so using yum was not possible.&lt;/p&gt;  &lt;p&gt;i am now thinking if i should go with one of the php framework (e.g. cakephp) or start of scratch. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-2586612964792386441?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/2586612964792386441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/lighttpd-fastcgi-php_2565.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/2586612964792386441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/2586612964792386441'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/lighttpd-fastcgi-php_2565.html' title='lighttpd + fastcgi + php'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-2060390502031011305</id><published>2009-06-21T18:30:00.002-07:00</published><updated>2012-01-14T09:38:58.259-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>weighting AAAA</title><content type='html'>before this, only A records were using the weight configured. I had updated the stored procedure to return both id for chosen A record and AAAA record. The sdb driver would then use this 2 formulate a result for Bind to return. In this way, both A and AAAA will follow the weight.&lt;br /&gt;&lt;br /&gt;updated stored procedure:&lt;br /&gt;&lt;blockquote&gt;CREATE PROCEDURE selectMirror(IN tableName varchar(255), IN lookupName varchar(255), OUT idV4 int, OUT idV6 int)&lt;br /&gt;BEGIN&lt;br /&gt;DECLARE totalWeight,mirrorWeight,mirrorID,selectedID,r int;&lt;br /&gt;DECLARE mirrorType varchar(255);&lt;br /&gt;DECLARE mirrorsV4 CURSOR FOR SELECT * FROM auto_geo_TEMP WHERE Upper(rdtype)='A';&lt;br /&gt;DECLARE mirrorsV6 CURSOR FOR SELECT * FROM auto_geo_TEMP WHERE Upper(rdtype)='AAAA';&lt;br /&gt;DECLARE EXIT HANDLER FOR NOT FOUND SET selectedID=-1;&lt;br /&gt;&lt;br /&gt;DROP table IF EXISTS auto_geo_TEMP;&lt;br /&gt;set @tempQuery = concat(&lt;br /&gt;'CREATE TEMPORARY TABLE auto_geo_TEMP ENGINE=MEMORY SELECT id,rdtype,weight FROM ',&lt;br /&gt;tableName,&lt;br /&gt;' WHERE (Upper(rdtype)=\'A\' OR Upper(rdtype)=\'AAAA\')&lt;br /&gt;and Upper(name)=Upper(\'',lookupName,'\')&lt;br /&gt;and enabled&lt;br /&gt;');&lt;br /&gt;PREPARE stmt FROM @tempQuery;&lt;br /&gt;EXECUTE stmt;&lt;br /&gt;&lt;br /&gt;SELECT SUM(weight) into totalWeight from auto_geo_TEMP where Upper(rdtype)='A';&lt;br /&gt;set selectedID=-1;&lt;br /&gt;IF totalWeight&amp;gt;-1 THEN&lt;br /&gt;OPEN mirrorsV4;&lt;br /&gt;selection: REPEAT&lt;br /&gt;FETCH mirrorsV4 into mirrorID,mirrorType,mirrorWeight;&lt;br /&gt;set r = FLOOR(1 + (RAND() * (totalWeight-1)));&lt;br /&gt;IF r&amp;lt;= mirrorWeight THEN SET selectedID = mirrorID;&lt;br /&gt;END IF;&lt;br /&gt;SET totalWeight=totalWeight - mirrorWeight;&lt;br /&gt;UNTIL ((totalWeight&amp;lt;1)OR(selectedID!=-1)) END REPEAT;&lt;br /&gt;CLOSE mirrorsV4;&lt;br /&gt;END IF;&lt;br /&gt;set idV4=selectedID;&lt;br /&gt;&lt;br /&gt;SELECT SUM(weight) into totalWeight from auto_geo_TEMP where Upper(rdtype)='AAAA';&lt;br /&gt;set selectedID=-1;&lt;br /&gt;IF totalWeight&amp;gt;-1 THEN&lt;br /&gt;OPEN mirrorsV6;&lt;br /&gt;selection: REPEAT&lt;br /&gt;FETCH mirrorsV6 into mirrorID,mirrorType,mirrorWeight;&lt;br /&gt;set r = FLOOR(1 + (RAND() * (totalWeight-1)));&lt;br /&gt;IF r&amp;lt;= mirrorWeight THEN SET selectedID = mirrorID;&lt;br /&gt;END IF;&lt;br /&gt;SET totalWeight=totalWeight - mirrorWeight;&lt;br /&gt;UNTIL ((totalWeight&amp;lt;1)OR(selectedID!=-1)) END REPEAT;&lt;br /&gt;CLOSE mirrorsV6;&lt;br /&gt;END IF;&lt;br /&gt;set idV6=selectedID;&lt;br /&gt;&lt;br /&gt;END&lt;/blockquote&gt;&lt;br /&gt;&lt;a href="https://docs.google.com/open?id=0B6gzPLa_Da2mNzViOTA1NjEtMGI0NS00NDZkLWJjZTctNTU2MDUyNTZlM2Y0" target="_blank"&gt;storedprocedure-220609&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-2060390502031011305?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/2060390502031011305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/weighting-aaaa_8097.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/2060390502031011305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/2060390502031011305'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/weighting-aaaa_8097.html' title='weighting AAAA'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-8070018814838658182</id><published>2009-06-20T17:54:00.002-07:00</published><updated>2012-01-14T10:24:09.667-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>modifying geodns.pl</title><content type='html'>geodns.pl is the perl script that is used to administer the records in the database. It removes the need for access the database directly using tools like mysql to modify and add new mirrors in day to day operations.&lt;br /&gt;Most of the modification are not too complex. Functions are instructed to handle the weight parameter where necessary.&lt;br /&gt;&lt;br /&gt;Summary of changes:&lt;br /&gt;- cmd_add: Require weight parameter. New mirror is inserted with the configured weight.&lt;br /&gt;- cmd_edit: Enabled the script to change the weight parameter of a specified resource ID.&lt;br /&gt;- cmd_list: Enabled the script to display the configured weight.&lt;br /&gt; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-a465y9fL2rw/TxHIO9n0dXI/AAAAAAAAbDg/BPZ_A6R5lQ0/s1600/cmd_list.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="147" src="http://4.bp.blogspot.com/-a465y9fL2rw/TxHIO9n0dXI/AAAAAAAAbDg/BPZ_A6R5lQ0/s640/cmd_list.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;cmd_check seems to be creating the view correctly. However, new zones i created are not propagated to the correct view. Or rather, the view is not selecting the new zone I created. Need to investigate on this.&lt;br /&gt;Another problem i discovered is that there is no protection against duplicate zone being inserted. The solution i intend to use is not alter the resource_geo table. to enforce that the combination of (name,rdata,CC,region) will need to be unique. However, i am not sure if this is done on purpose. Will need to check with Matthew.&lt;br /&gt;&lt;br /&gt;*** Update (1500hrs): it was not shown in the auto_geo_US table because i had forgot to enable the record. My bad. Problem solved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-8070018814838658182?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/8070018814838658182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/modifying-geodnspl_9867.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/8070018814838658182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/8070018814838658182'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/modifying-geodnspl_9867.html' title='modifying geodns.pl'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-a465y9fL2rw/TxHIO9n0dXI/AAAAAAAAbDg/BPZ_A6R5lQ0/s72-c/cmd_list.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-7214161080591637035</id><published>2009-06-09T23:31:00.002-07:00</published><updated>2012-01-14T08:55:50.005-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technical'/><title type='text'>bug shooting #1</title><content type='html'>&lt;p&gt;for the past few days i had been trying to test the weight distribution for the implementation.&lt;/p&gt;  &lt;p&gt;For several time, the tests failed after a multiple lookups. multiple being ~50000 lookup. By trying to do a simple test using “dig” and “mysql”, the fault quickly pointed to the DNS server. The SQL server was still responding to queries, but dig was returning SERVFAIL message.&lt;/p&gt;  &lt;p&gt;I decided to uncomment the diagnostics printf statement in the MySQL BIND SDB Driver. Running the test again with the BIND DNS Server printing the messages to console shows the problem almost immediately.&lt;/p&gt;  &lt;p&gt;----------------------&lt;/p&gt;  &lt;p&gt;09-Jun-2009 09:07:03.841 client 127.0.0.1#53792: view other: query: releases.geo.mozilla.com IN A -   &lt;br /&gt;59    &lt;br /&gt;36    &lt;br /&gt;33    &lt;br /&gt;34    &lt;br /&gt;09-Jun-2009 09:07:03.851 client 127.0.0.1#53792: view other: query: releases.geo.mozilla.com IN A -    &lt;br /&gt;13    &lt;br /&gt;Out of memory (Needed 8164 bytes)    &lt;br /&gt;Out of memory (Needed 8164 bytes)    &lt;br /&gt;09-Jun-2009 09:07:04.512 client 127.0.0.1#53792: view other: query: releases.geo.mozilla.com IN A -    &lt;br /&gt;Out of memory (Needed 8164 bytes)    &lt;br /&gt;Out of memory (Needed 8164 bytes)&lt;/p&gt;  &lt;p&gt;----------------------&lt;/p&gt;  &lt;p&gt;Looking at the system status using “top”, named was taking up memory as more queries are made. And there was definitely a memory leak. After looking at my codes again, i found that there was a resultset that was not freed after the results were used.&lt;/p&gt;  &lt;p&gt;The fix was quite easy, it was to free up the memory allocation after consuming the results.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;snprintf(str, sizeof(str),&amp;quot;call selectMirror('%s','%s',@resID)&amp;quot;, dbi-&amp;gt;table, name);     &lt;br /&gt;mysql_query(&amp;amp;dbi-&amp;gt;conn, str);      &lt;br /&gt;snprintf(str, sizeof(str),&amp;quot;select @resID&amp;quot;);      &lt;br /&gt;if( mysql_query(&amp;amp;dbi-&amp;gt;conn, str) != 0 )      &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return (ISC_R_FAILURE);      &lt;br /&gt;}      &lt;br /&gt;res = mysql_store_result(&amp;amp;dbi-&amp;gt;conn);      &lt;br /&gt;while ((row = mysql_fetch_row(res)))      &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; rid = atoi(row[0]);      &lt;br /&gt;}      &lt;br /&gt;mysql_free_result(res);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Testing this new build solved the memory leak problem. The memory usage remained constant at 1.2%.&lt;/p&gt;  &lt;p&gt;Another bug i found while checking the code shows that i had for some reason (probably accidental) added an extra totalWeight reduction per loop cycle. Meaning in each iterration,the totalWeight of the available resources were getting reduced twice. This is probably the reason why the previous test results i sent to Matthew showed that only a subset of the total resources available were used. (Hopefully, this is the reason)&lt;/p&gt;  &lt;p&gt;I had also added the SQL directive for the temporary table to be created in memory. The difference might be small because only a subset (based on region, resource type and resource name) of the mirrors are loaded into the temporary table. These data should fall below MySQL limit before loading the temporary table into disks. But the new addition should enforce that the table is always in memory.&lt;/p&gt;  &lt;p&gt;The previous selectMirror procedure is dropped and the updated procedure is created.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;CREATE PROCEDURE selectMirror(IN tableName varchar(255), IN lookupName varchar(255), OUT id int)     &lt;br /&gt;BEGIN      &lt;br /&gt;DECLARE notFound INT DEFAULT 0;      &lt;br /&gt;DECLARE totalWeight,mirrorWeight,mirrorID,selectedID,r int;      &lt;br /&gt;DECLARE mirrors CURSOR FOR SELECT * FROM auto_geo_TEMP;      &lt;br /&gt;DECLARE CONTINUE HANDLER FOR NOT FOUND SET notFound=1;       &lt;br /&gt;      &lt;br /&gt;DROP table IF EXISTS auto_geo_TEMP;      &lt;br /&gt;set @tempQuery = concat(      &lt;br /&gt;'CREATE TEMPORARY TABLE auto_geo_TEMP ENGINE = MEMORY SELECT id,weight FROM ',      &lt;br /&gt;tableName,      &lt;br /&gt;' WHERE Upper(rdtype)=\'A\'      &lt;br /&gt;and Upper(name)=Upper(\'',lookupName,'\')      &lt;br /&gt;and enabled      &lt;br /&gt;');      &lt;br /&gt;PREPARE stmt FROM @tempQuery;      &lt;br /&gt;EXECUTE stmt;      &lt;br /&gt;SELECT SUM(weight) into totalWeight from auto_geo_TEMP;      &lt;br /&gt;set selectedID=-1;      &lt;br /&gt;OPEN mirrors;       &lt;br /&gt;      &lt;br /&gt;selection: REPEAT      &lt;br /&gt;FETCH mirrors into mirrorID,mirrorWeight;      &lt;br /&gt;set r = FLOOR(1 + (RAND() * (totalWeight-1)));      &lt;br /&gt;IF r&amp;lt;= mirrorWeight THEN SET selectedID = mirrorID;      &lt;br /&gt;END IF;      &lt;br /&gt;if selectedID != -1 THEN LEAVE selection;      &lt;br /&gt;END IF;      &lt;br /&gt;SET totalWeight=totalWeight - mirrorWeight;      &lt;br /&gt;UNTIL (totalWeight-1)OR(notFound=1) END REPEAT;      &lt;br /&gt;CLOSE mirrors;      &lt;br /&gt;set id=selectedID;      &lt;br /&gt;END&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The test for 1000000 lookups is going on as i am posting this entry. It is going on well. Will analyze the data and post the results soon.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-7214161080591637035?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/7214161080591637035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/bug-shooting-1_295.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7214161080591637035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/7214161080591637035'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/bug-shooting-1_295.html' title='bug shooting #1'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521094831945337729.post-6091322800700759108</id><published>2009-06-09T03:04:00.002-07:00</published><updated>2012-01-14T08:55:49.992-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>9 June</title><content type='html'>&lt;p&gt;testing out if performance would be better if the temporary table created by the procedure is declared to use memory engine. the current implementation seems how have some load issues.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8521094831945337729-6091322800700759108?l=goes-gsoc.zerothree.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://goes-gsoc.zerothree.net/feeds/6091322800700759108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/9-june_297.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/6091322800700759108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521094831945337729/posts/default/6091322800700759108'/><link rel='alternate' type='text/html' href='http://goes-gsoc.zerothree.net/2009/06/9-june_297.html' title='9 June'/><author><name>Jia Jun</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
