> -----Original Message----- > From: James McKiernan > Sent: Tuesday, September 17, 2002 7:31 PM > > No I have never used -C to prebuild the DBs in fact that's the > first time I even heard of it. > > Does this offer much better performance ?
One of the main reasons that squidGuard retains its speed (even with very large numbers of domains and urls), is that it stores all of the domains and urls in B-trees. (See <http://searchdatabase.techtarget.com/sDefinition/0,,sid13_gci508442,00.html>) At startup, squidGuard reads your squidGuard.conf file and for each defined destination group it looks first for .db versions of the listed text files. For example, if your squidGuard.conf file contained these lines: dest porn { domainlist porn/domains urllist porn/urls expressionlist porn/expressions logfile porn.log } squidGuard will first look for the files <porn/domains.db> and <porn/urls.db>. If those files do not exist, squidGuard will use the text files <porn/domains> and <porn/urls> and create a run-time B-tree structure from the text files and go into operation. The time required to create the B-trees is determined by the number of entries in the text files. When squidGuard is stopped, the B-tree structure is lost and must be recreated from the text files during the next startup. Running <squidGuard -C> tells squidGuard to pre-build the B-tree structures using the text files, and then store those B-trees as .db extensions of the text files. The next time squidGuard is started there is no time wasted on created the B-trees; the db files are immediately loaded and squidGuard is ready to roll. Without the prebuilt .db files <squid -k reconfigure> can take minutes, with the .db files it takes less than 5 seconds on my P200. When squidGuard is using the prebuilt .db files, changing the text files has no effect on squidGuard operation until the .db files are recreated with <squidGuard -C>, or until the .db files are updated with <squidGuard -u>. The update option has the advantage of speed; a running squidGuard can be updated and back in operation in less than 5 seconds. Database updates are accomplished by creating a file with the same name as the text and database files and a .diff extension. For example: /blacklists |-- porn |-- domains |-- domains.db |-- domains.diff |-- expressions |-- urls |-- urls.db `-- urls.diff The diff files contain entries to be added or deleted from the pre-built database: +domain/url to be added +domain/url to be added +domain/url to be added -domain/url to be removed -domain/url to be removed -domain/url to be removed Running <squidGuard -u> followed by <squid -k reconfigure> will then update the db files. It does not make any changes to the text files; you'll want to do that manually.
