Re: DNS Caching class proposal
| From: | Tomas V.V.Cox | Date: | Thu, 31 Mar 2005 11:40:44 +0000 |
| Subject: | Re: DNS Caching class proposal | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-37022@lists.php.net to get a copy of this message | ||
Fabien MARTY wrote:
Hi Fabien, For many reasons: 1) I mostly use NFS you know flock() incompatibilities and weakness. With the mkdir() method I was able to do 1000 requests with 30 concurrent process (apache benchmark) with no cache corruption and no extra hashing/crc checks. 2) The Cache_Lite storage format doesn't fit quiet well for this. I won't use one file per cached domain and because each entry has its own TTL, the Cache_Lite per file ttl is not needed. Other problem using one file and Cache_Lite is that cached entries in ResolverCached contains binary data, which should be encoded before the write. 3) ResolverCached automatically writes the cache without user intervention and also automatically detects and recovers from corrupted entries. 4) As I understand, Cache_Lite does not prevent to the case when the cache is locked but the execution is aborted before reaching the unlock operation, locking the file forever. ResolvedCached() detects that case and cleans the lock if it's older than 30 seconds. 5) Cache_Lite does not provide a garbageCollector() only a "remove all" option. 6) Cache_Lite does not provide hit stats. Please don't take that as an attack, just both were designed for different purposes and environments. Tomas V.V.CoxWhy not using Cache/Lite for the caching process ?Just finished to write some docs for the class. It's called Net_DNS_ResolverCached, for caching DNS queries made with the Net_DNS package.