[consulting] Funding proposal 4.6 and 4.7 backport of the file caching patch

Kieran Lal kieran at civicspacelabs.org
Wed Mar 15 21:42:24 UTC 2006


Wanted: Partners to fund this work

Please contact me off-list if you are interested in funding this.   
Please do not hijack this thread.

The file cache patch allows Drupal to cache data to the
filesystem instead of to the database.  When configured, any
data that would normally be cached to the database will be
cached to the webserver's filesystem, increasing performance
and improving reliability.

In the event that Drupal is unable to connect to the database
(for example if the database is down for maintenance, or if
the database is already handling the maximum number of
connections), it will attempt to display the file-cached
version of the page instead of displaying an error.  Only if
no file-cached version of the page is available will someone
accessing your file-cache enabled site see a database error.

For even greater performance gain, the file cache patch
provides a "fastpath" option.  When enabled, pages that have
been cached to the filesystem will be displayed to anonymous
users without making any database queries.  Note that this
bypasses Drupal's session management, as well as all _init
and _exit hooks for anonymous users.  As always, logged in
users will not be displayed cached pages.

Here are some performance numbers obtained from benchmarks
against a patched version of Drupal 4.7 Beta:

Database cache:
     * Total time to load 1,000 pages: 34.12544 seconds
     * Successful requests: 9033 (92.3%)
     * Average pages per second: 29.38
     * Average time per page: 34.12 ms

File cache:
     * Total time to load 1,000 pages: 28.65989 seconds
     * Successful requests: 1,000 (100%)
     * Average pages per second: 36.1
     * Average time per page: 28.54 ms

File cache with FastPath:
     * Total time to load 1,000 pages: 5.23 seconds
     * Successful requests: 1,000 (100%)
     * Average pages per second: 191.12
     * Average time per page: 5.233 ms

To backport file-based caching from CVS HEAD, Jeremy conducted a file- 
by-file comparison to evaluate what has changed in the relevant areas  
of Drupal code since 4.6.  Files modified by the file-caching patch  
are bootstrap.inc, database.mysql.inc, database.pgsql.inc,  
session.inc, user.module, system.module, and settings.php. He then  
merged in the required changes, including a back port of the loose- 
cache from 4.7 as logic from the loose cache is used by the file- 
based cache.  Finally, with the changes merged Jeremy performed a  
regression test to verify that things work as designed.

Testing of the 4.6 patch has been done
   - Drupal still works with caching disabled
   - Data is cached to and retrieved from the filesystem when file- 
caching is enabled
   - The database is not initialized when fastpath is enabled and a  
file-cache exists
   - File-cached pages are displayed instead of a database error

To-do: we will be doing performance testing of the 4.6 version this week


More information about the consulting mailing list