What's the deal with Pressflow 7?

Alan Ivey's picture

Senior Systems Administrator


What's the deal with Pressflow 7?

Anyone who used Drupal 6 at scale knew that Pressflow 6 was pretty great. It forked Drupal and added several performance enhancements, including the ability to use external caches. Since Drupal 7 incorporated lots of the Pressflow 6 features, what's the deal with Pressflow 7?

After Drupal 7 launched, it seemed like Pressflow 7 would continue the momentum from Pressflow 6 and greatly enhance Drupal 7. But, here we are in 2013, and you don't hear about Pressflow 7 very often, and searching for differences does not yield much more than some diffs between baseline Drupal core 7 and the Pressflow 7 repository on GitHub. Since there are clearly some differences, let's dive in and see what they are exactly.

  • Pressflow Smart Start will forward you to the install page if the database is set up in settings.php but the database is empty, disabled by default.
  • Allow for environmental PRESSFLOW_SETTINGS to override settings.php; settings must be entered as a JSON array.
    • File: includes/bootstrap.inc
    • Commits: https://github.com/pressflow/7/commit/673fb0bdab618f8989365012149c76b8397f95d6 (Pull request: https://github.com/pressflow/7/pull/7), and https://github.com/pressflow/7/commit/953e6608b34975eaa0c8abed8a90f80d22f1b967
  • APC CSS and JS check; to prevent Drupal from constantly checking the file system for core-aggregated CSS and JS files, use APC as a key:value store instead. This is very helpful improving performance for networked file systems by reducing the frequency Drupal hits the file system.
    • File: includes/common.inc (also see lines 3558 and 4949)
    • Commit: https://github.com/pressflow/7/commit/e2f9d2b10b4f0c5f61f120be145621913c6794a4 (Pull request: https://github.com/pressflow/7/pull/16/files, original pull request: https://github.com/pantheon-systems/drops-7/pull/4)
  • Allow modules to act on the js_cache before writing to disk, and add a note to the aggregated JavaScript that it was built with PressFlow. This won't yield an immediate impact on anything, but adds additional functionality to modules.
  • Allow sub-second delays for lock_wait(). The calculation Drupal currently does will allow a value of 0 for the lock wait time, effectively skipping it. When PHP converts to an integer, a float will always round down. For example, as Drupal performs the operation: php -r "echo (int) 0.25 * 20;" would return 0. The Pressflow change corrects the order of operations and returns the correct value, for example: php -r "echo (int) (0.25 * 20);" would return 5, allowing for sub-second delays to be used as an input to the function.
    • File: includes/lock.inc
    • Commit: https://github.com/pressflow/7/commit/2cd4323946987608a660694df2c02f3cb4cce6c3

A full diff as of October 2013 can be found at https://gist.github.com/alanthing/6064500 for further reading. Original post at drupal.stackexchange.com.

I see you like to read printed material. You should check out Nicco's book The End of Big: http://endofbig.com