3

I am running PHP 5.6 and enabled the compiled-in module opcache. Now when I read the warnings inside my error log, I get these messages every few milliseconds:

Warning Interned String buffer overflow

There is no description to this error using this google search. However, the source code says, there may not be enough memory? Did I read this correctly?

So, to my understanding it is absolutely okay if cache gets exhausted and will be reused/recycled for new strings. If not, what am I missing?

I set opcache.interned_string_buffer from 4 to 8 MiB, but no luck yet.

  • What a fast edit, I had no chance. Nice, thanks. :-) – Ben Sep 7 '15 at 8:34
  • It may be worth while asking the chat section of StackOverflow too... Whilst it's not a programming issue, it's going to have effected programmers. – Dave Sep 7 '15 at 9:05
4

opcache.interned_strings_buffer - A pretty neat setting with like 0 documentation. PHP uses a technique called string interning to improve performance— so, for example, if you have the string "foobar" 1000 times in your code, internally PHP will store 1 immutable variable for this string and just use a pointer to it for the other 999 times you use it. Cool. This setting takes it to the next level— instead of having a pool of these immutable string for each SINGLE php-fpm process, this setting shares it across ALL of your php-fpm processes. It saves memory and improves performance, especially in big applications.

https://www.scalingphpbook.com/best-zend-opcache-settings-tuning-config/

  • Thank you. Can you please elaborate the effects on my error "Warning Interned String buffer overflow" and how to find out which are sane values? – Ben Dec 3 '15 at 8:32
  • 1
    I think you should take a look at the opcache status page, where you will be able to see or you are out of memory. The solution then would be to increase those parameters in php.ini github.com/rlerdorf/opcache-status – Rvanlaak Dec 3 '15 at 8:41
0

There is an ongoing bug that affects some users when opcache.interned_string_buffer is not set high enough. The bug causes Apache to crash so you would definitely know if you were experiencing the issue.

I recommend temporarily creating a php file such as info.php and adding

<?php phpinfo(); ?>

view the file in your browser to easily see "Interned Strings Used memory" and make sure you have some free memory. I have a fairly large wordpress site and I have my memory limit set at 32. I consistently have about 14mb interned strings memory used.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.