3

I have a server set up on CentOS and I need to change the API from CGI to FCGI (Someone else set this up initially) for x-cache to work (we need this as we have a TV appearance on monday and are expecting high-load).

The server is a dedicated Dell R210 with Intel Xeon L3426 (8M Cache 1.86GHz) and 2GB RAM - but it craps out with 244 concurrent clients (through loadimpact.com).

The plan is to install nginx as a reverse proxy for apache and config apache to listen on port 81 localhost and have nginx forward requests to apache.

At the moment what is killing our processor is php rendering as we are running Joomla 1.5 and as such I want to run x-cache as an op-code cacher to RAM. But x-cache doesn't work with CGI - only FCGI and so ends my explanation as why this needs to be done.

Is this a safe change for a Joomla site?

How can this be done through CLI - we have cpanel but I hate it.

Myles Gray
  • 639
  • 4
  • 12
  • 33

1 Answers1

1

You have yourself in an intresting spot. CGI(not FastCGI) has been known the be very slow everyone and there sister has made a cgi module or pluin backin the day. So your choice to move over to fastcgi is a good one. I am also a big fan of nginx It is a great tool I think the issue is adding nginx on top of an apache laywer still means apache has to do some work and its still a known fact that it is rather slow. If you require alot of the statical data that it asks for you may want to find a method of compling logs when the server is idel but in your case I would recommend that you use nginx on its own. You can use php-fpm which allows php to work with fast cgi. It should give u a much better boast in perfomance being able to skip the apche side this way nginx runs the web server and rendering apache pages.

WojonsTech
  • 350
  • 1
  • 10
  • I want to add nginx as more or a queuer in front of apache as nginx doesn't create a new thread for each connection and queues them up on one thread before handing them to apache when it is ready. We just don't have the time to change the whole web server to nginx and get it working hence why we are trying the next-best thing. So all that is needed to change apache from cgi to fcgi is install php-fpm and then what? – Myles Gray Oct 15 '11 at 16:24
  • @MylesGray Take a look at this? http://interfacelab.com/nginx-php-fpm-apc-awesome/ he built it from source i run debain where we have all of it in the dotdeb repositry. But it is failry simple to get it up and running and would be glade to help you. Took me about an hour or so to get php working on a new box using that meathod and I am really happy with it. – WojonsTech Oct 15 '11 at 17:24
  • @MylesGray the thing about nginx is it does not create a new thread for each process but you can have it start with 1 2 4 100 process already. All it does is fork it to who ever handles the dynmic part of the page. the issue is if u run apache then it starts up all sorts of http related things thats why fcgi is nice – WojonsTech Oct 15 '11 at 17:26
  • Thanks man, I got the server converted to Apache2Handler just quick and dirty to get xcache working so both servers are running the same config now (one with cpanel - bleh, and one without) I am now trying to configure nginx on both servers to handle httprequests... – Myles Gray Oct 16 '11 at 19:31
  • It should not be to much work you will install nginx and then go in to the /etc/nginx/sites_aviable/default.conf it should be that folder and then you will see servers and location info and you will need to set up that all php request get sent to apache. and all static files are handled by nginx – WojonsTech Oct 16 '11 at 20:10
  • At the moment all static files are handled by a CDN (MaxCDN) with a Joomla Plugin - will nginx even show an improvement? In relation to queuing we should see an improvement correct? – Myles Gray Oct 16 '11 at 20:13
  • Do you have one or 2 servers that handle ur website? the nginx will be better if u use the php-fpm plugin because that will server the web pages faster. and takes less memeory then apache will so u will have less load if u have or more servers for the same site or have some sort of way to get a little vps you can set up a load balancing – WojonsTech Oct 16 '11 at 20:59