I am starting this question despite it seems like this question, but it isn't. I am getting different outputs from the commands as given in that question.
Now I want to show you my scenario.
From my knowledge of operating systems, virtual memory is used to swap the files from main memory which are not used frequently and free up space for other active programs and files. My MySQL Database Server
is getting killed by own, and I don't know why, and I think this is because of the Virtual Memory
.
So, I want to increase my Virtual Memory.
I read from this link, but again the outputs are a bit different like I don't have some like sda1
or something. I don't have any knowledge of Linux
so please explain in more basic terms. I don't know any command neither know what a command does.
Here some of the outputs of the commands.
swapon -s
Filename Type Size Used Priority
/dev/null partition 524288 516556 -1
free -m
total used free shared buffers cached
Mam: 1024 734 289 128 0 74
-/+ buffers/chahe: 660 363
Swap: 512 504 7
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/simfs 40G 3.1G 37G 8% /
none 256M 4.0K 256M 1% /dev
So please tell me how can I increase the Virtual Memory size?
Edit
This question marked duplicate but again my terminal giving different output than in this answer.
dd if=/dev/zero of=/raid1/swapfile bs-1M count=8192
dd : opening `/raid1/swapfile': No such file or directory
I don't have idea what a mdadm RAID
is.
/dev/null
as a swap file sure seems interesting. – ilkkachu Dec 12 '17 at 07:46/dev/simfs
implies you're running a virtual machine using OpenVZ, which likely means you're paying someone to provide this machine for you. Your best bet, is to speak to your hosting provider (or check in their support forum if they have one), because OpenVZ containers don't use swap in a traditional sense. Your actual issue is running out of memory and having MySQL killed, check on here for reducing MySQL's memory requirements, or running low memory configurations. – EightBitTony Dec 12 '17 at 07:56