Performance tips

Description

Tips for Plone performance tuning and making your add-on product and customizations faster.

Optimizing ZEO and threads

For multicore systems, which basically all production systems nowadays are, you might want to optimize Python threading vs. processes. You may also tune how many Python interpreter instructions are run before doing green thread switches in the interpreter.

Memcached as session storage

Storing sessions in ZEO/ZODB does not scale well, since they are very prone to raise ConflictErrors if there is considerable load on the system.

Memcached provides a more scalable session backend.

For more information, see lovely.session add-on product.

Input/output performance of the server

http://plope.com/Members/chrism/iostat_debugging

Summary:

<mcdonc> well, the example has await at about 40X svctime.. that's pretty shitty
<mcdonc> i mean that box was useless

Reducing memory usage

These tips are especially critical when running Plone on low-memory virtual private server (VPS).

Disable extra languages

Add PTS_LANGUAGES to buildout.cfg to declare which .po files are loaded on the start-up:

[instance]
...
environment-vars =
    PTS_LANGUAGES=en fi

Sessions and performance

Write transactions much worse performance-wise than read transactions.

By default, every login is a write transaction. Also, Plone needs to update the logged-in user's session timestamp once in a while to keep the session active.

With a high amount of users, you may start seeing many ConflictErrors (read conflicts) with ZODB.

There are some tricks you can use here:

ZServer thread count

This specifies how many requests one ZEO front-end client (ZServer) can handle.

The default set by buildout default is 2.

Adjust it:

[client1]
recipe = plone.recipe.zope2instance
....
zserver-threads = 5

Find good value by doing performance testing for your site.

Note

Increasing thread count is useful if your Plone site does server-to-server traffic and your Plone site needs to wait for the other end, thus blocking Zope threads.

More info:

XSendFile

XSendFile is an enhancement over HTTP front end proxy protocol which allows offloading of file uploads and downloads to the front end web server.

More info for Plone support:




Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Go to Performance tips on GitHub.
  2. Press Fork and edit this file button.
  3. Edit file contents using GitHub's text editor in your web browserm
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on Github.

For basic information about updating this manual and Sphinx format please see Writing and updating the manual guide.