Howdy, Stranger!

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


Tweaking php5-cgi?
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.

Tweaking php5-cgi?

edited August 2012 in General

Hey folks,

So I've got a 128MB/256MB burst RAM VPS, which is soon to be used as a production environment for a blog. I'm encountering "-bash: fork: Cannot allocate memory" errors when trying to execute commands via terminal and when loading the domain I get server errors. This is strange as I've ran a similar setup on servers worth half as much resources without the errors.

The setup is as follows:
Debian 6 32bit Minimal w/ a basic LEMP stack and a stock Wordpress installation and is using 248MB of RAM, which obviously is too damn much.

I've tweaked MySQL a bit, it's no longer the heaviest process. I now have 5 php5-cgi processes running, and I need to tweak php5-cgi to make it run with less resources and without spawning all these processes. I'm a bit lost here as I am not sure what file(s) I am looking for nor what adjustments to make.

Help?

Comments

  • image

    HTOP output for those who care. Secure Dragon was kind enough to increase my memory limit while I figure out how to decrease my memory usage.

  • I would switch to php-fpm, and cut it down to a max of 3 php processes.

  • Thanks, I actually just said "F it" and decided to reinstall the system for now and starting fresh. I've never encountered this memory issue in the past, I ran the same bash script that I wrote for installing my LEMP stacks on this same VPS in the past but when it only had 96MB of RAM and it ran fine.

    Not sure why this time was different.

  • Just as NickM mentioned,
    Nginx+php-fpm+MariaDB+Varnish cache (in case of WordPress)

    Centminmod might be a good start.

  • @Tony_offshore said: Centminmod might be a good start.

    Maybe if they had it for Debian, I'd give it a shot. I can't say with 100% certainty why I prefer Debian, all I know is that I do.

    But there isn't anything stopping me from attempting to get that same setup (Nginx+php-fpm+MariaDB+Varnish cache) on a minimal debian VPS. I've never used Nginx w/Varnish (have used Apache+Varnish and loved it) and MariaDB is new to me too. Maybe I'll learn a thing or two.

  • I repeatedly ran in to the same issues on similar spec Debian servers and php-cgi, and had much better performance out of php-fpm.

    It pains me to link to it, but this post runs through the same steps I have historically followed: http://www.webhostingtalk.com/showthread.php?t=1025286

    Shame that php-fpm is not in the Debian repos yet.

  • lbftlbft Member
    edited August 2012

    @VPSChef said: Shame that php-fpm is not in the Debian repos yet.

    http://packages.debian.org/search?keywords=php5-fpm ?

  • qjqqjq Member

    dotdeb
    and what is xinetd doing?

Sign In or Register to comment.