Optimize your server

Support Wissensdatenbank

Du bist hier:

Optimize your own Plesk server for better and faster load times.

Activate GZIP on NGINX

  1. Log on to your server with root via SSH with PuTTY or another SSH program.
  2. Create the following configuration file:
    gzip on;
    gzip_disable "MSIE [1-6]\\.(?!.*SV1)";
    gzip_proxied any;
    gzip_comp_level 5;
    gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/rss+xml text/javascript image/x-icon image/bmp image/svg+xml;
    gzip_vary on;
  3. Execute the following command:# service nginx restart
  4. Check on the following website if GZIP works:
    https://sitechecker.pro/de/gzip-test/Tip: Use a link to an XML or Javascript file.


Activate HTTP/2

  1. Log in to the web administration at https://admin.firestorm.ch.
  2. Open your package and log in to Plesk.
  3. Now click on the icon next to the bell in the upper right corner
  4. Click on Performance and activate HTTP/2

Optimize cache

  1. Open the file /etc/apache2/apache2.conf
  2. Insert the following content at the end of the file:
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule><IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
    </IfModule>#<IfModule mod_headers.c>
    #Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
    #</IfModule><FilesMatch "(^\.|xmlrpc\.php|(liesmich|readme)\.*)">
    Require all denied
  3. Save the file
  4. Restart Apache:
    systemctl service apache2 restart

Optimize MySQL

  1. Execute this command: wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
  2. Execute this command: ./mysqltuner.plThis message should appear on your screen:
    Control warning line(s) into /var/log/mysql/error.log file

    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
    We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
    See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
    (specially the conclusions at the bottom of the page).
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Consider installing Sys schema from https://github.com/mysql/mysql-sys for MySQL
    Consider installing Sys schema from https://github.com/FromDual/mariadb-sys for MariaDB
    Variables to adjust:
    join_buffer_size (> 1.0M, or always use indexes with JOINs)
    innodb_buffer_pool_size (>= 188.1M) if possible.

    This message means, that MySQLTuner found opportunities to optimize the server. Insert the under “Variables to adjust” suggested changes in the file “/etc/mysql/my.cnf” in the section “[mysqld]”.

  3. Edit the file “/etc/mysql/my.cnf” under mysqld according to the received feedback. In our case we set the values as follows:
    join_buffer_size = 5M
    innodb_buffer_pool_size =  256M
  4. Execute the command ./mysqltuner.pl until there is no more need for optimization.
  5. Wait a few days and repeat the command from MySQLTuner again. The longer MySQL works the more accurate the MySQLTuner can give you tips.

War dieser Artikel hilfreich?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
Wie können wir diesen Artikel verbessern?
Please submit the reason for your vote so that we can improve the article.
Brauchst du Hilfe?
Related Post