Henrik Nordstrom writes:
>Duane Wessels wrote:
>> >> 2. Suppose there is a web object that is bigger than the maximum cache
>> >> size. What does Squid do?
>> >
>> >No idea what Squid 2 does. Duane?
>> 
>> Squid doesn't cache objects larger than 'maximum_object_size'.
>> 
>> If your maximum_object_size is larger than your cache size,
>> you might have problems.
>
>
>Ok. Then the follow up question is: When does Squid start to save a
>object on disk. If I am not mistaken this is as soon as it thinks the
>object is uncacheable, but then what happens if the object later on gets
>uncacheable (over maximum_object_size, replaced by another object or
>whatever).
We start swapping out when we have more than VM_WINDOW_SZ bytes
to write (or less if store_status != STORE_PENDING).
   201      if (e->store_status == STORE_PENDING) {
   202          /* wait for a full block to write */
   203          if (swapout_size < VM_WINDOW_SZ)
   204              return;
If an object becomes uncachable while we are swapping it out, we 
KEEP swapping it out.  There might be secondary clients who
read the object from the disk.
   372  int
   373  storeSwapOutAble(const StoreEntry * e)
   374  {
   375      store_client *sc;
   376      if (e->swap_status == SWAPOUT_OPENING)
   377          return 1;
   378      if (e->mem_obj->swapout.fd > -1)
   379          return 1;
When swapout is complete, we again call storeCheckCachable().  If 
it returns false, we delete the object:
   116      if (storeCheckCachable(e)) {
   117          storeLog(STORE_LOG_SWAPOUT, e);
   118          storeDirSwapLog(e, SWAP_LOG_ADD);
   119      }
If there are more than two clients on an object, we pretty much have to
swap it out, no matter if its cachable or not.
Theoretically we could probably stop swapping out an object if it
becomes uncachable and there is only one client reading from it.
Thats not supported right now.
Duane W.
Received on Tue Jul 29 2003 - 13:15:54 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:57 MST