哪个缓存系统可以与 mpm_worker 和 mod_fcgid 一起工作?

哪个缓存系统可以与 mpm_worker 和 mod_fcgid 一起工作?

我原本计划基于 mpm_worker 和 mod_fcgid 为我的 Apache 服务器使用 APC,但是我发现 APC 和 xCache 不适用于 mod_fcgid。那么您有什么建议?

答案1

以下对我来说效果很好。这个是单进程,但例如双进程也能稳定运行。

httpd.conf:

LoadModule fcgid_module modules/mod_fcgid.so
AddHandler fcgid-script fcg fcgi fpl
FcgidIPCDir /var/run/mod_fcgid
FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm
DefaultMaxClassProcessCount 1
FcgidMaxProcesses 1
FcgidMaxRequestsPerProcess 1000

php5.fcgi:

#!/bin/bash
PHPRC=$PWD/../etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php-cgi

php.ini文件:

扩展=apc.so

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 512M
apc.num_files_hint = 1000
apc.user_entries_hint = 4096
apc.ttl = 0
apc.user_ttl = 0
apc.gc_ttl = 3600
apc.cache_by_default = 1
apc.filters = "apc\.php$"
apc.mmap_file_mask = "/tmp/apc.XXXXXX"
apc.slam_defense = 0
apc.file_update_protection = 2
apc.enable_cli = 0
apc.max_file_size = 10M
apc.use_request_time = 1
apc.stat = 1
apc.write_lock = 1
apc.report_autofilter = 0
apc.include_once_override = 0
apc.localcache = 0
apc.localcache.size = 256M
apc.coredump_unmap = 0
apc.stat_ctime = 0
apc.canonicalize = 1
apc.lazy_functions = 1
apc.lazy_classes = 1

相关内容