Skip to content

Conversation

@amirparsadd
Copy link
Contributor

@amirparsadd amirparsadd commented Nov 20, 2025

📋 Overview

I saw an issue saying that mariadb max connections should be controllable through env variables so this PR fixes that with a new env variable:

  • MARIADB_POOL_MAX_CONNECTIONS

🛠️ Type of change

  • 🐛 Bugfix (a non-breaking change that resolves an issue)
  • ✨ New feature (a non-breaking change that adds new functionality)
  • ⚠️ Breaking change (a fix or feature that alters existing functionality in a way that could cause issues)
  • 🎨 User Interface (UI) updates
  • 📄 New Documentation (addition of new documentation)
  • 📄 Documentation Update (modification of existing documentation)
  • 📄 Documentation Update Required (the change requires updates to related documentation)
  • 🔧 Other (please specify):
    • Provide additional details here.

📄 Checklist

  • 🔍 My code adheres to the style guidelines of this project.
  • 🦿 I have indicated where (if any) I used an LLM for the contributions
  • ✅ I ran ESLint and other code linters for modified files.
  • 🛠️ I have reviewed and tested my code.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • ⚠️ My changes generate no new warnings.
  • 🤖 My code needed automated testing. I have added them (this is an optional task).
  • 📄 Documentation updates are included (if applicable).
  • 🔒 I have considered potential security impacts and mitigated risks.
  • 🧰 Dependency updates are listed and explained.
  • 📚 I have read and understood the Pull Request guidelines.

📷 Screenshots or Visual Changes

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please make sure that all environment variables stick to our existing naming scheme

https://github.com/louislam/uptime-kuma/wiki/Environment-Variables#mariadb-environment-variables

I am also not entirely sure if the min pool size should be configurable. What is the effect there?

@amirparsadd
Copy link
Contributor Author

Could you please make sure that all environment variables stick to our existing naming scheme

https://github.com/louislam/uptime-kuma/wiki/Environment-Variables#mariadb-environment-variables

I am also not entirely sure if the min pool size should be configurable. What is the effect there?

It's now following standards and i removed the min connections env

@louislam
Copy link
Owner

I think it needs some validations. Like checking a empty string, NaN etc. Or maybe number range.

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks 🙏
Should be uncontroversial and help the few people on a limited pool Mariadb hoster

@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Nov 21, 2025
@CommanderStorm CommanderStorm enabled auto-merge (squash) November 21, 2025 11:04
auto-merge was automatically disabled November 21, 2025 11:25

Head branch was pushed to by a user without write access

@amirparsadd
Copy link
Contributor Author

@CommanderStorm i added validation as Louis said

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please polish your code one round.

Please instead default to 10 and then add an if statement if the env var contains a valid number.
Number.MAX_SAFE_INTEGER for example is not a sensible max.

Also please log if a value does not get applied.

@louislam
Copy link
Owner

Plus, you don't need to call parseInt 4 times.

@CommanderStorm CommanderStorm changed the title make mariadb pool connections controllable through env variables feat: make mariadb max pool connections controllable through env variables Nov 23, 2025
@CommanderStorm CommanderStorm changed the title feat: make mariadb max pool connections controllable through env variables feat: make mariadb max pool connections controllable via env Nov 23, 2025
@amirparsadd
Copy link
Contributor Author

Changes:

  • added reasonable max
  • added logging on fail
  • removed repetitive parseInt

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

Successfully merging this pull request may close these issues.

Configurable maximum parallel MariaDB connections

3 participants