Apache mpm prefork config mismatches postgres default max connections
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 28/100
調査の方向性
まず、Docker デプロイメントにおける PostgreSQL 13 の接続制限と併せて、特に MaxRequestWorkers に注目して Apache prefork の設定を調査します。外部ストレージの閲覧中に接続枯渇を再現し、その後、選択した制限がコンテナの再起動後も維持され、Nextcloud の通常の動作を妨げないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Hello everyone,
first of all my configuration:
I am running the latest version of the docker image on my TrueNAS Scale instance as an automatically deployed app that comes with a postgres DB (Postgres 13) and the nextcloud container running apache service.
The output of occ config:list system is included below.
The issue I have run into is nextcloud logging that all database connections are used up and any further connections are reserved for super users. This issue came up during browsing of external storage content with folders including hundreds of photos.
I believe the misconfiguration is in the apache mpm prefork config that defaults to something like this:
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
while the postgres instance per default only allows up to 100 connections total.
The idea from ChatGPT was to reduce the MaxRequestWorkers from 150 to 50, but effectively one could also increase the amount of connections postgres handles from 100 to ~160 (-3 reserved for superuser) for example.
In my case I will change the postgres setting as the apache setting does not persist across container restarts, but a permanent solution to this issue would be great!
Here now the content of the command occ config:list system:
{
"system": {
"htaccess.RewriteBase": "\/",
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"password": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"upgrade.disable-web": true,
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "pgsql",
"version": "31.0.7.1",
"forwarded_for_headers": [
"HTTP_X_FORWARDED_FOR"
],
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"overwrite.protocol": "https",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
"loglevel": 2,
"maintenance": false,
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"127.0.0.1",
"localhost",
"nextcloud",
"***REMOVED SENSITIVE VALUE***"
]
}
}
- 主要言語
- Shell
- スター
- 7.4k
- フォーク
- 1.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/docker のほかの issue
-
1. To develop bug feature: cron image
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug docs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
0. Needs triage bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
Imagick architecture mismatch (x86_64 vs aarch64) on official arm64 image causes Apache segfaultsオープン0. Needs triage bug
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
nextcloud/docker の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
msys2/MSYS2-packages#6813 ·
メンテナーはふだん 1 日以内に返信
-
Laptop display stays disabled after unplugging external monitor: FALLBACK output counted as externalオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
-
[Bug]: Three default prefs with JSON values are never set (override.sh escapes their quotes twice)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Floorp-Projects/Floorp#2913 ·
メンテナーはふだん 1 日以内に返信
-
agent-butler-finding agent-research-recommend bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jordansmall/spindrift#5258 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信