mysqld out of memory: Kill process

I did read and followed these 2 posts:

but I still get this error:

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

I have 1GB RAM VPS (running WooCommerce site by Virtualmin) and I’m not sure if it’s enough memory.

MySQL config:

[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

and did run mysqltuner , give this :

-------- 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.

In Virtualmin resource usage, before the crash happens my CPU and swap are 100%, and RAM is 50%.

2
задан 18 June 2020 в 11:30

2 ответа

Я увеличил размер свопа и думаю, что проблема решена

0
ответ дан 19 June 2020 в 21:23

в использовании ресурсов virualmin, до сбоя мой процессор и своп составляют 100%, а оперативная память - 50%

Эти значения определенно означают, что значение вашей ОЗУ слишком мало . Вы должны следить за текущим использованием ОЗУ вместе с использованием подкачки, поскольку операционная система меняет местами заранее , когда существует риск исчерпания ОЗУ.

Своп обычно используется, когда ОЗУ исчерпано. Подкачка является (медленнее) заменой оперативной памяти , когда недостаточно доступной оперативной памяти, поэтому сервер не должен действительно использовать подкачку. (Его реальное долгосрочное использование может составлять примерно 1 или 2%.)

0
ответ дан 19 June 2020 в 21:23

Другие вопросы по тегам:

Похожие вопросы: