Re: Manuals and Spiders
| From: | Gabor Hojtsy | Date: | Wed, 23 Apr 2003 08:37:31 +0000 |
| Subject: | Re: Manuals and Spiders | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-16928@lists.php.net to get a copy of this message | ||
> > BTW ip-to-country seems to be more open as we would be free
> > to distribute the database via rsync to our mirror sites. If
> > we go on the ip-to-country way however, then we need to find
> > out, whether it is quick enough to search in a single CVS
> > file with PHP, or we need to split the file into segments,
> > and select the target file first based on the IP, and then
> > search for the country info... Speed tests are needed...
>
> Speed should not be an issue, since it is an open database. We can
> actually dump the entire CSV file provided at ip-to-country into a db3 /
> db3 / cdb / mysql database. Once we properly index the database we
> should get blazing speeds for each query.
Having the list in DB is not an option, we don't require any
of our mirrors to have any DB installed, nor do we intend this
to be...
Having this as a web service on rsync.php.net or somewhere else
just puts more load on the rsync server.
BTW dropping out the quotes and the country names from the data
file, it's size can be reduced to 412Kb, which is more manageable
then the original 731Kb. And country names are not needed while
country codes perfectly identify the countries...
So as we need to search on the file level, without any database,
the performance question is still up. We probably need to split
up the file. And it may also be a good option to store the
country code in a cookie, after it is found out, so the code
need not run everytime...
Goba