gpt4 book ai didi

mysql - tarantool 对 OpenVZ 有帮助吗?

转载 作者:行者123 更新时间:2023-11-29 21:13:20 25 4
gpt4 key购买 nike

我有一个小型 OpenVZ 容器。2 个核心和 4096MB RAM。

我有mysql数据库(总大小为80MB InnoDb)

当我执行 100 个查询(例如 INSERT ON DUPLICATE KEY UPDATE)时,很少有查询的执行时间总是超过 1 秒

mysql> SHOW PROFILE;
+----------------------+----------+
| Status | Duration |
+----------------------+----------+
| checking permissions | 0.000040 |
| creating table | 0.000056 |
| After create | 0.011363 |
| query end | 1.231525 |
| freeing items | 0.000089 |
| logging slow query | 0.000019 |
| cleaning up | 0.000005 |
+----------------------+----------+
7 rows in set (0.00 sec)

当我关闭二进制日志记录时,它有所帮助。所以问题可能出在硬盘上。并在查询执行期间写入二进制日志时发生。

如果我用 tarantool 替换 mysql 会有帮助吗?据我所知,tarantool 也编写二进制日志。

我有percona mysql

mysql> select version();
+-----------------+
| version() |
+-----------------+
| 5.6.25-73.1-log |
+-----------------+
1 row in set (0.01 sec)

这是 my.cnf

[client]
default-character-set = utf8mb4
[mysql]

# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid

# MyISAM #
key-buffer-size = 32M
myisam-recover = FORCE,BACKUP

# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000

# DATA STORAGE #
datadir = /var/lib/mysql/

# BINARY LOGGING #
#log-bin = /var/lib/mysql/mysql-bin
#expire-logs-days = 14
#sync-binlog = 1

# CACHES AND LIMITS #
tmp-table-size = 128M
max-heap-table-size = 128M
query-cache-type = 1
query-cache-size = 32M
max-connections = 1000
thread-cache-size = 128
open-files-limit = 65535
table-definition-cache = 1024
table-open-cache = 2048

# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 256M
innodb_log_buffer_size = 32M
innodb-flush-log-at-trx-commit = 0
innodb-file-per-table = 1
innodb-buffer-pool-size = 1G
innodb_buffer_pool_instances = 1

# LOGGING #
log-error = /var/lib/mysql/mysql-error1.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
long_query_time = 1
log-queries-not-using-indexes = 1
#PERCONA
log_slow_verbosity = microtime,query_plan,innodb

最佳答案

是的,Tarantool 写入“binlogs”(WAL - 预写日志记录)。

毫无疑问,tarantool 比 mysql 更快。但可能 mysql 需要更多的调整。抱歉,我对 mysql 调优不太了解。

关于mysql - tarantool 对 OpenVZ 有帮助吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36176627/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com