APC + Apache SIGHUP

[email protected] (Nathan Clemons) Wed, 7 Oct 2009 15:20:37 -0700
Newsgroups php.apc.dev
Message-ID <[email protected]>
Apologies in advance if this isn't the right list to use for support,
but it's the only APC-specific list I could find.

I did some digging around, and I couldn't find any mention of this on
the web or in the APC documentation (outside of one person causing
this behavior intentionally).

We do some pretty standard Apache log rotation on our web cluster with
logrotate; move the file to an archival point, send a SIGHUP to Apache
so it releases the open file handle, and then bzip2 up the data for
archival purposes.

However, what we're seeing happen is that when Apache receives the
SIGHUP, APC's cache gets cleared. (We're seeing this through our Cacti
graphs of APC cache size, and having tested directly as well.) This
isn't something we particularly like, since we're caching our
localization data inside of APC (using apc_store). So when all of the
web servers have APC clear their cache around the same time, this
causes a cache-warming effect on our Web Services cluster where
localization data is pulled from. Ideally we'd like to see a staggered
situation where the servers are not all pulling at the same time, but
we don't want to change when our logs are rotated as that would
introduce difficulties in our reporting infrastructure.

We are using APC 3.1.2 with the following config:

MMAP Support 	Enabled
MMAP File Mask 	no value
Locking type 	pthread mutex Locks
Revision 	$Revision: 3.196 $
Build Date 	Aug 11 2009 19:07:07

Directive: Local Value
apc.cache_by_default: On
apc.canonicalize: On
apc.coredump_unmap: Off
apc.enable_cli: Off
apc.enabled: On
apc.file_md5: Off
apc.file_update_protection: 2
apc.filters: no value
apc.gc_ttl: 3600
apc.include_once_override: Off
apc.max_file_size	: 1M
apc.mmap_file_mask: no value
apc.num_files_hint: 1000
apc.preload_path: no value
apc.report_autofilter: Off
apc.rfc1867: Off
apc.rfc1867_freq: 0
apc.rfc1867_name: APC_UPLOAD_PROGRESS
apc.rfc1867_prefix: upload_
apc.rfc1867_ttl: 3600
apc.shm_segments: 1
apc.shm_size: 200
apc.stat: On
apc.stat_ctime: Off
apc.ttl: 0
apc.user_entries_hint: 4096
apc.user_ttl: 0
apc.write_lock: On

Is this a generic artifact of APC and Apache interactions, or is there
some configuration change I can make to alter this behavior?

Thanks,

-- Nathan Clemons