AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1080787
Accepted
france1
france1
Asked: 2021-10-18 00:17:02 +0800 CST2021-10-18 00:17:02 +0800 CST 2021-10-18 00:17:02 +0800 CST

我的 nextcloud 服务器使用太多 RAM (apache)

  • 772

我正在使用具有以下配置的 Apache:

Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
<FilesMatch \.php$>
        SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost/"
</FilesMatch>
HostnameLookups Off
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
<Directory /var/www/html/>
   Options +FollowSymlinks
   AllowOverride All
</Directory>
<IfModule mod_expires.c>
ExpiresActive On
FileETag None
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 50
MinSpareThreads 1
MaxSpareThreads 2
ThreadsPerChild 15
MaxRequestsPerChild 0
</IfModule>

<IfModule prefork.c>
          StartServers          2
          MinSpareServers       1
          MaxSpareServers       2
          MaxClients           60
          MaxRequestsPerChild 1000
</IfModule>

然后这是我的 external.conf(来自 varnish 的流量将被加密的地方):

<VirtualHost *:443>
        Protocols h2 http/1.1
        ServerName cloud.privacyy.ch
        ErrorLog              /var/log/apache2/external-https_error.log
        CustomLog             /var/log/apache2/external-https_access.log combined

        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/cloud.privacyy.ch/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/cloud.privacyy.ch/privkey.pem


    ProxyPreserveHost       On
    ProxyPass               / http://127.0.0.1:8080/
    ProxyPassReverse        / http://127.0.0.1:8080/

    <IfModule mod_rewrite.c>
          RewriteEngine On
          RewriteRule ^/\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
          RewriteRule ^/\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
          #RewriteRule ^/\.aurora https://cloud.privacyy.ch/aurora-staefa.ch/ [R=301,L]                                                                                                                    
    </IfModule>

    Header set Cache-Control "max-age=84600, private"
    <FilesMatch "\.(js|css|php)$">
           Header set Cache-Control "max-age=63072000, private"
    </FilesMatch>


    Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains"
    Header always set X-Content-Security-Policy "allow 'self';"
    Header always set x-xss-protection "1; mode=block"
    Header always set X-Robots-Tag "none"
    Header always set X-Download-Options "noopen"
    Header always set X-Permitted-Cross-Domain-Policies "none"
    Header set X-Content-Type-Options: "nosniff"
    Header set X-Frame-Options: "sameorigin"
    SSLCompression off
</VirtualHost>

这是 internal.conf:

<VirtualHost *:8181>
        protocols h2 http/1.1

    DocumentRoot /var/www/html
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost/"
    </FilesMatch>

    <IfModule mod_headers.c>
            Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
    </IfModule>

       Header set Cache-Control "max-age=84600, public"
        <FilesMatch "\.(iso|mp3|mp4|m4a|mov)$">
         Header set Cache-Control "max-age=42300, private"
        </FilesMatch>
</VirtualHost>

请注意,我没有在此处包含评论或喜欢日志设置

当我使用网络浏览器下载任何东西时,apache 服务器使用越来越多的内存(并且即使我不下载 12.3GB 文件也使用整个 12.3GB 交换空间)并且下载速度正在下降。使用 Nextcloud(桌面/手机)应用程序时也会发生同样的情况

原始下载速度为 10MB/s

我启用了以下 apache mods:

access_compat alias auth_basic authn_core authn_file authz_core authz_host authz_user autoindex deflate dir env expires fcgid filter headers http2 mime mpm_event negotiation pagespeed proxy proxy_balancer proxy_fcgi proxy_http reqtimeout rewrite setenvif slotmem_shm socache_shmcb ssl status unique_id

我正在使用 maria 数据库(最近切换但没有做太多)

Nextcloud 使用 redis-server 作为 php 缓存,我已经使用 nextcloud 的推荐设置启用了 opcache。我已经禁用它进行测试,但这并没有解决问题。

Accessibility
1.8.0
Vorgestellt
Activity
2.15.0
Vorgestellt
Brute-force settings
2.2.0
Vorgestellt
Calendar
2.3.4
Vorgestellt
Camera RAW Previews
0.7.12
Checksum
1.1.2
Circles
22.1.1
Vorgestellt
Collaborative tags
1.12.0
Vorgestellt
Comments
1.12.0
Vorgestellt
Contacts
4.0.3
Vorgestellt
Contacts Interaction
1.3.0
Vorgestellt
Dashboard
7.2.0
Vorgestellt
Default encryption module
2.10.0
Vorgestellt
Deleted files
1.12.0
Vorgestellt
End-to-End Encryption
1.7.1
Vorgestellt
Federation
1.12.0
Vorgestellt
File sharing
1.14.0
Vorgestellt
 Group folders
10.0.0
Vorgestellt
Log Reader
2.7.0
Vorgestellt
Mail
1.10.5
Vorgestellt
Maps
0.1.9
Vorgestellt
Metadata
0.14.0
Monitoring
1.12.0
Vorgestellt
Nextcloud announcements
1.11.0
Vorgestellt
Notes
4.1.1
Vorgestellt
Notifications
2.10.1
Vorgestellt
Password policy
1.12.0
Vorgestellt
PDF viewer
2.3.0
Vorgestellt
Photos
1.4.0
Vorgestellt
Privacy
1.6.0
Vorgestellt
Quota warning
1.11.0
Recognize
1.6.10
Registration
1.3.0
Right click
1.1.0
Vorgestellt 
 Share by mail
1.12.0
Vorgestellt
Support
1.5.0
Vorgestellt
Talk
12.1.2
Vorgestellt
Text
3.3.0
Vorgestellt
Theming
1.13.0
Vorgestellt
Two-Factor Email
2.1.1
Update notification
1.12.0
Vorgestellt
Usage survey
1.10.0
Vorgestellt
User status
1.2.0
Vorgestellt
Versions
1.15.0
Vorgestellt
Video converter
1.0.3
Video player
1.11.0
Vorgestellt
Weather status
1.2.0
Vorgestellt

(vorgestellt 表示推荐)

只有 apache 使用那么多 RAM - 其他一切都很好 此外,在我重新加载/重新启动 apache 服务器之前,这些东西不会从 RAM(&swap)中删除

从浏览器下载时,下载仅停止在 383MB - 并且浏览器没有说明要下载的文件有多大(Onedrive 也有这个问题,在较大的文件夹上下载速度低于 1MB/s,就像:未知剩余时间- 已经下载了多少 - 下载速度)

我配置错了什么?或者是别的什么?

我的服务器是苹果 macbook air 4GB RAM 2GHz - 2.2GHz(boost) Intel 多线程 2 核 cpu,xanmod 内核 如果缺少某些东西,请通知我一件事:如果没有可用 RAM,earlyoom 会杀死 apache 服务器另一件事:我在没有 x-server 的 Ubuntu21.04 和 400MB RAM 使用量(如果没有发生任何事情)

apache-2.4 nextcloud
  • 1 1 个回答
  • 269 Views

1 个回答

  • Voted
  1. Best Answer
    france1
    2021-10-23T10:30:28+08:002021-10-23T10:30:28+08:00

    禁用 Modsecurity 身体扫描并绕过清漆缓存进行下载

    这是一个问题:https ://github.com/varnishcache/varnish-cache/issues/2964

    • 0

相关问题

  • Apache2 - SSL 不工作

  • Apache <VirtualHost> 标签,如果客户端的 IP = x 则不重定向... 怎么做?

  • 我无法启用我的网站?[关闭]

  • SELinux 阻止 Apache 写入文件

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve