diff options
author | zeripath <art27@cantab.net> | 2021-05-24 00:23:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-24 02:23:55 +0300 |
commit | 3aaf64885f47eb65bf7353a5613acfcac786e5b2 (patch) | |
tree | 678222d7958d9d26f988bc307a9c9801bbec9c78 | |
parent | 6021fbfe7a4e73c209eeea514a929fcb5598d63e (diff) | |
download | gitea-3aaf64885f47eb65bf7353a5613acfcac786e5b2.tar.gz gitea-3aaf64885f47eb65bf7353a5613acfcac786e5b2.zip |
Change default queue settings to be low go-routines (#15964)
This PR suggests a change to the default configuration for queues:
* Use a common DATADIR for the queues
* Set starting workers to 0 and make boost a single worker
Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r-- | modules/setting/indexer.go | 4 | ||||
-rw-r--r-- | modules/setting/queue.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/setting/indexer.go b/modules/setting/indexer.go index 842ef8ea41..b111bf445b 100644 --- a/modules/setting/indexer.go +++ b/modules/setting/indexer.go @@ -51,7 +51,7 @@ var ( IssueConnStr: "", IssueIndexerName: "gitea_issues", IssueQueueType: LevelQueueType, - IssueQueueDir: "indexers/issues.queue", + IssueQueueDir: "queues/common", IssueQueueConnStr: "", IssueQueueBatchNumber: 20, @@ -76,7 +76,7 @@ func newIndexerService() { Indexer.IssueIndexerName = sec.Key("ISSUE_INDEXER_NAME").MustString(Indexer.IssueIndexerName) Indexer.IssueQueueType = sec.Key("ISSUE_INDEXER_QUEUE_TYPE").MustString(LevelQueueType) - Indexer.IssueQueueDir = sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(path.Join(AppDataPath, "indexers/issues.queue")) + Indexer.IssueQueueDir = sec.Key("ISSUE_INDEXER_QUEUE_DIR").MustString(path.Join(AppDataPath, "queues/common")) Indexer.IssueQueueConnStr = sec.Key("ISSUE_INDEXER_QUEUE_CONN_STR").MustString("") Indexer.IssueQueueBatchNumber = sec.Key("ISSUE_INDEXER_QUEUE_BATCH_NUMBER").MustInt(20) diff --git a/modules/setting/queue.go b/modules/setting/queue.go index 2365604562..c626f585f0 100644 --- a/modules/setting/queue.go +++ b/modules/setting/queue.go @@ -48,7 +48,7 @@ func GetQueueSettings(name string) QueueSettings { q.Name = name // DataDir is not directly inheritable - q.DataDir = filepath.Join(Queue.DataDir, name) + q.DataDir = filepath.Join(Queue.DataDir, "common") // QueueName is not directly inheritable either q.QueueName = name + Queue.QueueName for _, key := range sec.Keys() { @@ -103,11 +103,11 @@ func NewQueueService() { Queue.WrapIfNecessary = sec.Key("WRAP_IF_NECESSARY").MustBool(true) Queue.MaxAttempts = sec.Key("MAX_ATTEMPTS").MustInt(10) Queue.Timeout = sec.Key("TIMEOUT").MustDuration(GracefulHammerTime + 30*time.Second) - Queue.Workers = sec.Key("WORKERS").MustInt(1) + Queue.Workers = sec.Key("WORKERS").MustInt(0) Queue.MaxWorkers = sec.Key("MAX_WORKERS").MustInt(10) Queue.BlockTimeout = sec.Key("BLOCK_TIMEOUT").MustDuration(1 * time.Second) Queue.BoostTimeout = sec.Key("BOOST_TIMEOUT").MustDuration(5 * time.Minute) - Queue.BoostWorkers = sec.Key("BOOST_WORKERS").MustInt(5) + Queue.BoostWorkers = sec.Key("BOOST_WORKERS").MustInt(1) Queue.QueueName = sec.Key("QUEUE_NAME").MustString("_queue") Queue.SetName = sec.Key("SET_NAME").MustString("") |