Server optimieren - FireStorm ISP

Server optimieren

Support Wissensdatenbank

Du bist hier:
Print

Optimiere deinen eigenen Plesk Server für bessere und schnellere Ladezeiten.

 

GZIP bei Nginx aktivieren

  1. Logge dich mit root über SSH mit PuTTY oder einem anderen SSH Programm auf deinen Server ein.
  2. Erstelle folgende Konfigurationsdatei:/etc/nginx/conf.d/gzip.conf##
    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. Führe folgenden Befehl aus:# service nginx restart
  4. Prüfe auf folgender Webseite ob GZIP funktioniert:https://sitechecker.pro/de/gzip-test/Tipp: Verwende einen Link zu einer XML oder Javascript Datei.

 

HTTP2 aktivieren

  1. Logge dich in die Webadministration unter https://admin.firestorm.ch ein.
  2. Öffne dein Paket und logge dich in Plesk ein.
  3. Klicke nun oben rechts auf das Icon neben der Glocke
  4. Klicke nun auf Performance und aktiviere HTTP/2

Cache optimieren

  1. Öffne die Datei /etc/apache2/apache2.conf
  2. Füge folgenden Inhalt am Ende der Datei hinzu:
    <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>
    <FilesMatch "(^\.|xmlrpc\.php|(liesmich|readme)\.*)">
    Require all denied
    </FilesMatch>
  3. Speichere die Datei
  4. Starte Apache neu:
    systemctl service apache2 restart

MySQL optimieren

  1. Führe den Befehl wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl aus
  2. Führe den Befehl ./mysqltuner.pl aus
    Jetzt sollte so eine Nachricht erscheinen,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.

    Diese Nachricht bedeutet, dass der MySQLTuner noch Optimierungsmöglichkeiten gefunden hat. Setze die unter “Variables to adjust” vorgeschlagenen Änderungen in der Datei “/etc/mysql/my.cnf” unter dem Abschnitt “[mysqld]” ein.

  3. Editiere die Datei “/etc/mysql/my.cnf” unter mysqld gemäss der empfangenen Rückmeldung. In unserem Fall setzen wir die Werte wie folgt:
    [mysqld]
    join_buffer_size = 5M
    innodb_buffer_pool_size =  256M
    # * Fine Tuning
    #
    key_buffer_size		= 16M
    max_allowed_packet	= 16M
    thread_stack		= 192K
    thread_cache_size       = 8
    # This replaces the startup script and checks MyISAM tables if needed
    # the first time they are touched
    myisam-recover-options  = BACKUP
    #max_connections        = 100
    #table_cache            = 64
    #thread_concurrency     = 10
    #
    # * Query Cache Configuration
    #
    query_cache_limit	= 1M
    query_cache_size        = 16M
    

     

  4. Führe den Befehl ./mysqltuner.pl so lange aus, bis kein Optimierungsbedarf mehr besteht.
  5. Warte ein paar Tage ab und wiederhole den Befehl von MySQLTuner erneut. Je länger MySQL arbeitet umso genauer kann der MySQLTuner Tipps geben.

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