Tuesday, 29 October 2013

Drupal site Performance tips

Here are some of the Performance tips for the Drupal site.

  1. APC : APC (Alternative PHP Cache) is a PHP OP code cache. It is a very quick win when working with PHP and can offer a great performance boost when using Drupal. It is very much a “set it and forget it” type of application which can just be installed, enabled and left to do it’s thing.
  2. Memcache : Drupal's support for memcache is really good and easy to implement.There is a memcache drupal module(https://drupal.org/project/memcache) to integerate the memcache on the site.
  3. Varnish : When you have a lot of anonymous users reverse proxy cache can save you a lot of server load. Varnish is one of the more popular solutions within the Drupal world. Varnish sits in front of your web server application, for example Apache, Nginx or lighttpd, and can run on the same server or a remote server.Use the varnish module to integrate the varnish on your site https://drupal.org/project/varnish
  4. Boost : Boost provides static page caching for Drupal enabling a very significant performance and scalability boost for sites that receive mostly anonymous traffic. For shared hosting this is your best option in terms of improving performance. On dedicated servers, you may want to consider Varnish instead. When the page is then requested it is loaded quickly, because it is coming straight from the disk and no PHP or MySQL processing is needed.See the Boost module here https://drupal.org/project/boost
  5. CDN : A CDN is used to distribute static assets such as images, documents, CSS and JavaScript across many locations.The goal of a CDN is to serve content to end-users with high availability and high performance.There is a CDN drupal module(https://drupal.org/project/cdn) to use the Content delivery Network.
  6. Disable Database logging module : This module logs the action performed on the site to the database.Use syslog module which is also in drupal core.Using syslog you can also write the more technical log entires to the server's standard log on the file system and save the database queries.
  7. Enable Page & Block Cache : Enable Drupal caching (Administer > Configuration > Performance). When enabled, Drupal will render the page and associated blocks once, and then save that result in the database. This can drastically reduce the number of database calls run on a page since the results are pre-rendered. Drupal’s caching engine is most effective for anonymous visitors – if your site is mostly “read only” and doesn’t have visitors logging in, caching can make a dramatic improvement in site load speed.
  8. Increase Cache Lifetime : An option for some sites may be to increase the cache lifetime. This determines how long Drupal will hold onto a cached result before it will re-generate the page. If you have frequently changing content, you may want to set the cache lifetime to only 5 minutes, but if your content doesn’t change often, an acceptable value may be several hours.The cache lifetime depends on your site usage.
  9. Optimize JavaScript and CSS Files : Enable the option of optimize javascript and CSS files in the performance settings. When enabled, Drupal will consolidate all CSS and JS files included on each page into a minimum files, and compress the code by removing whitespace. This will reduce the overall file size and improve page load speeds.if you need more aggeration of css and js files then use Advanced CSS/JS Aggregation module https://drupal.org/project/advagg
  10. Disable Un-used Modules from the site .

if you have done all the performance tips written above and you are still getting the performance problems then either get the suggestions from the High performance drupal group https://groups.drupal.org/high-performance

There are also some of the related performance related articles.See there links below

  1. http://www.creativebloq.com/web-design/drupal-performance-tips-9122837

Drupal Service Providers

There are many service providers in the world that provide drupal related services.As per the drupal marketplace some of the providers are Featured(those which have an exceptional community contributions and show continued support of the Drupal project) and others are not Featured.See the Top 10 Featured service providers here https://drupal.org/drupal-services.you can filter them according to the Services,location and sectors.

When hiring a Drupal site developer it's important to understand what you need and where you can find the service provider with that set of skills.you can find the detail here https://drupal.org/node/51169

if you are getting some problem while hiring a Drupal Developer then feel free to contact me using my contact form.

Sunday, 8 September 2013

New Relic Setup on Ubuntu 12.04

In this article I will show you how to setup New Relic on Ubuntu 12.04 on linode.
First Login on Newrelic website if you have an account unless Register with a email address.Then follow these steps : 
  1. Click on the Applications tab in the left sidebar on your dashboard.
  2. Choose your language.
  3. Click on Reveal license key button.
  4. Select your Environment to Debian-based (Debian, Ubuntu, etc)
  5. Then login to your server with root account
  6. Get the key :
    wget -O - http://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
  7. Add newrelic repository:
    sudo sh -c 'echo "deb http://apt.newrelic.com/debian/ newrelic non-free" > /etc/apt/sources.list.d/newrelic.list'
  8. Install the package and configure it:  
    sudo apt-get update
    sudo apt-get install newrelic-php5
    sudo newrelic-install install
  9. Stop and start your services .i.e. Restart your web servers: httpd, apache2, nginx, php-fpm, etc.
  10. Then Go to your dashboard on New Relic and click on Connect to my application button and it will show the data on your dashboard in approximately 5 minutes.
Note : if you got any error while installation either Email support@newrelic.com or follow the instructions here https://newrelic.com/docs/php/new-relic-for-php#installation

In a default installation there should be no need to start the daemon manually using /etc/init.d/newrelic-daemon start. This is only needed in unique circumstances. The daemon should be started as needed by the agent when your web-server is restarted.

After a restart, do the following:
ps -aux | grep newrelic-daemon
If things are running you should see to processes named newrelic-daemon.

If these are not running then please locate your log files and send them to us. By default these files would be located at


Thursday, 11 July 2013

Create a node programmatically in drupal 7 with Reference fields

How to create the node programmatically in drupal 7 with Reference field modules either References or Entity Reference(that is in drupal 8 core now).

Also find the below example of creating a simple node with page type with Title,Description and a Reference(References or Entity Reference) fields.
$node = new stdClass();
$node->uid = 1;
$node->title = 'Title of the Field';
$node->status = 1;
$node->comment = 1; //Hidden the Comment on the node
$node->promote = 1;
$node->sticky = 0;
$node->type = 'article';
$node->created = '';
$node->changed = '';
$node->timestamp = '';
$node->body['und'][0]['value'] = 'Full Story';
$node->body['und'][0]['summary'] = 'Summary';
$node->body['und'][0]['format'] = 'full_html';
$node->revision = 0;
$node->field_entity_reference['und'][0]['target_id'] = 50;
//Here field_entity_reference is the name of the Entity Reference Field and 50 is the nid of the reference node.
$nid = node_save($node);
Here field_entity_reference is the name of the Entity Reference Field and 50 is the nid of the reference node.
you will get the $nid after saving the node

Tuesday, 2 July 2013

Php and Mysql CMS

I do lot of R&D on finding the list of Php and mysql open source CMS on google.Then atlast I found here http://www.scriptol.com/cms/list.php .I mentioned some of the popular CMS below

NameCategorySupported databasesComments

DrupalPortalMySQL or PostgreSQLSponsored by the University of Oregon.
Joomla!PortalMySQLPopular CMS, fork of Mambo.
phpBBForumForum CMS with a lot of themes and mods.
WordpressBlogMySQLVery popular and extensible blog CMS.
For more information Read Here