How to improve Senaite performance?

This post aims to group some tips to improve Senaite performance. Feel free to comment and improve it!

These are some tips shared in the Gitter channel by @ramonski

The following tips modify some Zope parameters in order to improve the performance depending on each Senaite usage.

  1. Tweak the Python check interval (also see:

Execute this on your Server machine:

Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more 

>>> from test import pystone
>>> pystone.main()
Pystone(1.1) time for 50000 passes = 0.21492
This machine benchmarks at 232645 pystones/second
>>> 232645 / 50

Take this result and put it in the zope.conf like this: python-check-interval 4652

Or put it in your buildout.cfg:

python-check-interval = 4652
  1. Don’t record last access time of the Data.fs (see:

e.g. chattr +A /path/to/Data.fs

When a file with the ‘A’ attribute set is accessed, its atime record is not modified.

  1. Another performance tweak is to let the Zope clients communicate with ZEO over a socket. e.g.:

Add this:

zeo-socket = ${buildout:directory}/var/zeo.socket
zeo-address = ${buildout:zeo-socket}
zeo-address = ${buildout:zeo-socket}

at least no overhead as through the TCP connection.

  1. And last but not least to increase the ZODB cache size:

Add this:

zodb-cache-size = 150000