Req #73888 [Opn]: realpath_cache should be SHM

From: Date: Sat, 07 Jan 2017 18:57:36 +0000
Subject: Req #73888 [Opn]: realpath_cache should be SHM
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206358@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73888&edit=1 ID: 73888 User updated by: spam2 at rhsoft dot net Reported by: spam2 at rhsoft dot net Summary: realpath_cache should be SHM Status: Open Type: Feature/Change Request Package: Performance problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: maybe these numbers a view minutes after reload http makes the problem clear: echo count(realpath_cache_get()); 325 6 57 1692 so we have one forker with a effective cache of 1692 records while another one a few seconds before only had 6 cache entries and so don't benefit from anything Previous Comments: ------------------------------------------------------------------------ [2017-01-07 18:40:30] spam2 at rhsoft dot net Description: ------------ in theory "realpath_cache" is a nice concept, but when you do repeatly print_r(realpath_cache_get()); you see it's very randomly depending on the forker instance you hit and so it's not really effective - on server with high load and so many hundret processes each maintains it's own cache and the hit rate because ttl is reached drops heavily besides it's not a effective as it should be there are more disadvantages: * you waste memory realpath_cache_size muliplied with process count * clearstatcache() called by applications after file-changes is more or less worthless because only the worker process issuing the command is affected while others still use cached results so this should work like "apcu" with a SHM segment sahred by all workers or since PHP now has 'opcache' shared between workers and doing all sorts of optimizations (include-hack, interned string buffers..) maybe the storage for realpath_cache could even go to 'opcache' at all ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73888&edit=1

« previous php.bugs (#206358) next »