[Audio] Shutdown lavalink when not in use #4522
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#4522
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature request
Select the type of feature you are requesting:
Describe your requested feature
Lavalink consumes a lot of ram (200MB RES) so only having it running when it's needed would drop memory usage.
(Red [python] uses around 50MB for me, so this would reduce memory usage by 80%)
Example use case: user is running Red on AWS or another cloud service provider that charges them per memory used, and music is played for ~1 hour per day.
NOTE: I'm not suggesting that this should be default, just that it could be an option
So the ram recommendation currently for red is you plan to use Audio is 1GB. And 512Mb is you don't use Audio, so the user has the option to not use audio if they are that constrained.
As far as the internal manager goes we will not be setting it to only work when needed, however since lavalink it's a service dependency and not actually part of red you are free to run an external server that you can turn on or off whenever you wish.
When working on the rewrite we had Two things we considered, having the server always running in the background as part of the API, or lazily start up when something needs to access API. Due to the nature of how the internal server works it's not realistic to turn off the lavalink server then start it up from scratch when required.
Due to having to support all systems we currently support. Since some systems can take 2-4 minutes to start up the internal manager, starting it on demand is not realistic.
Thats said something that is being considered is getting rid of the internal manager all together and let the user handle the LL server themselves, this is being considered for the rewrite.
When is the rewrite planed /where can I read more about the rewrite?
https://github.com/Cog-Creators/Red-DiscordBot/labels/Category%3A%20Audio%20API
https://github.com/Cog-Creators/Red-DiscordBot/labels/Category%3A%20Audio%20Cog
And When I finish writting it.