Another element added to this investigation, I have moved my test environment on the production server, which has a lot of muscles ?
I might have failed to explain exactly what is my current configuration/situation:
- I am testing flarum beta 5 with all core extensions installed, plus a pair of extensions from the list I found here (Mediaembed, Image attachments upload)
- I have ported all my forum content from SMF2, using the script I've developed (see https://discuss.flarum.org/d/3585-smf2-to-flarum-migration-script-alpha-3/22). The export/import works perfectly, thanks to vast usage of s9e\TextFormatter library for my content.
- I have a total of ~256000 posts and 18.800 discussions, with ~ 1300 users.
- I can with no problems whatsoever navigate through my content. Flarum is quick and responsive, even with discussions containing hundreds of posts.
- The only real issue I have with flarum, which would be definitively a show stopper, is with the search funcionality.
Now that I run flarum on my production server (dedicated Virtual Server with Ubuntu 14.04, 4 GB of RAM, 60 GB of disk space on SSD) I repeated the same experiment:
- I type "space shuttle" in the search box, and there starts the first ajax call which is supposed to offer some quick results;
- I waited for at least 2 minutes, nothing happened.
- Then i clicked on "Search all discussion for space shuttle", and this kicks out another ajax call.
- Almost 12 minutes later, still mysqld is at 100% of cpu consumption, and the search still not finished, and finally the query times out, and I have error 500. Still, having "top" open in the background to monitor, the mysqld process was active and I had to kill and restart mysqld to ease the load on the processor.
Here is the screenshot of what I describe.
Don't take me wrong: I understand flarum is still a beta product and exactly for this I'd like to see this behaviour investigated, because I can tell that this is going to be a major showstopper for me and for many bigger forums waiting to migrate.
Has anyone in the dev team tried to run search on a meaningful DB? I mean, I don't think that even this very forum has the same amount of discussions/posts I am playing with.
I am absolutely sure it's something related to the search algorythm because when I perform a partial import (e.g aroung 10.000 posts) from SMF, I have no problems whatsoever even with the most complicated search.
IMHO the Laravel search engine is really trying to crunch too much data and the process fails with no proper error handling somehow, and it does it in two de facto concurrent processes, one started as soon as one types something in the search bar, a second started clicking on "search all discussions for...".
I'm more than happy to know whether there are DB optimization techniques I could try, and I will gladly to support the investigation.
I apologise to be so persistent, but I think that if you can reproduce and confirm this behavior you have a big problem to solve before releasing a stable.