1

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. enter image description here

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.

EightBitTony
  • 21,373

1 Answers1

1

Unless I'm very much mistaken, you can't create (useful) swap on OpenVZ containers, so you should stop trying to extend the existing swap, I'm not even sure you have the necessary permissions to change the existing swap. It may be defined in OpenVZ, not at the Linux level itself.

It's not real swap, it's fake swap (vSwap), and it doesn't give you any more memory.

You need to resolve your memory issues by either getting more real memory (paying more for your VM) or by reducing your memory use.

EightBitTony
  • 21,373
  • Well, it will be helpful to me if you includes the ways of reducing my memory use. – sirajalam049 Dec 12 '17 at 11:18
  • +1, as this is also useful, and I need to talk to my provider. – sirajalam049 Dec 12 '17 at 11:19
  • 1
    There are lots of answers on here already about running MySQL with a low memory footprint (I alluded to that in a comment on your question), but if you search and can't find help for that specific issue, I suggest you ask a new question with that as the focus. Your existing question is useful because others may ask it, so I suggest you don't remove it or change it from it's existing focus, but start a new question (if you need to - search first, there's plenty of stuff on here already about MySQL memory consumption). – EightBitTony Dec 12 '17 at 11:24
  • Also, I could be wrong, and someone may come along in a bit and explain exactly how to achieve what you need. – EightBitTony Dec 12 '17 at 11:25
  • OK, so I leave this question open, for some other appropriate answers, and then mark the answer in next 2-3 days. Well, Thanks Again. – sirajalam049 Dec 12 '17 at 11:29