lighttpd forum XCache > Performance impact of "require_once()" on xcache?

Posted by Mark (Guest)
on 29.05.2006 16:54
We've got a large OO PHP5 application with many files included using 
"require_once()". APC was not able to cope with the application due to 
possible early/late binding issues, but Xcache seems to cope fine 
(thanks!).

My question is, would replacing all our "require_once()" calls with 
"require()" speed up the application under Xcache?

Regards,
Mark
Posted by moo XCache
on 30.05.2006 04:30
Mark wrote:
> We've got a large OO PHP5 application with many files included using 
> "require_once()". APC was not able to cope with the application due to 
> possible early/late binding issues, but Xcache seems to cope fine 
> (thanks!).
yeah, that's one of the highlight that not listed yet :D
i've purpose it to apc before i wrote it into XCache (even before i
wrote XCache iirc)
problem goes same with ea/mmcache
> 
> My question is, would replacing all our "require_once()" calls with 
> "require()" speed up the application under Xcache?
i guess so. there were some guys discussed in 
php-internals@lists.php.net. it would save a open() syscall for cpu 
cycles, and may also let the system cache
cold on the file include_/require_once.
there's patches commited in apc that focus on this problem. they
override INCLUDE_ONCE/REQUIRE_ONCE opcode handling whenever possible,
although a bit ugly. this isn't done in XCache yet.
ugly because isn't not that php-src support cachers, but cachers support
php-src.
u see, i'm always honest and fair :)
> 
> Regards,
> Mark
Posted by jfbus (Guest)
on 02.06.2006 14:38
moo moo wrote:
> Mark wrote:
>> We've got a large OO PHP5 application with many files included using 
>> "require_once()". APC was not able to cope with the application due to 
>> possible early/late binding issues, but Xcache seems to cope fine 
>> (thanks!).
> yeah, that's one of the highlight that not listed yet :D
> i've purpose it to apc before i wrote it into XCache (even before i
> wrote XCache iirc)
> problem goes same with ea/mmcache

I did a benchmark last week with eAccelerator & apc 3.0.10. require_once
was always much slower than require.

My test script did 20 require/require_once (each doing only echo
"foo";). I got only 120 http requests/s with require_once and 500 with
require. Quite a difference.

I'll have to retest apc, with IMHO had a huge locking issue during file
updates. Rasmus did work some work on it.