Sample Header Ad - 728x90

Why is the execution time on Datagrip longer on MySQL 8 than MySQL 5.7 on a new Linux Server?

1 vote
1 answer
657 views
I am migrating from a 4 year old setup to a brand new high performance server and am experiencing slower performance than on the old machine. The old setup is a Ubuntu 16.04 Server on bare metal Intel i7 64G RAM and MySQL 5.7 and is under medium load with many services running. The new setup is an AMD Ryzen™ 9 5950X with 128G RAM, no load and only MySQL 8 running on Ubuntu 20.04. Both are bare metal machines and I am the only one who can access it. Now the database I am testing against holds a table with 100M rows. The new one holds an exact copy, imported after a mysqldump. I am running the exact same simple query without any join, just from one table. **The old server returns the result in about 120ms the new one returns in about 200ms.** > 10 rows retrieved starting from 1 in 192 ms (execution: 184 ms, > fetching: 8 ms) I am using DataGrip for the query (connected via SSH). If I connect via SSH terminal directly and use MySQL on the console the result is returned in 0.00s How is that even possible? I did run a few tests via mysqltuner, but found nothing that might be of help. Here is part of the the my.cnf from the new server: [mysqld] default_authentication_plugin= mysql_native_password innodb_buffer_pool_size = 100G innodb_buffer_pool_instances = 64 innodb_buffer_pool_chunk_size = 134217728 innodb_log_file_size = 12G collation_server = utf8_unicode_ci character_set_server = utf8 This is mysqltuner output: mysqltuner >> MySQLTuner 1.7.13 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering [--] Skipped version check for MySQLTuner script Please enter your MySQL administrative login: root Please enter your MySQL administrative password: [!!] Currently running unsupported MySQL version 8.0.25-0ubuntu0.20.04.1 [OK] Operating on 64-bit architecture -------- Log file Recommendations ------------------------------------------------------------------ [--] Log file: /mnt/mysql/data/leo.err(0B) [!!] Log file /mnt/mysql/data/leo.err doesn't exist [!!] Log file /mnt/mysql/data/leo.err isn't readable. -------- Storage Engine Statistics ----------------------------------------------------------------- [--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA [--] Data in InnoDB tables: 16.8G (Tables: 39) [OK] Total fragmented tables: 0 -------- Analysis Performance Metrics -------------------------------------------------------------- [--] innodb_stats_on_metadata: OFF [OK] No stat updates during querying INFORMATION_SCHEMA. -------- Security Recommendations ------------------------------------------------------------------ [--] Skipped due to unsupported feature for MySQL 8 -------- CVE Security Recommendations -------------------------------------------------------------- [OK] NO SECURITY CVE FOUND FOR YOUR VERSION -------- Performance Metrics ----------------------------------------------------------------------- [--] Up for: 1m 47s (419 q [3.916 qps], 45 conn, TX: 402K, RX: 35K) [--] Reads / Writes: 100% / 0% [--] Binary logging is enabled (GTID MODE: OFF) [--] Physical Memory : 125.8G [--] Max MySQL memory : 104.2G [--] Other process memory: 136.7M [--] Total buffers: 104.0G global + 1.1M per thread (151 max threads) [--] P_S Max memory usage: 72B [--] Galera GCache Max memory usage: 0B [OK] Maximum reached memory usage: 104.0G (82.72% of installed RAM) [OK] Maximum possible memory usage: 104.2G (82.85% of installed RAM) [OK] Overall possible memory usage with other process is compatible with memory available [OK] Slow queries: 0% (0/419) [OK] Highest usage of available connections: 1% (2/151) [!!] Aborted connections: 4.44% (2/45) [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance [--] Query cache have been removed in MySQL 8 [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 19 sorts) [!!] Joins performed without indexes: 18 [OK] Temporary tables created on disk: 0% (0 on disk / 23 total) [OK] Thread cache hit rate: 95% (2 created / 45 connections) [OK] Table cache hit rate: 80% (327 open / 408 opened) [OK] Open file limit used: 0% (2/10K) [OK] Table locks acquired immediately: 100% (9 immediate / 9 locks) [OK] Binlog cache memory access: 0% (0 Memory / 0 Total) -------- Performance schema ------------------------------------------------------------------------ [--] Memory used by P_S: 72B [--] Sys schema is installed. -------- ThreadPool Metrics ------------------------------------------------------------------------ [--] ThreadPool stat is disabled. -------- MyISAM Metrics ---------------------------------------------------------------------------- [!!] Key buffer used: 18.2% (3M used / 16M cache) [!!] Cannot calculate MyISAM index size - re-run script as root user -------- InnoDB Metrics ---------------------------------------------------------------------------- [--] InnoDB is enabled. [--] InnoDB Thread Concurrency: 0 [OK] InnoDB File per table is activated [OK] InnoDB buffer pool / data size: 104.0G/16.8G [OK] Ratio InnoDB log file size / InnoDB Buffer pool size: 12.0G * 2/104.0G should be equal 25% [OK] InnoDB buffer pool instances: 64 [--] Number of InnoDB Buffer Pool Chunk : 832 for 64 Buffer Pool Instance(s) [OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances [!!] InnoDB Read buffer efficiency: 13.96% (5858 hits/ 41974 total) [OK] InnoDB Write log efficiency: 98.44% (630 hits/ 640 total) [OK] InnoDB log waits: 0.00% (0 waits / 10 writes) -------- AriaDB Metrics ---------------------------------------------------------------------------- [--] AriaDB is disabled. -------- TokuDB Metrics ---------------------------------------------------------------------------- [--] TokuDB is disabled. -------- XtraDB Metrics ---------------------------------------------------------------------------- [--] XtraDB is disabled. -------- Galera Metrics ---------------------------------------------------------------------------- [--] Galera is disabled. -------- Replication Metrics ----------------------------------------------------------------------- [--] Galera Synchronous replication: NO [--] No replication slave(s) for this server. [--] Binlog format: ROW [--] XA support enabled: ON [--] Semi synchronous replication Master: Not Activated [--] Semi synchronous replication Slave: Not Activated [--] This is a standalone server -------- Recommendations --------------------------------------------------------------------------- General recommendations: MySQL was started within the last 24 hours - recommendations may be inaccurate Reduce or eliminate unclosed connections and network issues Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1 Adjust your join queries to always utilize indexes Variables to adjust: join_buffer_size (> 256.0K, or always use indexes with JOINs) What is a recommended aproach to narrow down the problem?
Asked by merlin (323 rep)
May 15, 2021, 05:18 PM
Last activity: Jun 15, 2021, 01:23 AM