Haystack RealTimeSearchIndex makes django freeze when entering data

I use django-haystack and xapian backend with real-time indexing ( haystack.indexes.RealTimeSearchIndexing ) of the model data and it works fine on my Ubuntu server. However, this causes django to freeze when entering data when deploying the application to the RHEL5 server.

If you go to the standard SearchIndex standard, everything will be complicated.

Running ./manage.py rebuild_index manually also works fine.

The main differences between the two installations would be the Python versions (2.4.3 versus 2.6.4) and xapian (1.0.4-1 vs 1.0.15).

Any suggestions on what could be the problem?

Nothing interesting appears in the logs, and I have already tried different databases (mysql, sqlite3) and deployment methods (mod_python, wsgi).

I noted a warning in the haystack docs stating that RealTimeSearchIndex is only processed using the Solr backend, however I am working on a very low traffic using only random writes, so I am fine with some processor overhead when writing.

+4
source share
2 answers

Installing xapian-core and xapian bindings from source code solved the problem.

I originally used the RPM packages provided here .

+2
source

Note this from the author of xapian-haystack :

Because Xapian does not support WritableDatabase concurrent connections, it is highly recommended that users take care to use RealTimeSearchIndex to set WSGIDaemonProcess processes = 1 or use another way to ensure that there are no multiple write attempts to indexes. Alternatively, use SearchIndex and cronjob to override content at specified time intervals (a cronjob sample can be found here http://gist.github.com/216247 ) or get your own SearchIndex to implement some other form of updating your indexes.

+1
source

Source: https://habr.com/ru/post/1303002/


All Articles