Welcome! Log In Create A New Profile

Advanced

Override APC setting in each FPM pool

Posted by Brandon Turner 
Brandon Turner
Override APC setting in each FPM pool
August 23, 2010 01:44PM
Hello All,

I'm trying to override the apc.shm_size php ini setting for each FPM
pool. I've added
php_admin_value[apc.shm_size] = 64
to each pool in my FPM config file. phpinfo shows that this setting is
set, however the APC cache still uses the default 30 megabyte size.

I've tried commenting out the apc.shm_size setting in my php.ini file
but that doesn't help. Setting apc.shm_size using the "-d" command line
argument does set the cache size correctly, however this doesn't allow
me to modify it per pool.

This may be a better question for the APC developers, but does anyone on
this list know if what I am trying to do is possible. Am I setting the
ini setting incorrectly?

Thanks,
Brandon
Jérôme Loyet
Re: Override APC setting in each FPM pool
August 23, 2010 02:28PM
2010/8/23 Brandon Turner <bturner@bltweb.net>:
>  Hello All,
>
> I'm trying to override the apc.shm_size php ini setting for each FPM pool..
>  I've added
> php_admin_value[apc.shm_size] = 64
> to each pool in my FPM config file.  phpinfo shows that this setting is set,
> however the APC cache still uses the default 30 megabyte size.
>
> I've tried commenting out the apc.shm_size setting in my php.ini file but
> that doesn't help.  Setting apc.shm_size using the "-d" command line
> argument does set the cache size correctly, however this doesn't allow me to
> modify it per pool.
>
> This may be a better question for the APC developers, but does anyone on
> this list know if what I am trying to do is possible.  Am I setting the ini
> setting incorrectly?

No it's all OK with your conf. I just test it and figure out the
problem. the shm_size is taken into account once at module
initialisation which is done by the FPM master process. So when
children processes are forked, APC is using it. Changing shm_size
after APC initialization is useless. It's the same problem as changing
apc.shm_size via ini_set.

You have to ask the APC developers. Please CC: me when asking them.

thx
++ jerome

>
> Thanks,
> Brandon
>
Brandon Turner
Re: Override APC setting in each FPM pool
August 23, 2010 03:34PM
On 8/23/10 1:26 PM, Jérôme Loyet wrote:
> I just test it and figure out the
> problem. the shm_size is taken into account once at module
> initialisation which is done by the FPM master process. So when
> children processes are forked, APC is using it. Changing shm_size
> after APC initialization is useless. It's the same problem as changing
> apc.shm_size via ini_set.
>
Jérôme,

It looks like you are correct. I didn't realize it until just now but
the same APC cache is shared by all FPM pools, even if those pools are
run as different users.

So if I want separate APC cache's for separate users I will have to run
a separate php-fpm binary (not just a separate pool) for each user.
Anybody doing this?

Brandon
Jérôme Loyet
Re: Override APC setting in each FPM pool
August 23, 2010 03:38PM
2010/8/23 Brandon Turner <bturner@bltweb.net>:
>
>
> On 8/23/10 1:26 PM, Jérôme Loyet wrote:
>>
>> I just test it and figure out the
>> problem. the shm_size is taken into account once at module
>> initialisation which is done by the FPM master process. So when
>> children processes are forked, APC is using it. Changing shm_size
>> after APC initialization is useless. It's the same problem as changing
>> apc.shm_size via ini_set.
>>
> Jérôme,
>
> It looks like you are correct.  I didn't realize it until just now but the
> same APC cache is shared by all FPM pools, even if those pools are run as
> different users.
>
> So if I want separate APC cache's for separate users I will have to run a
> separate php-fpm binary (not just a separate pool) for each user.  Anybody
> doing this?

yes

just launch php-fpm -y /path/to/php-fpm.conf with different path to
php-fpm.conf. The FPM master process consumes almost no CPU and some
memory. So multipliing FPM instance is not a big deal. go ahead.

btw, ask the APC dev trying to find a solution.

++ Jerome

>
> Brandon
>
>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 185
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready