On 11/13/2012 10:20 AM, Eliezer Croitoru wrote: > On 11/5/2012 9:28 PM, Eliezer Croitoru wrote: >> On 11/5/2012 8:03 PM, Alex Rousskov wrote: >>> On 11/05/2012 08:55 AM, Eliezer Croitoru wrote: >>> >>>> As I mentioned about the TCP_SWAP_FAIL_MISSS if someone can explain >>>> literally or give an example of this kind of a case (outside of >>>> store_url) and what should cause it?(I'm a bit confused about it). >>> >>> Does the following explanation help? >>> http://www.squid-cache.org/mail-archive/squid-users/200104/0948.html >>> >>> As for a specific example, I can speculate that manually removing a ufs >>> file corresponding to a cached entry should cause TCP_SWAP_FAIL_MISSS if >>> that entry is later requested and found in store index (but not on >>> disk).
>> Helped me to settle a bit with my speculations. >> it's kind of weird since I can see that the file is there in the store >> dir and can be accessed. You asked for an example, and I found one. That particular example is a good illustration of why a swap-in may fail, but it probably has little or nothing to do with your specific problem. >> From what was explained before the store index stores keys and not url, >> am I right? What is stored in a store index is kind of store-dependent so, ideally, you should not care. >> just throwing into the air, what are the steps when trying to find a >> file in cache and serve it? >> 1. predict the hash of the request.(if store_url present to use it) Yes, "calculate the store key" based on request information may be a more accurate description. This happens as a part of Store::get()-related API discussed in item #2 below. >> 2. lookup for the hash(get and head..) in the index?(memory? ufs? are >> the same?) Yes, see Store::get(), storeGetPublicByRequest(), and other related storeGet*() and StoreEntry::get*() functions and methods. The Store controller searches for the entry in various places, including memory cache and disk caches. >> 3. read the file mentioned in the index from disk? by what? >> (I have seen some code but not sure if it's the point I should look at) Yes, the cached entry is swapped in from disk or from memory. The specific code depends on the store (memory, ufs, Rock, etc.). For disk-related stores, it all starts in storeSwapInStart() IIRC. HTH, Alex.
