24
02
2008
Not content with just creating PHP APC packages for Ubuntu Hardy, I have also created updates for the current Memcached and PHP5 Memcache packages as they are a couple of versions old now.
Again these should re-compile on 32bit machines with ease and probably Gutsy too.
Comments :
No comments »
Categories : PHP
Trackbacks :
No Trackbacks »
24
02
2008
As some of you know I use Ubuntu Hardy (alpha) on my MacBook Pro. Some think I am insane and twisted (and perhaps I am) but I find it much easier to do my day-to-day work on than Mac OSX.
Anyway, the one thing I found very strange about Ubuntu Hardy is that it favors XCache for an opcode cache without packages for eAccelerator or APC. I personally use APC on all my servers for several reasons:
- eAccelerator was segfaulting on our production servers after about a week of usage
- At the time of evaluation XCache was still in its infancy (I'm sure its pretty good)
- APC is a lot better than it used to be
- APC is said to be included in PHP6
Anyway, if you want something done, do it yourself, and using that philosphy I have built a DEB for Ubuntu Hardy for APC which can be found in my downloads section. It is currently for a 64bit install only but can be rebuilt for i386 and it should even rebuild on Gutsy. I will try to keep the binary up to date as new versions of PHP are released on Hardy.
Comments :
2 Comments »
Categories : PHP
Trackbacks :
No Trackbacks »
22
02
2008
In my previous post on the subject I stated that Memcache was faster at storing arrays than APC was by quite a large margin.
I will re-itterate that the 2 aren't really comparable in their target design. Memcached is designed as a distributed cache and as such is expected to be slower than APC. That said Memcached is still bloody fast and in my opinion one of the top server enhancement tools of the decade (as is APC, but I praise it more for its op-code caching abilities).
'Fail' responded to this and stated that I should serialize the array first (sorry, comments were not ported when I changed blog software), which I have since tried. It brings the APC store time down to a respectable 2 seconds from 13 seconds on the same testing environment. I guess my question now is: why doesn't APC serialize automatically when it detects an array?
Anyway it has helped massively with the caching methods I use now. I now go by the rule that small commonly accessed items (such as main menus) are stored in APC and larger items (such as articles) are stored in Memcache between multiple servers. I don't really worry if the data is a string, array or object.
I do intend to follow this up with a graph comparing APC, Memcached, file based cache and MySQL's query cache but that will take some time to prepare, mainly down to the fact that my laptop now has Ubuntu Hardy in it which has no APC build.
Comments :
No comments »
Categories : PHP
Trackbacks :
No Trackbacks »
12
02
2008
I was writing a basic unit test for a date conversion function yesterday and one test kept failing. It was to assert that 1st Jan 1970 00:00:00 would convert to Epcoh 0. Instead it kept converting to -3600. Further investigation showed the DST flag was on for this date, despite it being in Winter.
It turns out in the UK 1970 was on permanent BST time (GMT +0100) up until Oct 1971. So, unit test modified with a long comment explaining why.
I never thought history would help with with my PHP code!
Comments :
No comments »
Categories : PHP
Trackbacks :
No Trackbacks »
Defined tags for this entry:
php
08
02
2008
There has been an article on CIO recently which I'm sure many have seen as it has generated such a storm, mainly due to the authors complete ignorance for fact or technical knowledge. I am pretty sure it has been published for just this purpose, but at the same time it is very damaging to the PHP community and Zend.
I could pick out every flaw in the article but Terry Chay has already done a fantastic job of it. I leave it to him to continue here.
Comments :
No comments »
Categories : PHP
Trackbacks :
No Trackbacks »
Defined tags for this entry:
php