VPS swap memory is 0

Discussion in 'General' started by torboy, May 8, 2009.

  1. torboy

    Joined:
    Apr 30, 2009
    Messages:
    37
    Likes Received:
    0
    After 2 weeks of trying finally was able to install Elastix 1.5.2 on VPS but my 384MB memory is not enough and the swap is set to zero how can I change that.

    Code:
    top - 22:21:21 up  4:31,  1 user,  load average: 0.43, 0.47, 0.46
    Tasks:  73 total,   1 running,  72 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 75.0%id, 25.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:    393216k total,   385948k used,     7268k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,        0k cached
    

    thanks
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    just to normalize:
    (from bash as root)

    swapon -a

    to mount all swap entries in fstab

    free

    to see if there is any swap space. if still none, back to basics . .

    cat /etc/fstab

    will show you your mounted partitions swap and otherwise, it will normally largely reflect the output of

    fdisk -l /dev/<hdd>

    which will identify any swap partitions on the HD

    if you have a partition with ID 82 (swap) feel free to add it to fstab (perhaps mkswap it first, just for shits and grins) (it should be there already) , if not you can make a file, mkswap it and add it as swap space to fstab (google is your friend).

    If you need to make a swap file, I suggest you don't make it bigger than 512K given your physical memory or you will thrash yourself to death under load. (and your already at .4+ )

    a final

    swapon -a
    free

    will confirm the efficacy of your process.

    [edit]
    whoops I see we are here in Newbies, but if you got this far I will assume have the resourcefulness to take it from here, Please excuse my terseness!
     
  3. torboy

    Joined:
    Apr 30, 2009
    Messages:
    37
    Likes Received:
    0
    You are right, I am newbie!
    could you explain in more detail on codes

     
  4. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    OK,


    please post the output of

    mount

    which lists the mounted file systems

    and

    cat /proc/partitions

    which will describe the partitions available on your disk(s)
     
  5. torboy

    Joined:
    Apr 30, 2009
    Messages:
    37
    Likes Received:
    0
    Code:
    [root@pbx ~]# mount
    simfs on / type simfs (rw)
    /proc on /proc type proc (rw)
    /sys on /sys type sysfs (rw)
    none on /dev/pts type devpts (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    
    [root@pbx ~]# cat /proc/partitions
    cat: /proc/partitions: No such file or directory
    on a different note:

    Everytime I restart my VPS I have to type asterisk in CLI so asterisk starts.
    How can I added asterisk to start at bootup
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    then with the file system you have, you are restricted to using a swapfile if you want to see swap space, it is possible that the virtualization manages swap space outside the physical machine, I would ask them first.

    if you want a swap file

    dd if=/dev/zero of=/swapfile bs=1024 count=512
    mkswap /swapfile

    and add it to fstab to be mounted at boot time

    /swapfile swap swap defaults 0 0

    swapon -a
    and
    free (or as you used, top)

    will then I hope show you have swap space.
     
  7. torboy

    Joined:
    Apr 30, 2009
    Messages:
    37
    Likes Received:
    0
    and how to start asterisk at bootup
     
  8. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Ahh!

    init scripts!!

    the init scripts are normally in /etc/rc.d, do you have that? they are softlinked to the different "run level" structures for example /etc/rc.d/rc3.d (run level 3) should have a bunch of files in it (does it?) the scripts are called sequentially at startup S00* then S01* etc and on shutdown K99* (K for kill) then K98* etc..

    If you have a standard script called setup in your Centos build you can turn on and off what you want/need S90asterisk would normally be present and be a softlink to /etc/init.d/asterisk

    unless you hacked it all to pieces (then google would be your friend) I think even in your environment these structures should exist, does it not start right now on boot?
     
  9. bucasia

    Joined:
    Feb 15, 2009
    Messages:
    36
    Likes Received:
    0
    There's a good chance if there's no swap memory that this is an OpenVZ VPS which doesn't support swap memory at all on the VPS
     
  10. chopeta

    Joined:
    Jun 18, 2009
    Messages:
    10
    Likes Received:
    0
  11. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
    torboy,

    If you can manage to create a openVZ template we would be more than glad to uplad it to the sourceforge website.

    best regards,

    Rafael
     
  12. torboy

    Joined:
    Apr 30, 2009
    Messages:
    37
    Likes Received:
    0
    I downloaded elastix ISO files on my home pc, unpack using zip7, copied all the files to VPS /mnt/elastix-cd and them followed instruction after
    Code:
    ls /mnt/elastix-cd/Elastix/kernel-2.* 
    It wasnt working very good I kept running out of memory I had 256MB RAM. basicly I could access my UI for elastix or freePBX only 3 or 4 times before I would run of out memory.

    finally I bought a Template from anther person. the Template is working fine except hylafax is not working properly. my ram is now 384MB
     
  13. chopeta

    Joined:
    Jun 18, 2009
    Messages:
    10
    Likes Received:
    0
    I think I found the reason why we don't have a OpenVZ template for Elastix :)

    Maldita sea!

    Refa, let me know as soon as you got the email with the template from elkabong.

    Regards,
    chopeta
     

Share This Page