Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2017-11-08, 01:01:20

Author Topic: Script - Install APC when running Apache + PHP-FPM  (Read 1531 times)

0 Members and 1 Guest are viewing this topic.

Offline Hugo

  • Junior Member
  • *
  • Posts: 32
  • Karma: +0/-0
    • View Profile
    • KimeraLive - Tailored Clouds
Hello,

I've created a little script that enables the well known APC accelerator in Kloxo-MR installations, this is currently deployed in every production server we run. I hope you find it useful, the performance gain is very noticeable, on most sites, page load speed is 40% better! (sites tested were based on Wordpress & Joomla).

This is meant for CentOS 6.x, Kloxo-MR Final Release with PHP 5.3u, Apache and PHP-FPM , although it should be pretty much the same for PHP 5.4

Code: [Select]
#!/bin/bash 
#
# KimeraLive APC installer
#
echo ""
echo "Kimera APC installer v0.7 BETA for Kloxo-MR "
echo ""
echo "installing required packages and removing unwanted..."
echo ""
yum clean all
yum remove php53u-xcache -y
yum install php53u-devel -y
pecl channel-update pecl.php.net
echo ""
echo "installing APC extension..."
echo ""
pecl install apc
echo "extension = apc.so" > /etc/php.d/apc.ini
echo "apc.shm_size = 96M" >> /etc/php.d/apc.ini
echo "apc.stat = 0" >> /etc/php.d/apc.ini
echo ""
echo "cleaning up..."
echo ""
yum remove php53u-devel -y
echo "done."
echo ""
echo "restart web server & php-fpm to apply!"
echo ""

 - APC will ask a few questions, leave the default answer unless you know what you're doing! -

Note1: you may not want to remove php53u-devel on your server.
Note2: I find the value "apc.shm_size = 96M" to be adequate on our servers, but feel free to adjust as needed.

Finally, to test the behavior of APC, you can copy the apc.php file to the kloxo default root:

Code: [Select]
cp /usr/share/pear/apc.php /home/kloxo/httpd/default/

and then go to: http://IP_ADDRESS/apc.so

High number of hits (more green) means APC is doing its caching job properly.  Let it run for at least 12 hours to get some traffic on it and thus a more realistic feedback.
« Last Edit: 2014-02-23, 00:03:36 by asciiker »

Online MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,381
  • Karma: +112/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Script - Install APC when running Apache + PHP-FPM
« Reply #1 on: 2014-02-23, 00:11:16 »
I like combination of Nginx-proxy/Hiawatha-proxy (enable microcache) + Php-fpm + Php53u-xcache + application's cache plugins (like hypercache in wordperss).

But, your idea also good.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Hugo

  • Junior Member
  • *
  • Posts: 32
  • Karma: +0/-0
    • View Profile
    • KimeraLive - Tailored Clouds
Re: Script - Install APC when running Apache + PHP-FPM
« Reply #2 on: 2014-02-23, 00:46:50 »
That sounds like a good solution also, but I must say that my benchmarking tests did not show improvement with the setup: Nginx+PHP-FPM compared to Apache+PHP-FPM, and when you add APC, then its a lot better. 

I've never worked with Hiawatha before so I can't say. I'm learning Varnish first anyway.

Also I find that enabling Nginx.proxy can break live sites and I've had some bad issues with xcache...

I'll have to look into hypercache, sounds interesting!




 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.03 seconds with 20 queries.

web stats analysis
 
Mirror created by MasterkinG32.CoM