Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR JVM Heap Memory Settings #122

Closed
JoshDi opened this issue Feb 7, 2020 · 9 comments
Closed

SOLR JVM Heap Memory Settings #122

JoshDi opened this issue Feb 7, 2020 · 9 comments

Comments

@JoshDi
Copy link

JoshDi commented Feb 7, 2020

Can you expose a way to modify the SOLR JVM heap memory settings from the docker container? I have 128gb of ram on the machine I run my musicbrainz server, so I have plenty to spare and would like to increase it from 512mb

@yvanzo
Copy link
Contributor

yvanzo commented Feb 7, 2020

JVM heap memory isn’t specifically constrained for Solr. You can probably compare with your system:

sudo docker-compose exec search java -XshowSettings:vm -version
java -XshowSettings:vm -version

@JoshDi
Copy link
Author

JoshDi commented Feb 7, 2020

root@HTPC-Xeon:/storage/musicbrainz-docker/admin# docker-compose exec search java -XshowSettings:vm -version
VM settings:
    Max. Heap Size (Estimated): 26.67G
    Ergonomics Machine Class: server
    Using VM: OpenJDK 64-Bit Server VM

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.212-b04, mixed mode)
root@HTPC-Xeon:/storage/musicbrainz-docker/admin# java -XshowSettings:vm -version
VM settings:
    Max. Heap Size (Estimated): 26.67G
    Ergonomics Machine Class: server
    Using VM: Java HotSpot(TM) 64-Bit Server VM

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

@yvanzo
Copy link
Contributor

yvanzo commented Apr 29, 2020

Sorry, I was wrong, Solr is indeed using a Java heap of 512MB by default. It can already be modified through the environment variables SOLR_HEAP or SOLR_JAVA_MEM (the latter takes precedence over the former). See solr.in.sh for details.

  1. Create a file local/compose/search-memory.yml

    version: '3.1'
    
    # Description: Increase Java Heap for Solr search
    
    services:
      search:
        environment:
          - SOLR_HEAP=8g

    At this point, it should show up in the list of available compose files:

    admin/configure list
    
  2. Enable this file for the compose project:

    admin/configure add local-compose-search-memory
    docker-compose up -d search
    

See “Docker Compose overrides” for details on how to use Docker Compose overrides here.

@JoshDi
Copy link
Author

JoshDi commented Apr 29, 2020

great! I will try this. thank you

@yvanzo
Copy link
Contributor

yvanzo commented May 14, 2020

Set default value to 2GB and documented how to change this value in pull request #148, now merged.

Note that mbvm-38-dev branch has been merged into master too.

@yvanzo yvanzo closed this as completed May 14, 2020
@jvlmdr
Copy link

jvlmdr commented Mar 8, 2023

Hi. I followed these instructions while installing and I received an error:

$ sudo docker-compose up -d
ERROR: The Compose file is invalid because:
Service search has neither an image nor a build context specified. At least one must be provided.

I guess it's because I'm setting up the Postgres database only using with alt-db-only-mirror. This might just be worth noting for anyone following those instructions.

I commented out the lines for the "search" service (and kept the lines for service "db")

@yvanzo
Copy link
Contributor

yvanzo commented Mar 8, 2023

Hi @jvlmdr, which instructions are your referring to? Please open a separate issue if needed.

@jvlmdr
Copy link

jvlmdr commented Mar 9, 2023

Oh yeah, sorry for cluttering this issue. I encountered that error when following the instructions in this section:
https://github.com/metabrainz/musicbrainz-docker#set-up-search-indexes (searching for the issue brought me to this thread). If I have further trouble, I'll open a new issue

@yvanzo
Copy link
Contributor

yvanzo commented Mar 9, 2023

This section is about setting up search indexes which are used for the website and the API, it’s inapplicable to database-only mirror.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants