3

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

Melebius
  • 11,121
  • 8
  • 50
  • 77
user3636770
  • 33
  • 1
  • 6
  • Does this answer your question? [How can I monitor the memory usage?](https://askubuntu.com/questions/9642/how-can-i-monitor-the-memory-usage) 1GB RAM is pretty low value even for a not really busy server. Check your memory usage and [edit] your question to provide details if you find you aren’t exhausting your RAM (but I guess you are…). – Melebius Jun 18 '20 at 06:57
  • 1
    in virualmin resource usage , before crash happen my cpu and swap is 100% , and ram is 50% – user3636770 Jun 18 '20 at 07:18

3 Answers3

1

in virualmin resource usage , before crash happen my cpu and swap is 100% , and ram is 50%

These values definitely mean your RAM value is too low. You should watch the current RAM usage together with swap usage as the OS is swapping in advance when there is a risk of RAM exhaustion.

Swap is generally used when RAM is exhausted. Swap is a (slower) substitute of RAM when there is not enough RAM available, so a server should not really use swap. (Its real long-term usage could be something like 1 or 2 %.)

Melebius
  • 11,121
  • 8
  • 50
  • 77
0

i increased swap size and i think problem solved

user3636770
  • 33
  • 1
  • 6
  • Well, it might prevent hard crashes of your processes but if you added more RAM, the performance would be better. See [my answer](https://askubuntu.com/a/1251464/250300) for details. – Melebius Jun 18 '20 at 08:20
  • i will upgrade my ram as you advice @Melebius – user3636770 Jun 18 '20 at 08:27
0

I'm running ETH Validator on NUC 12th Gen i7 /32GB / m.2 2TB for validator / SSD 500GB for a Windows 11 Pro system and a VM with latest version of Ubuntu by this guide. Every 24 hours all my validators are down and I'm getting this.

Killed process:

Killed Process

karel
  • 110,292
  • 102
  • 269
  • 299
alesk76
  • 1
  • 1
  • This is the second question where I find you have added your own question as the answer. Please do not do this. – David Apr 10 '23 at 10:23
  • 1
    This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://askubuntu.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://askubuntu.com/help/whats-reputation), you can also [add a bounty](https://askubuntu.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/1291818) – David Apr 10 '23 at 10:23