We have a few sites that exist on a MediaTemple DV 3.5 server. We’ve long been concerned about the lack of performance we are getting on this DV versus sites on a smaller Linode.com DV. We are not here to debate that today.
What we have done is to install APC on the MediaTemple DV in order to improve performance to some degree by taking advantage of op_code caching. Now, this is not a silver bullet for performance folks. This is just one piece of a total tuning exercise. Be forewarned.
[Note: You are on your own as with anything we present. We do not warranty nor represent explicitly nor implied that this will actually work for you. In fact, you might just hose things up badly. Don't call us, we warned you.
]
1. Install Developer Tools and Enable Root Access
Log into your MediaTemple Account Center and go to the “Root Access & Developer Tools” page. If Root access is not enabled, you’ll need to enable it. Be sure to set a massively secure password on this!
Also, if the developer tools have not yet been installed, then click the button to install them. Wait until the installation has finished before proceeding.
2. Install APC
Use your favorite SSH client to log into your server via SSH. Once you have logged in, you will perform the following commands:
- cd /usr/local/src
- wget http://pecl.php.net/get/APC-3.0.19.tgz
- gunzip -c APC-3.0.19.tgz | tar xf -
- cd APC-3.0.19
- /usr/bin/phpize
- ./configure –enable-apc –enable-apc-mmap –with-apxs2=/usr/sbin/apxs –with-php-config=/usr/bin/php-config
- make
- make install
3. Let PHP know about APC
Now perform the following actions to modify your APC installation. (Thanks to TimLinden for the details)
- vi +/extension_dir /etc/php.ini
- press i
- press enter to start a new line
- type extension = “apc.so”
- press esc and then type :wq to exit and save (if you mess up type :q! to quit without saving)
4. Drupal APC customization
Thanks to an article from 2bits, we made the following modifications to the php.ini to set some specific APC configuration options.
- vi +/extension_dir /etc/php.ini
- press down arrow
- press down arrow
- press i
- press enter to start a new line
- type apc.apc.stat = 0
- press enter
- type apc.include_once_override = 1
- press enter
- type apc.shm_size = 64
- press enter
- press esc and then type :wq to exit and save (if you mess up type :q! to quit without saving)
- service httpd stop
- service httpd start
For those that don’t need key press by key press instructions for the php.ini, here is what we added to the php.ini
extension = “apc.so” apc.apc.stat = 0 apc.include_once_override = 1 apc.shm_size = 64
Hopefully this will help you get things started. Obviously, we are still testing and tweaking but this has provided some good improvements for a few sites that are located on a MediaTemple DV 3.5 server.
Popularity: 10% [?]
FYI, there is a newer version of APC available at 3.1.3p1.
http://pecl.php.net/package/APC/3.1.3p1
Do you happen to have an article on Linode v. Mediatemple DV’s?
This is the closest thing I have.
Thanks, hopefully APC will help some. This really helped a lot!
Although APC is running fine, setting apc.shm_size seems to break plesk on my DV 3.5. Thoughts?