Almost identical MySQL server totally different performance
1
vote
1
answer
96
views
I have two servers which differ in mysql version
- Server 1 runs with
mysql 5.7
2 cores Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz and 6GB RAM
- Server 2 runs with mysql 8.0
4cores CPU Intel(R) Xeon(R) Gold 6128 CPU @ 3.40GHz and 24GB RAM, since this is an
**mysql only** server.
Server 1 runs in production, while server 2 is currently my development server.
I use a software, which sends e.g ~11k selects on my products table, which currently holds round about 150k products (so its not that huge).
My problem now is that **server 1** is done with the same task (same data) after 2mins, while **server 2** needs 18mins.
When I execute a single example select SELECT link FROM products WHERE concat(sku, lieferanten_id) = '130928OR1';
MySQL on **server 1** retuns an answer in 0.05 s, **server 2** in 0.06s
If I repeat the same select **server 1** is done after 0.00s, while **server 2** still needs the exact same amount of 0.06s.
Below is my /etc/mysql/my.cnf
#Max MysQL memory: 662.8M
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
#datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
# GENERAL #
default-storage-engine = InnoDB
# NETWORK #
max_allowed_packet = 999M
max_connect_errors = 100000
bind-address = 0.0.0.0
skip-name-resolve
skip-external-locking
# DATA STORAGE #
datadir = /var/lib/mysql
# CACHES AND LIMITS #
tmp-table-size = 1024M
max-heap-table-size = 1024M
max_connections = 100
thread-cache-size = 64
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4000
group_concat_max_len = 320000
thread_stack = 1M
# TIMEOUTS #
interactive_timeout = 300
wait_timeout = 360
# INNODB #
innodb-flush-method = fsync
innodb-flush-neighbors = 1
# innodb-log-files-in-group = 2
innodb_redo_log_capacity = 67108864
innodb-log-file-size = 32M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-undo-log-truncate = ON
innodb-rollback-segments = 128
innodb_buffer_pool_size = 18432M
innodb_thread_concurrency = 4
# LOGGING #
log-error = /var/log/mysql/error.log
log-queries-not-using-indexes = 1
slow-query-log = 0
slow-query-log-file = /var/lib/mysql/mysql-slow.log
# CHARACTER AND COLLATION #
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
explicit_defaults_for_timestamp = 1
Are there any values I totally tuned in the wrong way? Or is my **server 1** just "faster" because of MySQL 5.7, which uses query-caching?
If there is something I should also provide, please let me know
thanks in advance!
Edit:
my pastebin link contains output of **mysql-tuner** and SELECT name, count FROM information_schema.innodb_metrics ORDER BY name;
from my **server 2**
https://pastebin.com/yBScuLLZ
Asked by kekw
(111 rep)
Sep 26, 2023, 04:39 PM
Last activity: Sep 26, 2023, 07:15 PM
Last activity: Sep 26, 2023, 07:15 PM