Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Thu Nov 25, 2010 7:27 pm 
Offline

Joined: Thu Nov 25, 2010 7:24 pm
Posts: 1
Website: http://nick125.com/
Location: Terre Haute, IN
I would second (or third..or fourth) the suggestion to try nginx. It's much lighter than Apache. You can use it as a proxy, but I would probably just use it as a primary httpd. Wordpress isn't too difficult to setup with nginx, either.


Top
   
 Post subject:
PostPosted: Thu Nov 25, 2010 8:04 pm 
Offline
Junior Member

Joined: Sun Nov 14, 2010 9:46 pm
Posts: 28
Thanks for the advice, trying Nginx on it's own with php5-cgi & it's consuming more memory than Ngnix as a proxy to Apache, see screen shot.
any other tuning advise?
Image


Top
   
 Post subject:
PostPosted: Thu Nov 25, 2010 8:47 pm 
Offline
Senior Member

Joined: Sun Feb 21, 2010 5:12 pm
Posts: 64
It's using almost identical memory. Both apache and php-cgi are using 13MB per process in addition to the 29-31MB in the shared cache.

If you want to go without apache as a backend, you really should go with php-fpm instead of php-cgi.

php-fpm is another server interface like cgi that builds on cgi and adds a number of important features and improvements for process management. It was made part of the official php package in 5.3.3 and is part of the Ubuntu Maverick version. php-fpm has nice logs and stats and is pretty much tailored to use behind nginx.

From your php version of 5.3.2-1ubuntu4.5 you're on Ubuntu Lucid, you can use my repo for php-fpm.

add-apt-repository ppa:brianmercer/php
aptitude update
aptitude install php5-fpm

Or you could upgrade to Maverick.

You asked about mysql tuning. Get mysqltuner.pl and tuning-primer.sh and start getting familiar with mysql directives.


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 1:30 am 
Offline

Joined: Thu Dec 16, 2010 1:26 am
Posts: 1
Quote:
From your php version of 5.3.2-1ubuntu4.5 you're on Ubuntu Lucid, you can use my repo for php-fpm.

add-apt-repository ppa:brianmercer/php
aptitude update
aptitude install php5-fpm


Tried using this method. Everything installed OK. Now how do I enable php-fpm? my php info is still saying:

Server API : CGI/FastCGI

and when I look in my processes it says php-cgi.


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 7:33 am 
Offline
Senior Member

Joined: Sun Feb 21, 2010 5:12 pm
Posts: 64
You can start(/stop/restart) php-fpm with

sudo service php5-fpm start

That is the recommended way to start/stop daemons and is compatible with upstart and old scripts.

Killing php-cgi depends on how you started it. Maybe "sudo /etc/init.d/spawn-fcgi stop" or if necessary "sudo killall php-cgi" or "sudo killall -9 php-cgi"


Top
   
 Post subject:
PostPosted: Thu Dec 16, 2010 10:20 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
You can also save RAM by using less PHP processes, if you've got lots of spares. I've run very memory-constrained boxes with as few as two, since that's sufficient for light (to possibly medium) load if you don't have any long-running scripts. I wouldn't suggest that for an actual box if you've got RAM to spare, but 4 to 6 goes a long way if there aren't any long-running scripts.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group