|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78202 Opcache stats for cache hits, hits and opcache_hit_rate are capped at 32bit NUM
Submitted: 2019-06-24 21:54 UTC Modified: 2019-06-25 11:10 UTC
From: arutledge at paycomonline dot com Assigned: cmb (profile)
Status: Closed Package: opcache
PHP Version: Irrelevant OS: WINNT
Private report: No CVE-ID: None
 [2019-06-24 21:54 UTC] arutledge at paycomonline dot com
I have a fairly high usage cluster of 35+ servers.  Opcache is reset daily each night.  Opcache stats for 'cache hits', 'hits' and 'opcache_hit_rate' appear to be affected by the 'hits' variable which is limited to a maximum number size of 2,147,483,647...or 32bit int.  Once this # of hits is reached the number will turn negative and start counting up(going more positive) until it reaches zero and then it will go positive again.  Meanwhile the 'opcache_hit_rate' will become a negative number...IE -788% hit rate for example.

My concern is if this affects performance?

Status dump below for an example server...
opcache_enabled	true
cache_full	false
restart_pending	false
restart_in_progress	false
used_memory	479.96 MB
free_memory	288.04 MB
wasted_memory	0 bytes
current_wasted_percentage	0.00%
buffer_size	67,108,864
used_memory	34.91 MB
free_memory	29.09 MB
number_of_strings	663,003
num_cached_scripts	17,085
num_cached_keys	35,394
max_cached_keys	65,407
hits	-2,063,254,866
start_time	Sun, 23 Jun 19 07:37:35 -0500
last_restart_time	never
oom_restarts	0
hash_restarts	0
manual_restarts	0
misses	17,638
blacklist_misses	0
blacklist_miss_ratio	0.00%
opcache_hit_rate	-108.17%

Thank you


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-25 08:02 UTC]
The respective variables are declared as `zend_ulong` which is 32bit only on x86. 
 I wouldn't consider this to be a bug, but rather a limitation (similar to file size restrictions).  Are you running x86 PHP executables?

There is, however, certainly a signed confusion issue.
 [2019-06-25 08:03 UTC]
The following pull request has been associated:

Patch Name: Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
On GitHub:
 [2019-06-25 11:08 UTC]
Automatic comment on behalf of
Log: Fix #78202: Opcache stats for cache hits are capped at 32bit NUM
 [2019-06-25 11:08 UTC]
-Status: Open +Status: Closed
 [2019-06-25 11:10 UTC]
-Assigned To: +Assigned To: cmb
 [2019-06-25 11:10 UTC]
PR 4307 has been merged, so the signed/unsigned issue should be resolved.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 15:01:32 2024 UTC