This page gives the short history of the first three weeks of the Accelerator
project, taking PHPA from concept to its very first release.
Conception
The Accelerator began its life on 14 Aug 2001 with my first delving into
the bowels of PHP - the Zend engine. A few days later on
20 Aug 2001 there was the first pretty stable version to offer already
a
significant speedup. At this point, whilst the acceleration was evident, the
implementation was far from optimal and relied solely on delivering cached
pages from disc using stdio file access.
21-08-2001
Following this, experimenting with various caching approaches and performance
measurements began. On fairly simple scripts, although large due to
a significant amount of library code, speedups of around 1.5x were already evident,
but the challenge was to go better than this.
25-08-2001
At the expense of some per-server local memory, further acceleration was
achieved, but the use of per-server RAM was not ideal and I decided that
this could not be warranted without at least some further thought on
alternatives.
28-08-2001
The same acceleration was indeed possible using shared memory as per-server
RAM, and further acceleration was then achieved by extending the
scope of the acceleration technique across more data structures.
01-09-2001
The home run. With some modest further increases in performance,
the effort was now mainly focused on some attempts at reasonable management of the
shared memory cache. This cache gives the bulk of the
performance gains, and ideally pages would be served from here.
04-09-2001
The first major release is finally ready. The shared memory cache management is
still not ideal, and whilst the accelerator handles running out of cache
fairly gracefully, clawing back memory by ejecting statistically reasonable
pages, it can be improved.
There are a fair number of statistics kept internally for pages, and they
can probably be used better. However, by allocating a sensible amount
of shared memory, some good performance should be attainable.
05-09-2001 3am
Burning the midnight oil, I compared the performance of a Zend Cache
evaluation copy and the Accelerator, and the performance now turned out to be
nearly identical, typically to within a few 1/10ths msec or so, or one or
two transactions when pounding with Apache benchmarking tool, 'ab'.
Quite a result, and somewhat unexpected! I also realised that there were a
few more places where memory allocation, copying, and data structure creation
per page request could be eliminated. These are now incorporated into current
releases.