Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


CANNOT run MySQL on a 128MB OpenVZ?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

CANNOT run MySQL on a 128MB OpenVZ?

fkjfkj Member

I was using a fresh-installed-Ubuntu-12.04-based 128MB OpenVZ from OneAsiaHost.

But I couldn't install MySQL using apt-get. I got some errors like "FATAL -> Failed to fork." (looks like a memory issue) but the memory usage is only some 100MB from top and 100% of them were cache.

I submitted a ticket and were told that 128MB is too little to run MySQL as the base OS is already reserving close to 100MB of RAM. So I switched to CentOS, but this time I can install MySQL without problems.

I have installed MySQL on 128MB OpenVZs from other providers, so I'm not sure whether this is a issue with OpenAsiaHost or a common issue. Any one has the same problem here?

«1

Comments

  • blackblack Member

    How big is your database? What does your my.cnf look like?

  • fkjfkj Member

    @black said:
    How big is your database? What does your my.cnf look like?

    It's a raw installation, I just run apt-get install mysql-server, then it reported that mysql failed to setup.

  • According to my experience it seems burstable (not vswap) OpenVZ with low ram have problem regarding this.

  • ATHKATHK Member

    I've installed MySQL on a 128MB OVZ VPS before you need to configure some stuff.

    Enough about me.. Your answer may be here http://lowendtalk.com/discussion/1942/need-help-128mb-vps

  • wychwych Member

    Maybe its not a minimal template that your using, hence the increased RAM consumption.

    What does top/htop show before you try and install?

  • fkjfkj Member

    @nullnull said:
    According to my experience it seems burstable (not vswap) OpenVZ with low ram have problem regarding this.

    Yes, OneAsiaHost use the burstable OpenVZ. Can you provide some more detail?

  • earlearl Member

    Maybe you can ask your host to temporary raise your memory so you can install mysql and then change the my.cnf file to lower the memory usage by disabling innodb.

    I forgot if you can actually disable innodb from the install, I'm sure that is what is causing your install to fail..

    old but you can read this too.
    http://lowendbox.com/blog/reducing-mysql-memory-usage-for-low-end-boxes/

  • My 50Mb vps have mysql running for a wordpress blog. Do you have other process eating the memory?

  • My 50Mb vps have mysql running for a wordpress blog. Do you have other process eating the memory?

  • AThomasHoweAThomasHowe Member
    edited May 2014

    You should be able to run MySQl in about 5-10MB RAM. It obviously won't perform great under stress but it's certainly not only for high-RAM systems.

    Are you running anything else? Can you post the results of ps aux or top? And also cat /etc/mysql/my.cnf. Maybe it's the default settings?

    I have run MySQL okay on 64MB with one user (me), so it's possible.

  • M66BM66B Veteran

    For MySQL with little RAM, disable InnoDb as suggested and set the parameters 'query_cache_size' and 'key_buffer' to lower values. See here for how to: http://blog.bokhorst.biz/6507/computers-and-internet/how-to-setup-a-vps-as-web-server/#setup_mysql (you propably need to set the values lower than described)

  • msg7086msg7086 Member
    edited May 2014

    @fkj said:
    Yes, OneAsiaHost use the burstable OpenVZ. Can you provide some more detail?

    There are basically two numbers regarding to memory usage, one is called virtual (the process asked for) and another is resident (the process actually used). Similar concept is used in Windows (commit vs private working set).

    In (old) burst-able model, the (old) kernel counts memory consumption based on how much you asked for. Since the innodb engine will ask for lots of memory when startup, it will simply fail at once. However in the vswap model, the new kernel counts towards to the resident memory usage, and thus you can get much more free memory and you can use innodb without a single problem.

    For example I have a mid-size database with ~10G of data and tuned up. It uses 2032M VIRT and 306M RES at this moment. To run this mysql process, you'll need either a 3GB burstable vps (at least 2GB burstable to 3GB), or a 512M vswap based vps (at least 256M+256M vswap).

  • jcalebjcaleb Member

    You should minimize your base installation first. Try minstall from maxexcloo

    Thanked by 1netomx
  • If i remember correctly, MySQL from Oracle uses 64 mb key_buffer by default and 64 mb buffer for InnoDB. So totally 128 is the minimal memory you need to run server with default settings. However minimal system also takes 5-10 mbytes, so you need 256 mb memory or tweaking (but it's very very very bad idea, it'll not work correctly with low memory) :)

  • Running mysql on anything under 512MB is ridiculous since it'll most likely rape the disk IO. RAM is much more cheaper than disk IO.

  • M66BM66B Veteran

    I don't see any reason why the key and query buffer cannot be set to a low value, like 4 MB. It will not be good for performance, but might be acceptable for what needs to be done.

  • VMNodeVMNode Member

    It depends on the database size really and how much IO there is.

  • MaouniqueMaounique Host Rep, Veteran

    serverian said: Running mysql on anything under 512MB is ridiculous since it'll most likely rape the disk IO. RAM is much more cheaper than disk IO.

    Yes, but it depends what it is used for, if only for some site with 1-2 visitors a day, the host wont die if there is some disk activity twice a day.
    Personally i dont use 128 boxes again, 256 is the lowest I have and in the future 512 will be my lowest limit. That is because I can get 256 for 1 $ a month, wont go to 128 even if it was 50 cents.

  • @Maounique said:
    Personally i dont use 128 boxes again, 256 is the lowest I have and in the future 512 will be my lowest limit. That is because I can get 256 for 1 $ a month, wont go to 128 even if it was 50 cents.

    Agreed.

    @fkj post a screenshot from running the top command, or the results from dpkg --get-selections

    Thanked by 1netomx
  • Maybe it's just me (and because I have nothing important to host really and I have the time to do it) but I quite like the challenge of using micro instances (64MB-128MB). Helps you can get nice cheap yearlies too.

    I wouldn't mind trying out a 32MB box in the right location at the right price.

  • raindog308raindog308 Administrator, Veteran

    said: I was using a fresh-installed-Ubuntu-12.04-based 128MB OpenVZ from OneAsiaHost.

    I would use a more minimal distro - Debian 6 or 7 minimal. You can squeeze Deb 6 into 7 MB of RAM. I don't think Ubuntu is really designed for small systems.

    black said: How big is your database?

    What's more important is what the MySQL vars are. I haven't run MySQL on a 128 in a while, but the current 5.6 may not be appropriate - Maria is an alternative. I think from 5.5 on, InnoDB is on by default and that's a big use of memory.

    This recipe has been floating around LowEndLand for a long time:

    skip-bdb
    skip-innodb
    skip-networking
    server-id = 1
    key_buffer = 256K
    max_allowed_packet=1M
    thread_stack = 64K
    table_cache = 4
    sort_buffer_size = 64K
    read_buffer_size = 256K
    read_rnd_buffer_size = 256K
    net_buffer_length = 2K
    thread_stack = 64K
    query_cache_limit=256K
    query_cache_size = 2M
    

    I haven't validated it myself.

    serverian said: Running mysql on anything under 512MB is ridiculous since it'll most likely rape the disk IO.

    Meh...a mid-sized Wordpress DB is what, 20MB? And you read it in kilobyte chunks. I wouldn't run facebook.com on a 128 but for a small Wordpress blog, why not. What's going to drive MySQL usage is either big workload, tuning parms, or concurrency. Running a personal MediaWiki notebook or small blog is fine...running something with many visitors or data analysis is not.

    Low End People! You have forgotten your heritage. LEA is spinning in his grave now.

    Here he is running Wordpress on a 64MB: http://lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/

    AThomasHowe said: I wouldn't mind trying out a 32MB box in the right location at the right price.

    Ah! A worthy reader.

    I don't know if anyone is still doing 32s, but @KuJoe still has 64s:

    https://securedragon.net/openvz.php

    Thanked by 2AThomasHowe M66B
  • @raindog308 I am actually SSH'd into my 64MB box in Atlanta right now :)

    Thanked by 1raindog308
  • raindog308raindog308 Administrator, Veteran

    AThomasHowe said: I am actually SSH'd into my 64MB box in Atlanta right now :)

    I nominate AThomasHowe for the Spirit of LEA award.

    The rest of you 1GB people...for shame...

    Thanked by 2AThomasHowe netomx
  • :)

    A decade or two ago people were hosting huge services on boxes with 32MB RAM or less, even stuff with thousands of simultaneous connections like IRC servers. Obviously needs have changed and so have system requirements but it'll be a long time before 32MB is useless!

    God forbid some of you ever play with embedded systems ;P

  • You may want to turn off InnoDB and use only MyISAM to save memory consumption.

  • MaouniqueMaounique Host Rep, Veteran

    I used to have a lot of fun with 48-64 KB, not MB. But that is different today.
    I agree it is fun to run small boxes and I do at home running a laptop with 80 MB in total and a vm with 12 for Win 95. But that is just for fun, did it some time ago when I was to ill to do anything else.
    You can run a 10 MB ovz I presume for a ssh tunnel or something, but why not put a lot of things on a larger box than buy a lot of small ones? You save a lot of IPv4.

    Thanked by 1Dylan
  • Why? To know your system better, as a challenge, to become a better sys admin, to be forced to try out alternatives... There's lots of reasons if you can be arced using micro instances... but it's fine too if you don't have the time, patience or drive to do so. There's hosts out there for all of us.

  • @AThomasHowe said:
    Why? To know your system better, as a challenge, to become a better sys admin, to be forced to try out alternatives... There's lots of reasons if you can be arced using micro instances... but it's fine too if you don't have the time, patience or drive to do so. There's hosts out there for all of us.

    Databases need higher RAM by design. You can run a website that noone visits or a wiki for personal use or just to try somethings on a low ram container but anything other than that is just disk rape.

    Using less RAM does not require very much talent, using less disk IO is the thing people needs to focus on. VPS's size is not measured by solely its RAM size either.

    Thanked by 1Profforg
  • I don't think I ever suggested you could use it for anything really active. I don't really think I said it was a talent either, just a challenge. Surprisingly not everyone is trying to run a company or a large website on their sub $5/m boxes ;)

  • hostnoobhostnoob Member
    edited May 2014

    @Maounique said:
    I used to have a lot of fun with 48-64 KB, not MB. But that is different today.
    I agree it is fun to run small boxes and I do at home running a laptop with 80 MB in total and a vm with 12 for Win 95. But that is just for fun, did it some time ago when I was to ill to do anything else.
    You can run a 10 MB ovz I presume for a ssh tunnel or something, but why not put a lot of things on a larger box than buy a lot of small ones? You save a lot of IPv4.

    To be honest, even if I had 128GB of RAM I would probably still minimise the OS install and remove/optimise as many things as I could :)

    It is nice to have free RAM though. I'm only using about 120mb RAM on 1GB VPS but it was only £2/mo from a company that won't disappear over night

    Thanked by 1raindog308
This discussion has been closed.