4teamwork/ftw.tika — pull request #12 by jone (2014-03-07 11:22:47+00:00)
Title: Tika daemon support for performance boost

Running tika as a server is much faster because the JVM is no longer booted for every file / conversion.

**Enhancements**

This pull request adds support for the tika daemon. The meta-directive is extended to also accept the `host` and `port` options. When configured `ftw.tika` will automatically switch to daemon mode and contact the server with the configured port (/ host).

If the server is not running, `ftw.tika` will automatically fallback to to executing tika directly using the configured `path` to the jar file.

**Productive installation**

(ftw-buildouts)[https://github.com/4teamwork/ftw-buildouts#tika-server] provides a `tika-server.cfg` can be used when the deployment buildout is based on ftw.buildout's `deployment.cfg`. The `tika-server.cfg` downloads tika, creates a server-script registered in supervisor and configures `ftw.tika` (ZCML).

More details about how to install it using buildout are described in the updated readme.

**Performance Test**

I've created 100 docx-files in Plone with random content and length and updated the `SearchableText`, once with the "old" method by firing up tika for every file and once by using a tika server.

The results:

| Method | Duration for 100 files | Duration per file |
| ---------- | ---------------------- | ----------------- |
| Non-Daemon | 110 seconds | 1.1 seconds |
| Daemon | 6.72 seconds | 0.0672 seconds |

@lukasgraf can you take a look at my changes?
/cc @maethu