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: https://pypi.org/project/jarn.checkinterval/)

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 
information.

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

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

Or put it in your buildout.cfg:

[client_base]
...
python-check-interval = 4652
  1. Don’t record last access time of the Data.fs (see: http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html)

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:

[buildout]
zeo-socket = ${buildout:directory}/var/zeo.socket
...
[zeoserver]
zeo-address = ${buildout:zeo-socket}
...
[client_base]
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:

[client_base]
zodb-cache-size = 150000
...
5 Likes