mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
Feature/memory optimization config (#108)
* feat(config): optimize memory usage to prevent OOM killer - Reduce brightness from 95 to 50 to lower power consumption - Reduce refresh rate from 120Hz to 100Hz to reduce CPU/memory pressure - Reduce background service workers from 3 to 1 per manager - Change hardware mapping from adafruit-hat-pwm to adafruit-hat - Expected memory savings: ~700MB reduction in background service usage - Addresses SIGKILL errors caused by memory exhaustion on Raspberry Pi Fixes: OOM killer terminating ledmatrix.service with status=9/KILL * revert display brightness * refactor(background-service): hardcode optimized settings and remove config blocks - Hardcode background service to 1 worker in all managers - Remove background_service config blocks from template - Simplify configuration for users - no need to adjust system settings - Memory optimization: ~700MB reduction in background service usage - Settings: 1 worker, 30s timeout, 3 retries (hardcoded) Files updated: - src/base_classes/sports.py - src/leaderboard_manager.py - src/odds_ticker_manager.py - src/soccer_managers.py - src/milb_manager.py - config/config.template.json This prevents OOM killer errors by reducing memory usage from 15 background threads to 5 threads total across all managers. * remove fallback in case of background service failure
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
"cols": 64,
|
||||
"chain_length": 2,
|
||||
"parallel": 1,
|
||||
"brightness": 95,
|
||||
"hardware_mapping": "adafruit-hat-pwm",
|
||||
"brightness": 90,
|
||||
"hardware_mapping": "adafruit-hat",
|
||||
"scan_mode": 0,
|
||||
"pwm_bits": 9,
|
||||
"pwm_dither_bits": 1,
|
||||
@@ -26,7 +26,7 @@
|
||||
"disable_hardware_pulsing": false,
|
||||
"inverse_colors": false,
|
||||
"show_refresh_rate": false,
|
||||
"limit_refresh_rate_hz": 120
|
||||
"limit_refresh_rate_hz": 100
|
||||
},
|
||||
"runtime": {
|
||||
"gpio_slowdown": 3
|
||||
@@ -152,14 +152,7 @@
|
||||
"dynamic_duration": true,
|
||||
"min_duration": 30,
|
||||
"max_duration": 300,
|
||||
"duration_buffer": 0.1,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
}
|
||||
"duration_buffer": 0.1
|
||||
},
|
||||
"leaderboard": {
|
||||
"enabled": false,
|
||||
@@ -202,14 +195,7 @@
|
||||
"request_timeout": 30,
|
||||
"dynamic_duration": true,
|
||||
"min_duration": 30,
|
||||
"max_display_time": 600,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
}
|
||||
"max_display_time": 600
|
||||
},
|
||||
"calendar": {
|
||||
"enabled": false,
|
||||
@@ -241,13 +227,6 @@
|
||||
],
|
||||
"logo_dir": "assets/sports/nhl_logos",
|
||||
"show_records": true,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"nhl_live": true,
|
||||
"nhl_recent": true,
|
||||
@@ -275,13 +254,6 @@
|
||||
],
|
||||
"logo_dir": "assets/sports/nba_logos",
|
||||
"show_records": true,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"nba_live": true,
|
||||
"nba_recent": true,
|
||||
@@ -309,13 +281,6 @@
|
||||
],
|
||||
"logo_dir": "assets/sports/wnba_logos",
|
||||
"show_records": true,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"wnba_live": true,
|
||||
"wnba_recent": true,
|
||||
@@ -344,13 +309,6 @@
|
||||
],
|
||||
"logo_dir": "assets/sports/nfl_logos",
|
||||
"show_records": true,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"nfl_live": true,
|
||||
"nfl_recent": true,
|
||||
@@ -378,13 +336,6 @@
|
||||
"logo_dir": "assets/sports/ncaa_logos",
|
||||
"show_records": true,
|
||||
"show_ranking": true,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"ncaa_fb_live": true,
|
||||
"ncaa_fb_recent": true,
|
||||
@@ -570,13 +521,6 @@
|
||||
"logo_dir": "assets/sports/milb_logos",
|
||||
"show_records": true,
|
||||
"upcoming_fetch_days": 7,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"milb_live": true,
|
||||
"milb_recent": true,
|
||||
@@ -623,13 +567,6 @@
|
||||
],
|
||||
"logo_dir": "assets/sports/soccer_logos",
|
||||
"show_records": true,
|
||||
"background_service": {
|
||||
"enabled": true,
|
||||
"max_workers": 3,
|
||||
"request_timeout": 30,
|
||||
"max_retries": 3,
|
||||
"priority": 2
|
||||
},
|
||||
"display_modes": {
|
||||
"soccer_live": true,
|
||||
"soccer_recent": true,
|
||||
|
||||
Reference in New Issue
Block a user