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

WebHost: Set Generator memory limit to 4GiB #4319

Merged

Conversation

black-sliver
Copy link
Member

What is this fixing or adding?

Sets WebHost generator memory limit to 4GB

How was this tested?

_ = bytearray(8*1024*1024*1024) in gen_game()'s task

@github-actions github-actions bot added affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Dec 2, 2024
@palex00
Copy link
Contributor

palex00 commented Dec 2, 2024

May I dumbly ask why? The more it can use the faster, no?

@nicholassaylor
Copy link
Contributor

The site has maxed out on memory multiple times since 0.5.1 released, meaning that rooms may be unable to start. Do we have any data with how much memory Generator uses currently?

@black-sliver
Copy link
Member Author

May I dumbly ask why? The more it can use the faster, no?

Not really. Generating a seed takes X amount of memory. Throwing more at it does not make it faster unless the code is changed to be "wasteful but faster" (which would break other things anyway).

Do we have any data with how much memory Generator uses currently?

Not that I know of. There are some options that are not banned from WebHost that use a lot of memory and I hope by allowing 4GB we don't break those, even if all 20 players pick them, while giving the system enough slack to kill misbehaving processes.

@Berserker66
Copy link
Member

Should probably be a config option and it feels odd to have it in a function called init_db.. doesn't that affect more than gen as well?

@black-sliver
Copy link
Member Author

Should probably be a config option

Done.

it feels odd to have it in a function called init_db.. doesn't that affect more than gen as well?

This is already done in #4310, however since the two are conflicting anyway (now even more), I pushed the rename here as well.

@Exempt-Medic Exempt-Medic added the is: enhancement Issues requesting new features or pull requests implementing new features. label Dec 3, 2024
WebHostLib/__init__.py Outdated Show resolved Hide resolved
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
@black-sliver black-sliver merged commit 4a5ba75 into ArchipelagoMW:main Dec 10, 2024
16 checks passed
@black-sliver black-sliver deleted the feat/webhost-gen-memory-limit branch December 10, 2024 01:44
Berserker66 pushed a commit that referenced this pull request Dec 10, 2024
* WebHost: Set Generator memory limit to 4GiB

* WebHost: make generator memory limit configurable, better naming

* Update WebHostLib/__init__.py

Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>

* Update docs/webhost configuration sample.yaml

---------

Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
(cherry picked from commit 4a5ba75)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: webhost Issues/PRs that touch webhost and may need additional validation. is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants