Howdy, Stranger!

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


Need help 128MB vps
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.

Need help 128MB vps

bijan588bijan588 Member
edited March 2012 in General

Hey there, I have a 128MB vps

I cant seem to run lighttpd, php, and mysql without breaching my ram.

I am using TinyVZ

Any ideas?

Comments

  • NickMNickM Member

    I'm guessing you're running into issues installing MySQL? Specifically, when you install it, it refuses to start, and thus, the install fails? What distro are you using? Debian 6? Do the install and let it fail. Then, if you're using mysql 5.1 (the default version in the Debian repos), add skip-innodb to /etc/mysql/my.cnf, then do "apt-get install mysql-server" again. It should succeed this time. InnoDB uses a ton of RAM by default, and it's enabled by default.

  • CloudxtnyHostCloudxtnyHost Member, Host Rep

    Bijan,

    Also you will want to check what type of VPS you have and if it has burst ram or dedicated ram and swap space.

    As NickM has hinted the more info you can provide about the problems you are having the more people can help.

  • nocomnocom Member

    I have also tinyvz just follow http://www.lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/ i have similar conf debian 5 lighttpd mysql iptable fastcgi. 17 proc 27/256mb load 0.2
    NickM pointed to main problem, install debian5 32bit edit my.cnf adding skip-innodb
    no need to install again mysql /etc/init.d/mysql restart will fix problem.

  • NickMNickM Member

    @nocom said: no need to install again mysql /etc/init.d/mysql restart will fix problem.

    I believe there's a postinst script that needs to run after the install, and it doesn't run if mysql fails to come up during the install process.

    @nocom said: install debian5

    Please don't install Debian 5. Debian 5 is no longer receiving security updates.

  • nocomnocom Member

    After you change my.cnf mysql will run - already tested
    From Debian:
    Sometimes, in the case of several critical problems or security updates, the released distribution is updated
    The tenth point release, 5.0.10, was released on March 10th, 2012.

  • NickMNickM Member

    @nocom said: After you change my.cnf mysql will run - already tested

    It may run, sure, but there may be problems if the installation isn't 100% complete.

    @nocom said: Sometimes, in the case of several critical problems or security updates, the released distribution is updated

    Yes, that's specifically talking about point releases. Per this announcement there will be no more security updates for Debian 5 even if new security vulnerabilities are discovered. Simply put, NO ONE should be installing Debian 5, and no one should be suggesting that people install Debian 5 anymore.

  • NanoG6NanoG6 Member
    edited March 2012

    Just install MySQL (disable innodb), PHP-FPM, and NGINX.

    MySQL config:

    [root@amn ~]# cat /etc/my.cnf 
    [mysqld]
    bind-address=127.0.0.1
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    user=mysql
    
    key_buffer = 16K
    max_allowed_packet = 1M
    table_cache = 4
    sort_buffer_size = 64K
    read_buffer_size = 256K
    read_rnd_buffer_size = 256K
    net_buffer_length = 2K
    thread_stack = 64K
    skip-bdb
    skip-innodb
    
    [mysqld_safe]
    log-error=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    PHP-FPM pool config:

    ....
    pm = dynamic
    pm.max_children = 20
    pm.start_servers = 1
    pm.min_spare_servers = 1
    pm.max_spare_servers = 2
    ....

    Memory usage:

    [root@amn ~]# free -m
                 total       used       free     shared    buffers     cached
    Mem:           128         81         46          0          0          0
    -/+ buffers/cache:         81         46
    Swap:            0          0          0
  • Oh and that's on CentOS 5.3. Memory usage would even better on Debian 6.0 using minimal script from @maxexcloo

  • Are you sure the RAM will be sufficient when all the 20 PHP-FPM processes are launched?

  • NickMNickM Member
    edited March 2012

    I would definitely set it much lower than 20. On a 128, you've probably got access to 1 processor core, so a lot of people will recommend 1 php process. I'd recommend 2 or 3. Realistically, that's all you're ever going to be able to use at one time.

  • Definitely not, lol.
    But that config would be sufficient anyway just for single WordPress blog.

  • RophRoph Member

    Seconding maxexcloo's minstall. I have Nginx / PHP5-FPM / MySQL running great on a 128mb LEB from minivps :)

  • @NanoG6 said: key_buffer = 16K

    That's a starvation diet and will certainly impact mysql performance :)

  • @sleddog said: That's a starvation diet and will certainly impact mysql performance :)

    indeed :) but even with that config, mysqld is already using 5% of RAM with just less than 1 day uptime.

  • sleddogsleddog Member
    edited March 2012

    @NickM said: I would definitely set it much lower than 20. On a 128, you've probably got access to 1 processor core, so a lot of people will recommend 1 php process. I'd recommend 2 or 3. Realistically, that's all you're ever going to be able to use at one time.

    The number of php processes isn't determined by the number of cores, but by the number of simultaneous connections. The number you can run is determined by the typical size of a php process, which is determined largely by the running scripts (e.g. helloworld.php uses less memory than wordpress or vbulletin scripts).

    Also, a portion of the memory used by each php process is shared across all php processes, so the total memory used is less than (number_of_processes X average_size_of_process).

    I have a 256MB KVM running nginx, php-fpm & mysql, and at times it fires up 10-12 concurrent php processes, but total memory usage doesn't exceed 60 MB.

Sign In or Register to comment.