Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Apache mpm prefork config mismatches postgres default max connections

未关闭
#2,449 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
apache, docker, postgresql

调研方向

首先检查 Apache prefork 设置,尤其是 MaxRequestWorkers,同时检查 Docker 部署中的 PostgreSQL 13 连接限制。在浏览外部存储时重现连接耗尽问题,然后验证所选限制在容器重启后仍然保持,同时不会阻止 Nextcloud 正常运行。

由索引模型根据 Issue 内容生成。

描述

0. Needs triage bug

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 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/docker 的其他 Issue

查看 nextcloud/docker 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。