Article Side

Online Article Directory!

Hello Guest! Login or Register to submit articles!

How to improve Drupal performance on your localhost

By Valuebound Subscribe to RSS | August 13th 2012 | Views:
loading
 
  



In this post I’m going to discuss about improving Drupal performance on your localhost - PAE, APC and MySQL tuning. My old laptop had broken down, and I had to quickly find a cheap substitute, which had a bit different configuration: two AMD cores VS four Intell i3 cores and 4GB vs 3GB. So, I decided to try Linux Mint, which is said to be better than Ubuntu. IMO for LAMP stack the name of the Linux distribution is not so important, because they are all working good, however you should decide which version to chose: 32 bit or 64 bit. I found out that 64 bit Linux is better for development, but it could be not good enough for some applications.

Memory utilization for 32 bit Linux

So, I decided to choose 32 bit version of Mint. The problem was that the first thing I noticed was that 2.6GB of RAM was only available. That seemed absurd and was definitely one of disadvantage of 32 bit system. When I was running full LAMP stack + IDE + Skype I saw almost all memory was used and some disk space was taken for swap. Luckily enough Physical Address Extension (PAE) was there to help, which could be installed with the following command:

$ sudo apt-get install linux-generic-pae linux-headers-generic-pae

This worked pretty well and system monitor showed 3.5 GB of RAM. Not 4 still, though it could be a unit conversion issue. However, I was happy that the system was working faster now.

Configuring Alternative PHP Cache

I had cloned a big project and saw how my machine was trying hard to handle requests, which slowed down the system. The way out was installing APC. Alternative PHP cache is open source and free framework that optimizes PHP intermediate code and caches data from PHP compiler in shared memory. In Mint or Ubuntu, it could be installed with the following command:

$ sudo apt-get install php-apc

I ensured that /etc/php5/conf.d/apc.ini file was in place and over-rode the default settings:

Extension=apc.so

Apc.shm size=128M

Apc.max file size=10M

I installed APC module that allows storing Drupal cache in memory instead of database. I ensured that the cache tables size was less than shm_size in config file. Then I enabled the APC module and added the following into settings.php file:

$conf[‘cache_backends’] = array(‘Sites/all/modules/apc/drupal apc cache.inc’);

$conf[‘cache_backends’] = ‘DrupalAPCCache’;

$conf[‘page_cache_without_database’] = TRUE;

$conf[‘page_cache_invoke_hooks’] = False;

MySQL tuning

Instead of enabling APC cache, database performance was not getting affected. So, I changed the settings of MtSQL to make it work faster. The following are the values with which I overrode MySQL config. Files:

/etc/mysql/mysql.cnf:

[mysqld]

Key buffer = 128M

Max allowed packet =128M

Max connections =300

Table cache = 256

Query cache limit = 16M

Query cache size = 128M

/etc/mysql/conf.d/innodb.cnf:

[mysqld]

Innodb buffer pool size =1024M

Innodb additional mem pool size =32M

#innodb log file size = 16M

Innodb log buffer size = 4M

Innodb flush log at trx commit = 2

Innodb thread concurrency = 4

Innodb flush method = O DIRECT

Innodb file per table = 1

At last I accomplished up to 100% increase in performance. I didn’t try to change my HD to SSD as yet, but I’m certain that it’ll gain even further performance. BTW is an interesting manual, use it to perform automated tests. It even allows running MySQL in memory instead of disk, this is really good.

Valuebound is a leading Drupal Development Company providing Enterprise Drupal web solutions. For more information on Drupal Development, contact us at info@valuebound.com

Valuebound - About Author:
Visit The Source Article: http://www.valuebound.com/blog/how-improve-drupal-performance-your-localhost

Share on Facebook Tweet It Stumbleupon this post This post is delicious !

Article Source:
http://www.articleside.com/web-design-articles/how-to-improve-drupal-performance-on-your-localhost.htm

Related Web Design Articles Subscribe to RSS

Broadway Infotech ensures best ecommerce solutions
Published by Devendra on January 24th 2012 | Web Design
You can easily take advantage of high standards of website development, website design and ecommerce...
 
Web based project management software and project management solutions
Published by Brooke Mueller on July 2nd 2012 | Web Design
Web based project management software is not just for managing software based project. it can be use...
 
Developing custom web solutions in modern competitive scenario
Published by Sitikantha Pattnaik on June 12th 2012 | Web Design
Nowadays IT outsourcing is the best way to deal with the invested budget, even in case of web develo...
 
Quality solutions from Website Design and Development India Companies
Published by Alisa Rozzy on March 13th 2012 | Web Design
Today’s web design companies know their jobs really well, making the website attractive, appropria...
 
Creative quality Web Design solutions is easy to get now
Published by Nelson on April 25th 2012 | Web Design
ByFriday..Graphic designer, web designer, website designer, graphic designing, web designing, websit...
 
Web Application Development- the biggest advantages web application solutions
Published by Devendra on February 23rd 2012 | Web Design
The world of Internet, which has evolved from a network-based hypermedia distributed information sys...
 
Broadway Infotech ensures best ecommerce solutions
Published by Devendra on January 24th 2012 | Web Design
You can easily take advantage of high standards of website development, website design and ecommerce...
 
How to find out perfect e-commerce solutions
Published by Devendra on February 2nd 2012 | Web Design
E-Commerce solutions should be such that it enhances your customers’ confidence in your website wh...
 
Open source solutions for E commerce websites – Opening up to new avenues
Published by Henrypeter on December 9th 2011 | Web Design
Open source solutions for ecommerce are in vogue because they are pre-designed solutions, which are ...