1

I was planning to use APC for my Apache Server based on mpm_worker and mod_fcgid but I found out that APC and also xCache doesn't work with mod_fcgid. so what do you suggest?

5
  • It works for me just fine, both of them. I used virtualmin to configure it and I added APC or xcache and it was working good, however APC seems to be more decent. Sep 17, 2012 at 18:59
  • Thanks, take a look at comments here. I have tried it but it doesn't seem to be working for me.
    – Zim3r
    Sep 17, 2012 at 19:21
  • 1
    It's all working fine. It's just not a shared cache. This is OK solution in many cases. It's not like it's not working. It's all fine working just with no cache sharing between instances. Sep 17, 2012 at 22:59
  • Yes I know what you mean. does menarche capable of sharing cache between instances? Thanks
    – Zim3r
    Sep 18, 2012 at 6:36
  • 1
    To be honest, I would have to find out and make tests. But I do believe if you map the RAM via file in /tmp/, it will be working OK, that the cache will be shared. Sep 18, 2012 at 9:22

1 Answer 1

1

The following works well for me. This one is with single process but it works stable with e.g. two.

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:

extension=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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .