mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-09 23:51:20 +00:00
Quota settings: per-month on project level; per-smaller on installation level
and make it configurable on in the templates & docker
This commit is contained in:
@@ -59,6 +59,10 @@ DEFAULTS = {
|
||||
# of 50/s (ingestion) on low-grade hardware that I measured.
|
||||
"MAX_EVENTS_PER_PROJECT_PER_5_MINUTES": 1_000,
|
||||
"MAX_EVENTS_PER_PROJECT_PER_HOUR": 5_000,
|
||||
"MAX_EVENTS_PER_PROJECT_PER_MONTH": 1_000_000,
|
||||
|
||||
"MAX_EVENTS_PER_5_MINUTES": 1_000,
|
||||
"MAX_EVENTS_PER_HOUR": 5_000,
|
||||
"MAX_EVENTS_PER_MONTH": 1_000_000,
|
||||
|
||||
"MAX_EMAILS_PER_MONTH": None, # None means "no limit"; for non-None values, the quota is per calendar month
|
||||
|
||||
@@ -163,10 +163,15 @@ BUGSINK = {
|
||||
"MAX_ENVELOPE_COMPRESSED_SIZE": int(os.getenv("MAX_ENVELOPE_COMPRESSED_SIZE", 20 * _MEBIBYTE)),
|
||||
|
||||
# Bugsink-specific limits:
|
||||
# The default values are 1_000 and 5_000 respectively; which corresponds to ~6% and ~2.7% of the total capacity of
|
||||
# 50 requests/s (ingestion) on low-grade hardware that I measured, and with 50% of the default value for retention.
|
||||
# The default values are 1_000, 5_000, 1M respectively; which corresponds to ~6%, ~2.7%, .8% of the total capacity
|
||||
# of 50/s (ingestion) on low-grade hardware that I measured.
|
||||
"MAX_EVENTS_PER_PROJECT_PER_5_MINUTES": int(os.getenv("MAX_EVENTS_PER_PROJECT_PER_5_MINUTES", 1_000)),
|
||||
"MAX_EVENTS_PER_PROJECT_PER_HOUR": int(os.getenv("MAX_EVENTS_PER_PROJECT_PER_HOUR", 5_000)),
|
||||
"MAX_EVENTS_PER_PROJECT_PER_MONTH": int(os.getenv("MAX_EVENTS_PER_PROJECT_PER_MONTH", 1_000_000)),
|
||||
|
||||
"MAX_EVENTS_PER_5_MINUTES": int(os.getenv("MAX_EVENTS_PER_5_MINUTES", 1_000)),
|
||||
"MAX_EVENTS_PER_HOUR": int(os.getenv("MAX_EVENTS_PER_HOUR", 5_000)),
|
||||
"MAX_EVENTS_PER_MONTH": int(os.getenv("MAX_EVENTS_PER_MONTH", 1_000_000)),
|
||||
|
||||
# Settings that help with debugging and development ("why isn't Bugsink doing what I expect?")
|
||||
"VALIDATE_ON_DIGEST": os.getenv("VALIDATE_ON_DIGEST", "none").lower(), # other legal values are "warn" and "strict"
|
||||
|
||||
@@ -105,6 +105,10 @@ BUGSINK = {
|
||||
# set MAX_EVENTS* very high to be able to do serious performance testing (which I do often in my dev environment)
|
||||
"MAX_EVENTS_PER_PROJECT_PER_5_MINUTES": 1_000_000,
|
||||
"MAX_EVENTS_PER_PROJECT_PER_HOUR": 50_000_000,
|
||||
"MAX_EVENTS_PER_PROJECT_PER_MONTH": 1_000_000_000,
|
||||
|
||||
"MAX_EVENTS_PER_5_MINUTES": 1_000_000,
|
||||
"MAX_EVENTS_PER_HOUR": 50_000_000,
|
||||
"MAX_EVENTS_PER_MONTH": 1_000_000_000,
|
||||
|
||||
"MAX_EMAILS_PER_MONTH": 10, # for development: a thing to tune if you want to the the quota system
|
||||
|
||||
@@ -62,11 +62,14 @@ HTTP_501_NOT_IMPLEMENTED = 501
|
||||
|
||||
QUOTA_THRESHOLDS = {
|
||||
"Installation": [
|
||||
("minute", 5, "MAX_EVENTS_PER_5_MINUTES"),
|
||||
("hour", 1, "MAX_EVENTS_PER_HOUR",),
|
||||
("month", 1, "MAX_EVENTS_PER_MONTH"),
|
||||
],
|
||||
"Project": [
|
||||
("minute", 5, "MAX_EVENTS_PER_PROJECT_PER_5_MINUTES"),
|
||||
("hour", 1, "MAX_EVENTS_PER_PROJECT_PER_HOUR",),
|
||||
("month", 1, "MAX_EVENTS_PER_PROJECT_PER_MONTH"),
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user