# Opcache tuning

- Thread: https://externals.io/message/66657
- Original archive: https://news-web.php.net/php.internals/66657
- Started by Rasmus Lerdorf on 2013-03-16T01:53:59+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #66657 — Rasmus Lerdorf — 2013-03-16T01:53:59+00:00

URL: https://externals.io/message/66657#66657

Hey Dmitry, I think it would be helpful if we added two tuning status
entries. The first is a "restart_count" which lets you know how many
times the cache has restarted since server start. And the second, since
there are multiple triggers for a cache restart, would be a
"last_restart_reason" which specifies which limit triggered the last
restart. Both should be easy to do as far as I can tell and it would
help people figure out if they need to allocate more memory to the cache
or allocate more keys.

-Rasmus

---

## #66658 — Dmitry Stogov — 2013-03-16T06:13:10+00:00

URL: https://externals.io/message/66657#66658 · In reply to: #66657

Hi Rasmus,

restart_count - makes sense

last_restart_reason - is not very useful, I think it's better to add
separate counters for each reason (memory overflow, hash overflow, wasted
memory).

What do you think?

Dmitry.



> Hey Dmitry, I think it would be helpful if we added two tuning status
> entries. The first is a "restart_count" which lets you know how many
> times the cache has restarted since server start. And the second, since
> there are multiple triggers for a cache restart, would be a
> "last_restart_reason" which specifies which limit triggered the last
> restart. Both should be easy to do as far as I can tell and it would
> help people figure out if they need to allocate more memory to the cache
> or allocate more keys.
>
> -Rasmus

---

## #66659 — Rasmus Lerdorf — 2013-03-16T06:32:42+00:00

URL: https://externals.io/message/66657#66659 · In reply to: #66658

> Hi Rasmus,
> 
> restart_count - makes sense
> 
> last_restart_reason - is not very useful, I think it's better to add
> separate countersfor each reason (memory overflow, hash overflow, wasted
> memory). 
> 
> What do you think?

Sure, separate counters give us even more granularity. It should be
obvious which config param to tune and right now that is quite hard to
figure out unless you sit and watch it for a while or catch it at just
the right moment.

Another small tweak, I noticed that with enable_cli off it still loads
the blacklist when sapi=cli. There doesn't seem to be much point in
that, is there?

-Rasmus

---

## #66660 — Dmitry Stogov — 2013-03-16T06:42:30+00:00

URL: https://externals.io/message/66657#66660 · In reply to: #66659

> 
> > […]
>
> Sure, separate counters give us even more granularity. It should be
> obvious which config param to tune and right now that is quite hard to
> figure out unless you sit and watch it for a while or catch it at just
> the right moment.


Great. Please, propose the uniform names or even better prepare a path for
PHP-5.5.


Another small tweak, I noticed that with enable_cli off it still loads
> the blacklist when sapi=cli. There doesn't seem to be much point in
> that, is there?


I'll need to look into it. I'm not completely sure about ini on_modify
callback invocation order...

Dmitry.


> -Rasmus

---

## #66668 — Zeev Suraski — 2013-03-17T05:58:34+00:00

URL: https://externals.io/message/66657#66668 · In reply to: #66659

> Another small tweak, I noticed that with enable_cli off it still loads
> the blacklist when sapi=cli. There doesn't seem to be much point in
> that, is there?
>

Not that I think it's a common use case, but if one happens to have a
directory with rapidly changing files (typically auto-generated
files), you may still want to exclude them when in CLI, no?

Zeev

---

## #66669 — Dmitry Stogov — 2013-03-17T06:34:00+00:00

URL: https://externals.io/message/66657#66669 · In reply to: #66668

Hi Zeev,

Rasmus is talking about a case when O+ is loaded but completely disable for
CLI.
Of course, it makes no sense to load and parse blacklist file in this case.

Thanks. Dmitry.




> 
>
> > […]
>
> Not that I think it's a common use case, but if one happens to have a
> directory with rapidly changing files (typically auto-generated
> files), you may still want to exclude them when in CLI, no?
>
> Zeev

---

## #66670 — Zeev Suraski — 2013-03-17T07:00:21+00:00

URL: https://externals.io/message/66657#66670 · In reply to: #66669

I missed the 'off' part...  I guess it makes sense of we can do it.

Sent from my mobile



Hi Zeev,

Rasmus is talking about a case when O+ is loaded but completely disable for
CLI.
Of course, it makes no sense to load and parse blacklist file in this case.

Thanks. Dmitry.




> 
>
> > […]
>
> Not that I think it's a common use case, but if one happens to have a
> directory with rapidly changing files (typically auto-generated
> files), you may still want to exclude them when in CLI, no?
>
> Zeev
