Feed on
Posts
Comments

Continuing on the theme of quick-and-dirty benchmarking of the forthcoming Plone 4 release, I decided to revisit an experiment I did about a year ago in which I looked at the memory usage on startup of Plone 3 vs. Plone 4.  In December 2008, I found that Plone trunk used 36% less memory on startup than Plone 3.1.7.

But back then, Plone 4 was still a long way off, so I wondered if things had changed lately.

So I fired up my 2Ghz MacBook with 2GB RAM, I started up Plone 3.3.4 and Plone 4’s current trunk, and Activity Monitor reported memory usage as follows:

That’s a 29% decrease in RAM usage for Plone 4, from 142.5MB to 102.5MB.

Sweet!  Plone is not only a lot faster than Plone 3, it’s also much more RAM-efficient.  Truth is, though, it’s not really Plone’s fault.  One of the big changes in Plone 4 is that it now uses Python 2.6 instead of Python 2.4.  Python 2.6 is quite a bit more memory efficient, and that’s where Plone’s gains are coming from.

So, thanks, Python team!

Update: See comments below from Hanno.  Turns out Python 2.6 is better at garbage collection, so Plone’s memory usage will increase less as it runs, but Python 2.6 actually causes Plone to use slightly more RAM at startup than it would under Python 2.4 (which Plone 4 does not support!).  But, thanks to all of the amazing work that the Plone 4 team has done to make Plone leaner and meaner than ever, Plone 4 more than compensates for Python’s slightly increased drag.  Whee!

Bonus: If you’re wondering why I clocked lower overall RAM usage when I tested this last year (97MB for Plone 3, and 62MB for Plone 4), you can blame Snow Leopard for that.  Running 64-bit Python makes it use more memory than 32-bit, and Snow Leopard, new since last year, is now (mostly) 64-bit.  You can avoid this by running your production sites on a 32-bit Python.  I’m just too lazy to do it right now.

Extra special bonus: One of the many benefits of Plone 4’s new “blob storage” infrastructure for handling files and images is that it is way, way more RAM efficient.  We don’t have hard benchmarks on this yet, but in one very large, heavily used intranet site with 16.5 GB of most documents and media files, the team at Jarn was able to cut RAM usage from 10GB to 3GB with substantial increases in performance.  We expect that most sites with large archives of binary files will see similar resource usage improvements as they migrate to Plone 4.

2 Responses to “Plone 4: uses 29% less memory than Plone 3”

  1. Hanno Schlichting says:

    I’m afraid your finding is wrong. Python 2.6 is better at garbage collection and can in many cases free memory of the process. In Python 2.4 the memory usage usually just went up over time. It’s however not better at handling our base memory load.

    I made a couple of quick changes and tested Plone 4 under Python 2.4 vs. Python 2.6. While Python 2.4 isn’t supported and some parts of Plone don’t work with it, firing up an instance and rendering a page is still possible without too many changes.

    I’m also on Snow Leopard and have both Python’s in a 64bit version. In my test Python 2.4 consumes 105.6mb where Python 2.6 consumes 113.2mb.

    So we can attribute a slight increase of memory usage to the new Python version. The decrease that overcompensates for this is all due to changes in our own code.

  2. Jon Stahl says:

    Hanno-
    Thanks for correcting me. So, in other words, Plone 4 is more memory efficient, thanks to… the Plone team! :-) Hooray us! I’ll update the post accordingly!

Leave a Reply

Subscribe without commenting