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

Spark worker memory doesn't set executor memory to maximum #75697

Open
icarosadero opened this issue Dec 11, 2024 · 3 comments
Open

Spark worker memory doesn't set executor memory to maximum #75697

icarosadero opened this issue Dec 11, 2024 · 3 comments
Assignees
Labels
spark stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@icarosadero
Copy link

icarosadero commented Dec 11, 2024

Name and Version

bitnami/spark:3.5.2

What architecture are you using?

amd64

What steps will reproduce the bug?

Simply start with the defaults and set SPARK_WORKER_MEMORY=1G to some other valuer other than 1G.

What is the expected behavior?

It is expected that the executor memory will also be updated to the value set in SPARK_WORKER_MEMORY

What do you see instead?

In the console, it can be seen that the executor memory is still the dafault of 1G

Additional information

Passing SPARK_EXECUTOR_MEMORY in the docker compose doesn't do anything.

@icarosadero icarosadero added the tech-issues The user has a technical issue about an application label Dec 11, 2024
@github-actions github-actions bot added the triage Triage is needed label Dec 11, 2024
@carrodher
Copy link
Member

Thank you for bringing this issue to our attention. In fact, it seems there is something wrong since the env. variable defined is SPARK_WORKER_MEMORY but the one used in the entrypoint is SPARK_EXECUTOR_MEMORY, see

$ ag 'SPARK_.*_MEMORY' bitnami/spark/3.5/debian-12/
rootfs/opt/bitnami/scripts/spark/entrypoint.sh
66:      "-Xms${SPARK_EXECUTOR_MEMORY}"
67:      "-Xmx${SPARK_EXECUTOR_MEMORY}"

docker-compose.yml
21:      - SPARK_WORKER_MEMORY=1G

Since you discovered the issue, if you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

@icarosadero
Copy link
Author

So, after some extra search on the internet, I discovered that you can request extra executor memory from the client. By changing the spark.executor.memory parameter. In Scala, that would look like so:

val spark = SparkSession.builder.master("spark://spark:7077").config("spark.executor.memory", "10g").getOrCreate()

It isn't a definitive solution, but might help with most use cases.

Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spark stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

3 participants