VM quite slow

Tags: #<Tag:0x00007fef645db938> #<Tag:0x00007fef645db6b8>

Hi, i’ve installed the VM on Virtualbox (and even in Docker) … search it’s quite slow, even the server hardware it’s quite good.

It’s slow at the first request of entities, the second search it’s faster (probably due to caching).

At the end local server it’s slower than online Musicbrainz DB.

It’s a normal behaviour ?

1 Like

The online postgress DB runs on a powerful server (really), and SOLR search uses a whole cluster of nodes. Both are handling hundreds of requests per second.
Most search queries got answers under 200ms (but it all depends on queries).
Typical web service mean response time is under 50 ms.
But that’s with a typical request rate of ~250 req/s for web service, and 150 req/s for search.
By my standards, that’s still slow, but we are somehow limited by hardware costs.

I don’t think comparing those with a local VM meant to handle only few requests makes much sense.

Did you do actual measurements ?
What about underlying hardware (CPU/RAM/disks) ?
What about underlying operating system ?

1 Like

The problem is that the server is slow to respond in the single request. Each query takes more than 2 seconds.

The virtual machine runs on a Dell poweredge r630 proxmox server, powerful enough for my needs.

Same thing happens on virtual box on my workstation.

It is not a problem of load of the requests but of response time of the single request.

Which queries exactly ?

@yvanzo, @rob any idea ?

Tuning your VM should help.

Note that online MusicBrainz DB runs a new search server since June 2018 which is quite faster. Next MusicBrainz Server/Docker/VM release will replace the old search server with the new one.

2 Likes

You may want to vacuum and rebuild the indexes in the database and see if that helps.

Try running the following, it could potentially take a few hours but you should only need to do it once after the initial import.

docker exec -it -u postgres musicbrainz-docker_db_1 reindexdb musicbrainz_db -U musicbrainz
docker exec -it -u postgres musicbrainz-docker_db_1 vacuumdb musicbrainz_db -U musicbrainz -f

2 Likes

Yes, tuning your postgres installation is very likely the most important thing you need to do in order for it to perform well. I’m not sure exactly how you installed your software, but postgres should have access to 1/4 to 1/3 of available ram in order for it to function well. A default install gives it only a few MB, which makes it… crawl.

@rob How exactly do we have to do that?

I’d suggest giving one of these a look: https://duckduckgo.com/?q=postgresql+tuning :slight_smile:

@Freso I know how to use a Search Machine :crazy_face:
If @rob says “postgres should have access to 1/4 to 1/3 of available ram” I would like to know how to do that with your VM.

Any specific idea or just another LMGTFY?

1 Like

It used to do it automatically, but apparently no longer. In this file:

https://github.com/metabrainz/musicbrainz-docker/blob/master/postgres-dockerfile/set-config.sh

It sets the shared_buffers to 512MB, which may or may not be enough for your VM.

2 Likes