patrickfrey / strusWebService

web service (HTTP/JSON) to use the strus API as a service
http://project-strus.net
Mozilla Public License 2.0
4 stars 0 forks source link

Busy after restart of web service #57

Closed andreasbaumann closed 6 years ago

andreasbaumann commented 6 years ago

When inserting documents and restarting the web service you experience quite some activity before the first query can be executed. It's unclear to me whether this is leveldb reorganizing or compressing some data.

andreasbaumann commented 6 years ago

This activity is due to reorganization of LevelDB. The same is discovered when using the strusInspect Utility asking for the number of documents with "nofdocs". This command that is a simple Lookup in the database may last some seconds when issued the first time after building an index. The solution should be to enforce this kind of reorganization on completion of insertion operations and not when the storage is queried the first time.

andreasbaumann commented 6 years ago

Something like a 'optimize' in Lucene. :-) This should be a webservice command and a function in strus?

patrickfrey commented 6 years ago

The behaviour was due to a missing call of leveldb at the end of a transaction. Should be fixed now.