View Complete Thread
  • DropPhone DropPhone

    358 Posts



    Re: Wincache vs. opcache, coexist? Any tuning needed?

    Sep 12, 2017 09:56 PM|DropPhone|LINK


    I think you should also make sure to set wincache.ttlmax to 0.

    Setting this to 0 means that stale/expired items will never be scavenged.  The WinCache shared memory segment will eventually become full, until it is no longer able to create new items.  When that happens, you'll eventually devolve to a state where only un-servable, expired items exist in the cache, and you'll get 100% cache misses for all lookups.  It may take days, months or weeks to get to that state, but you *will* eventually get there.


    If the site goes idle, and the OP cache gets cleared, WinCache will be pinged and if the TTL is not high enough, it will re-read contents from the disk, rendering its caching benefits useless.

    Let's split this apart.

    First, if the site goes idle, and the w3wp.exe spins down, the WinCache file cache will also spin down.

    Second, I don't know what you mean by 'pinged'.  All cache operations are performed during operations initiated by executing a PHP script.  That includes cache scavenging.  The scavenger isn't on some kind of timer, waking up every N seconds to scavenge things.  If there is no activity, then the scavenger doesn't run.  Of course, there are also safeguards to ensure that, when the cache is being used heavily, the scavenger doesn't run on every single request.

    Third, for file cache entries, TTL isn't really the thing you care about.  It's the timestamp on the file.  And the wincache.chkinterval and the wincache.fcndetect settings.  If the underlying file system supports file change notifications, and fcndetect is enabled, then cached files will only get marked as stake when a change notification fires.  If the underlying file system doesn't support change notifications, then the chkinterval is used.  But here again, it's only referenced while a cache operation is executing.

    I hope this helps!