我确实阅读并关注了以下两篇帖子:
但我仍然收到此错误:
Jun 18 06:06:32 hamid kernel: [42478.128706] Out of memory: Kill process 25316 (mysqld) score 231 or sacrifice child
Jun 18 06:06:32 hamid kernel: [42478.136353] Killed process 25316 (mysqld) total-vm:1354312kB, anon-rss:291300kB, file-rss:0kB, shmem-rss:0kB
Jun 18 06:06:32 hamid kernel: [42478.212879] oom_reaper: reaped process 25316 (mysqld), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
我有 1GB RAM VPS(通过 Virtualmin 运行 WooCommerce 网站),但我不确定内存是否足够。
MySQL 配置:
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[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
performance_schema = off
bind-address = 127.0.0.1
key_buffer_size = 16M
max_allowed_packet = 64M
thread_stack = 192K
thread_cache_size = 8
myisam-recover-options = BACKUP
query_cache_limit = 2M
query_cache_size = 64M
query_cache_type = 1
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
default-storage-engine = InnoDB
innodb_buffer_pool_size= 250M
并运行了 mysqltuner ,给出如下结果:
-------- Recommendations ------------------------------------------------------- --------------------
General recommendations:
Control warning line(s) into /var/log/mysql/error.log file
Control error line(s) into /var/log/mysql/error.log file
MySQL started within last 24 hours - recommendations may be inaccurate
Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=1
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries which have no LIMIT clause
Variables to adjust:
query_cache_size (=0)
query_cache_type (=0)
query_cache_limit (> 2M, or use smaller result sets)
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
innodb_log_file_size * innodb_log_files_in_group should be equal to 1/4 of buffer pool size (=128M) if possible.
在 Virtualmin 资源使用率中,崩溃发生之前,我的 CPU 和交换为 100%,RAM 为 50%。
答案1
答案2
我增加了交换大小并且我认为问题解决了
答案3
我在 NUC 12th Gen i7 /32GB / m.2 2TB 上运行 ETH Validator,用于验证器 / SSD 500GB,用于 Windows 11 Pro 系统,并使用最新版本的 Ubuntu 的 VM指导。每 24 小时我的所有验证器都会瘫痪,然后我就收到这个信息。
终止进程: