Server IP : 184.154.167.98 / Your IP : 3.145.168.68 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/public_html/sesiones/core/doc/admin/installation/ |
Upload File : |
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Server tuning — Nextcloud latest Administration Manual latest documentation</title> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/custom.css" type="text/css" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Example installation on Ubuntu 18.04 LTS" href="example_ubuntu.html" /> <link rel="prev" title="Hardening and security guidance" href="harden_server.html" /> <script src="../_static/js/modernizr.min.js"></script> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search"> <a href="../contents.html"> <img src="../_static/logo-white.png" class="logo" alt="Logo"/> </a> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li> <li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li> <li class="toctree-l1"><a class="reference internal" href="../release_schedule.html">Maintenance and release schedule</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Installation and server configuration</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="system_requirements.html">System requirements</a></li> <li class="toctree-l2"><a class="reference internal" href="deployment_recommendations.html">Deployment recommendations</a></li> <li class="toctree-l2"><a class="reference internal" href="source_installation.html">Installation on Linux</a></li> <li class="toctree-l2"><a class="reference internal" href="installation_wizard.html">Installation wizard</a></li> <li class="toctree-l2"><a class="reference internal" href="command_line_installation.html">Installing from command line</a></li> <li class="toctree-l2"><a class="reference internal" href="apps_supported.html">Supported apps</a></li> <li class="toctree-l2"><a class="reference internal" href="selinux_configuration.html">SELinux configuration</a></li> <li class="toctree-l2"><a class="reference internal" href="nginx.html">Nginx configuration</a></li> <li class="toctree-l2"><a class="reference internal" href="harden_server.html">Hardening and security guidance</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Server tuning</a><ul> <li class="toctree-l3"><a class="reference internal" href="#using-cron-to-perform-background-jobs">Using cron to perform background jobs</a></li> <li class="toctree-l3"><a class="reference internal" href="#reducing-system-load">Reducing system load</a></li> <li class="toctree-l3"><a class="reference internal" href="#caching">Caching</a></li> <li class="toctree-l3"><a class="reference internal" href="#using-mariadb-mysql-instead-of-sqlite">Using MariaDB/MySQL instead of SQLite</a></li> <li class="toctree-l3"><a class="reference internal" href="#using-redis-based-transactional-file-locking">Using Redis-based transactional file locking</a></li> <li class="toctree-l3"><a class="reference internal" href="#ssl-encryption-app">SSL / encryption app</a></li> <li class="toctree-l3"><a class="reference internal" href="#enable-http2-for-faster-loading">Enable HTTP2 for faster loading</a></li> <li class="toctree-l3"><a class="reference internal" href="#tune-php-fpm">Tune PHP-FPM</a></li> <li class="toctree-l3"><a class="reference internal" href="#enable-php-opcache">Enable PHP OPcache</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="example_ubuntu.html">Example installation on Ubuntu 18.04 LTS</a></li> <li class="toctree-l2"><a class="reference internal" href="example_centos.html">Example installation on CentOS 8</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../configuration_server/index.html">Nextcloud configuration</a></li> <li class="toctree-l1"><a class="reference internal" href="../apps_management.html">Apps management</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_user/index.html">User management</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_files/index.html">File sharing and management</a></li> <li class="toctree-l1"><a class="reference internal" href="../file_workflows/index.html">File workflows</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_database/index.html">Database configuration</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_mimetypes/index.html">Mimetypes management</a></li> <li class="toctree-l1"><a class="reference internal" href="../maintenance/index.html">Maintenance</a></li> <li class="toctree-l1"><a class="reference internal" href="../issues/index.html">Issues and troubleshooting</a></li> <li class="toctree-l1"><a class="reference internal" href="../gdpr/index.html">GDPR</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../contents.html">Nextcloud latest Administration Manual</a> </nav> <div class="wy-nav-content"> <div class="rst-content style-external-links"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../contents.html">Docs</a> »</li> <li><a href="index.html">Installation and server configuration</a> »</li> <li>Server tuning</li> <li class="wy-breadcrumbs-aside"> <a href="https://github.com/nextcloud/documentation/edit/master/admin_manual/installation/server_tuning.rst" class="fa fa-github"> Edit on GitHub</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <div class="section" id="server-tuning"> <h1>Server tuning<a class="headerlink" href="#server-tuning" title="Permalink to this headline">¶</a></h1> <div class="section" id="using-cron-to-perform-background-jobs"> <h2>Using cron to perform background jobs<a class="headerlink" href="#using-cron-to-perform-background-jobs" title="Permalink to this headline">¶</a></h2> <p>See <a class="reference internal" href="../configuration_server/background_jobs_configuration.html"><span class="doc">Background jobs</span></a> for a description and the benefits.</p> </div> <div class="section" id="reducing-system-load"> <h2>Reducing system load<a class="headerlink" href="#reducing-system-load" title="Permalink to this headline">¶</a></h2> <p>High system load will slow down Nextcloud and might also lead to other unwanted side effects. To reduce load you should first identify the source of the problem. Tools such as htop, iotop, <a class="reference external" href="https://my-netdata.io">netdata</a> or <a class="reference external" href="https://nicolargo.github.io/glances/">glances</a> will help to identify the process or the drive that slows down your system. First you should make sure that you installed/assigned enough RAM. Swap usage should be prevented by all means. If you run your database inside a VM, you should not store it inside a VM image file. Better put it on a dedicated block device to reduce latency due to multiple abstraction layers.</p> </div> <div class="section" id="caching"> <span id="id1"></span><h2>Caching<a class="headerlink" href="#caching" title="Permalink to this headline">¶</a></h2> <p>Caching improves performance by storing data, code, and other objects in memory. Memory cache configuration for the Nextcloud server must be installed and configured. See <a class="reference internal" href="../configuration_server/caching_configuration.html"><span class="doc">Memory caching</span></a>.</p> </div> <div class="section" id="using-mariadb-mysql-instead-of-sqlite"> <h2>Using MariaDB/MySQL instead of SQLite<a class="headerlink" href="#using-mariadb-mysql-instead-of-sqlite" title="Permalink to this headline">¶</a></h2> <p>MySQL or MariaDB are preferred because of the <a class="reference external" href="http://www.sqlite.org/whentouse.html">performance limitations of SQLite with highly concurrent applications</a>, like Nextcloud.</p> <p>See the section <a class="reference internal" href="../configuration_database/linux_database_configuration.html"><span class="doc">Database configuration</span></a> for how to configure Nextcloud for MySQL or MariaDB. If your installation is already running on SQLite then it is possible to convert to MySQL or MariaDB using the steps provided in <a class="reference internal" href="../configuration_database/db_conversion.html"><span class="doc">Converting database type</span></a>.</p> <p>In smaller installations you might not want to set up a separate cache. However you can still tune your database. The following example is suited for a database smaller than 1GB. MySQL will consume up to 1GB of RAM for caching. Please make sure that your system has sufficient free RAM after the change, so that it does not start to use your swap partition, when it receives a burst of requests. In the given example your <code class="docutils literal notranslate"><span class="pre">/etc/mysql/conf.d/mysql.cnf</span></code> might contain the following lines. (beware that this is the block for mysqld not mysql)</p> <div class="code ini highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">mysqld</span><span class="p">]</span> <span class="n">innodb_buffer_pool_size</span><span class="o">=</span><span class="mi">1</span><span class="n">G</span> <span class="n">innodb_io_capacity</span><span class="o">=</span><span class="mi">4000</span> </pre></div> </div> </div> <div class="section" id="using-redis-based-transactional-file-locking"> <h2>Using Redis-based transactional file locking<a class="headerlink" href="#using-redis-based-transactional-file-locking" title="Permalink to this headline">¶</a></h2> <p>File locking is enabled by default, using the database locking backend. This places a significant load on your database. See the section <a class="reference internal" href="../configuration_files/files_locking_transactional.html"><span class="doc">Transactional file locking</span></a> for how to configure Nextcloud to use Redis-based Transactional File Locking.</p> </div> <div class="section" id="ssl-encryption-app"> <h2>SSL / encryption app<a class="headerlink" href="#ssl-encryption-app" title="Permalink to this headline">¶</a></h2> <p>SSL (HTTPS) and file encryption/decryption can be offloaded to a processor’s AES-NI extension. This can both speed up these operations while lowering processing overhead. This requires a processor with the <a class="reference external" href="http://wikipedia.org/wiki/AES_instruction_set">AES-NI instruction set</a>.</p> <p>Here are some examples how to check if your CPU / environment supports the AES-NI extension:</p> <ul class="simple"> <li>For each CPU core present: <code class="docutils literal notranslate"><span class="pre">grep</span> <span class="pre">flags</span> <span class="pre">/proc/cpuinfo</span></code> or as a summary for all cores: <code class="docutils literal notranslate"><span class="pre">grep</span> <span class="pre">-m</span> <span class="pre">1</span> <span class="pre">^flags</span> <span class="pre">/proc/cpuinfo</span></code> If the result contains any <code class="docutils literal notranslate"><span class="pre">aes</span></code>, the extension is present.</li> <li>Search eg. on the Intel web if the processor used supports the extension <a class="reference external" href="http://ark.intel.com/MySearch.aspx?AESTech=true">Intel Processor Feature Filter</a> You may set a filter by <code class="docutils literal notranslate"><span class="pre">"AES</span> <span class="pre">New</span> <span class="pre">Instructions"</span></code> to get a reduced result set.</li> <li>For versions of openssl >= 1.0.1, AES-NI does not work via an engine and will not show up in the <code class="docutils literal notranslate"><span class="pre">openssl</span> <span class="pre">engine</span></code> command. It is active by default on the supported hardware. You can check the openssl version via <code class="docutils literal notranslate"><span class="pre">openssl</span> <span class="pre">version</span> <span class="pre">-a</span></code></li> <li>If your processor supports AES-NI but it does not show up eg via grep or coreinfo, it is maybe disabled in the BIOS.</li> <li>If your environment runs virtualized, check the virtualization vendor for support.</li> </ul> </div> <div class="section" id="enable-http2-for-faster-loading"> <h2>Enable HTTP2 for faster loading<a class="headerlink" href="#enable-http2-for-faster-loading" title="Permalink to this headline">¶</a></h2> <p>HTTP2 has <a class="reference external" href="https://www.troyhunt.com/i-wanna-go-fast-https-massive-speed-advantage/">huge speed improvements</a> over HTTP with multiple request. Most <a class="reference external" href="http://caniuse.com/#feat=http2">browsers already support HTTP2 over SSL (HTTPS)</a>. So refer to your server manual for guides on how to use HTTP2.</p> </div> <div class="section" id="tune-php-fpm"> <h2>Tune PHP-FPM<a class="headerlink" href="#tune-php-fpm" title="Permalink to this headline">¶</a></h2> <p>If you are using a default installation of php-fpm you might have noticed excessive load times on the web interface or even sync issues. This is due to the fact that each simultaneous request of an element is handled by a separate PHP-FPM process. So even on a small installation you should allow more processes to run. For example on a machine with 4GB of RAM and 1GB of MySQL cache following values in your <code class="docutils literal notranslate"><span class="pre">www.conf</span></code> file should work:</p> <div class="code ini highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pm</span> <span class="o">=</span> <span class="n">dynamic</span> <span class="n">pm</span><span class="o">.</span><span class="n">max_children</span> <span class="o">=</span> <span class="mi">120</span> <span class="n">pm</span><span class="o">.</span><span class="n">start_servers</span> <span class="o">=</span> <span class="mi">12</span> <span class="n">pm</span><span class="o">.</span><span class="n">min_spare_servers</span> <span class="o">=</span> <span class="mi">6</span> <span class="n">pm</span><span class="o">.</span><span class="n">max_spare_servers</span> <span class="o">=</span> <span class="mi">18</span> </pre></div> </div> <p>Depending on your current PHP version you should find this file e.g. under <code class="docutils literal notranslate"><span class="pre">/etc/php/7.2/fpm/pool.d/www.conf</span></code></p> </div> <div class="section" id="enable-php-opcache"> <h2>Enable PHP OPcache<a class="headerlink" href="#enable-php-opcache" title="Permalink to this headline">¶</a></h2> <p>The <a class="reference external" href="http://php.net/manual/en/intro.opcache.php">OPcache</a> improves the performance of PHP applications by caching precompiled bytecode. We recommend at least the following settings:</p> <div class="code ini highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">opcache</span><span class="o">.</span><span class="n">enable</span><span class="o">=</span><span class="mi">1</span> <span class="n">opcache</span><span class="o">.</span><span class="n">interned_strings_buffer</span><span class="o">=</span><span class="mi">8</span> <span class="n">opcache</span><span class="o">.</span><span class="n">max_accelerated_files</span><span class="o">=</span><span class="mi">10000</span> <span class="n">opcache</span><span class="o">.</span><span class="n">memory_consumption</span><span class="o">=</span><span class="mi">128</span> <span class="n">opcache</span><span class="o">.</span><span class="n">save_comments</span><span class="o">=</span><span class="mi">1</span> <span class="n">opcache</span><span class="o">.</span><span class="n">revalidate_freq</span><span class="o">=</span><span class="mi">1</span> </pre></div> </div> <p>For more details check out the <a class="reference external" href="http://php.net/manual/en/opcache.configuration.php">official documentation</a> or <a class="reference external" href="https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html">this blog post about some recommended settings</a>.</p> </div> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="example_ubuntu.html" class="btn btn-neutral float-right" title="Example installation on Ubuntu 18.04 LTS" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="harden_server.html" class="btn btn-neutral" title="Hardening and security guidance" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> © Copyright 2020 Nextcloud GmbH </p> </div> </footer> </div> </div> </section> </div> <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> <span class="rst-current-version" data-toggle="rst-current-version"> <span class="fa fa-book"> Read the Docs</span> v: latest <span class="fa fa-caret-down"></span> </span> <div class="rst-other-versions"> <dl> <dt>Versions</dt> <dd><a href="https://docs.nextcloud.com/server/15/admin_manual">15</a></dd> <dd><a href="https://docs.nextcloud.com/server/16/admin_manual">16</a></dd> <dd><a href="https://docs.nextcloud.com/server/17/admin_manual">17</a></dd> <dd><a href="https://docs.nextcloud.com/server/stable/admin_manual">stable</a></dd> <dd><a href="https://docs.nextcloud.com/server/latest/admin_manual">latest</a></dd> </dl> <dl> <dt>Downloads</dt> </dl> <dl> <dt>On Read the Docs</dt> <dd> <a href="///projects//?fromdocs=">Project Home</a> </dd> <dd> <a href="///builds//?fromdocs=">Builds</a> </dd> </dl> <hr/> Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>. </div> </div> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>