mysql server optimieren

  • Hallo,

    ich habe zwei Blogs, ein Blog hat viele tausende
    Artikel.
    Wenn ich etwas Suche oder Beiträge lösche, dann dauert das schon ne
    gewisse Zeit (paar Sekunden).

    Ich denke mit einer optimalen
    Mysql-Konfiguration sollte sich das ja beheben lassen.

    Server hat genug
    Leistung (32GB Ram)

    Meine my.cnf


    key_buffer = 7750M
    max_allowed_packet = 16M
    thread_stack = 192K
    thread_cache_size = 8
    max_heap_table_size = 2024M
    tmp_table_size = 2024M
    myisam-recover = BACKUP
    max_connections = 1500
    query_cache_limit = 4M
    query_cache_size = 256M


    Wordpress DB ist etwa 1.5GB groß.

    Hoffe auf Hilfe. Danke im Voraus.

    • Anzeige

    Hallo!

    Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.

    • ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
    • ✔️ Deutsche Server & DSGVO-konform
    • ✔️ Persönlicher Support (kein 0815-Ticket-System)

    Mehr erfahren

  • Hier die Werte:


  • Datenbankserver Optimierung ist recht langwierig bzw. gar nicht einfach. Ich würde erst mal anfangen, die Hinweise umzusetzen

    Code
    Variables to adjust:
        query_cache_size (> 256M)

    Wichtig ist noch, das du mind. 24h wartest bzw. dann schaust, ob sich was geändert hat.

  • Habe jetzt paar Tage mysql-server laufen lassen:
    QUERY CACHE
    Query cache is enabled
    Current query_cache_size = 256 M
    Current query_cache_used = 227 M
    Current query_cache_limit = 4 M
    Current Query cache Memory fill ratio = 88.69 %
    Current query_cache_min_res_unit = 4 K
    However, 1430808 queries have been removed from the query cache due to lack of memory
    Perhaps you should raise query_cache_size
    MySQL won't cache query results that are larger than query_cache_limit in size

    TEMP TABLES
    Current max_heap_table_size = 1.97 G
    Current tmp_table_size = 1.97 G
    Of 1038733 temp tables, 37% were created on disk
    Perhaps you should increase your tmp_table_size and/or max_heap_table_size
    to reduce the number of disk-based temporary tables
    Note! BLOB and TEXT columns are not allow in memory tables.
    If you are using these columns raising these values might not impact your
    ratio of on disk temp tables.

    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 1G (Tables: 39)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
    [!!] InnoDB is enabled but isn't being used
    [!!] Total fragmented tables: 4
    -------- Security Recommendations -------------------------------------------
    [!!] User '@localhost' has no password set.
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 4d 2h 24m 31s (331M q [934.839 qps], 863K conn, TX: 506B, RX: 24B)
    [--] Reads / Writes: 96% / 4%
    [--] Total buffers: 9.9G global + 2.7M per thread (1500 max threads)
    [OK] Maximum possible memory usage: 13.9G (44% of installed RAM)
    [OK] Slow queries: 0% (6/331M)
    [OK] Highest usage of available connections: 3% (57/1500)
    [OK] Key buffer size / total MyISAM indexes: 7.6G/284.5M
    [OK] Key buffer hit rate: 100.0% (5B cached / 2M reads)
    [OK] Query cache efficiency: 90.9% (296M cached / 326M selects)
    [!!] Query cache prunes per day: 348957
    [OK] Sorts requiring temporary tables: 1% (14K temp sorts / 1M sorts)
    [!!] Temporary tables created on disk: 37% (619K on disk / 1M total)
    [OK] Thread cache hit rate: 99% (1K created / 863K connections)
    [!!] Table cache hit rate: 13% (205 open / 1K opened)
    [OK] Open file limit used: 3% (251/7K)
    [OK] Table locks acquired immediately: 99% (32M immediate / 32M locks)
    -------- Recommendations -----------------------------------------------------
    General recommendations:
    Add skip-innodb to MySQL configuration to disable InnoDB
    Run OPTIMIZE TABLE to defragment tables for better performance
    Enable the slow query log to troubleshoot bad queries
    Increasing the query_cache size over 128M may reduce performance
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Increase table_cache gradually to avoid file descriptor limits
    Variables to adjust:
    query_cache_size (> 256M) [see warning above]
    table_cache (> 400)

  • Ich würde erst mal weiter die Empfehlungen umsetzen. Allerdings muss ich auch zugeben, ist die Optimierung von Datenbankenserver nicht 100% meine Stärke. Du kannst dich aber mit dem Problem an das Root-Forum wenden, dort sind 100% Leute, die dir da weiterhelfen können.

    http://www.rootforum.org/forum/

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!