Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ApcIterator instead of loading all cache_info into memory #51

Closed
MikeSorokin opened this issue Apr 12, 2017 · 3 comments
Closed

Comments

@MikeSorokin
Copy link
Contributor

Hello!
Did you consider switching from apc_cache_info way to APC[U]Iterator on some commands like apcu:regexp:delete. Iterator would allow to significally descrease memory consumption, especially on servers with low php.memory_limit and large apc cache size.
For now (using 1.11.0 version with php 5.4.45) I can`t even clear cache by regexp if php.memory_limit = 128M and apc.shm_size = 1G because of size of apcu_cache_info's data.
And this logic still remain in 2.* versions as I see.
image

@themightychris
Copy link

It might be because APCIterator is extremely prone to crashing PHP with the version of apcu that ships with Ubuntu 14.04. I've tried for a long time to get them to update it but it doesn't seem to matter what anyone says: https://bugs.launchpad.net/ubuntu/+source/php-apcu/+bug/1374892

Maybe detecting the apcu version and only using the memory intense method for the versions < 4.0.6 is in order?

@MikeSorokin
Copy link
Contributor Author

Well, we probably could use some configurable logic in this case, I suppose. I don`t say - to do checking for version inside tool itself, I mean - to use config options for this.
Also - is this the only reason to not use Iterator at all?

@themightychris
Copy link

AFAIK yes, that's the only reason not to use the iterator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants