How to speed up Drupal running in Vagrant on Windows Host

I recently install and setup Vagrant on my Windows laptop. The only reason I used Windows on my laptop is because of the trainings I conduct. Most companies use Windows based systems and it is difficult to train them if you are showing demos on Linux and they have to repeat the same on Windows. For that reason only I used Windows. When I am not providing training, I am usually developing stuff. Mostly on Drupal and most recently on JIRA Plugins (Yes I am learning Java).

I heard about Vagrant in the past but never really had enough space to try it out. Recently I decided to not take usuall Drupal projects and will only work with smart clients who are willing to pay for the service and quality. That decision is costing me money, as I don't do lot of work now but I am happy with the peace on mind. This gives me with some extra time which I now devote in learning new things and improving processes in my company. When you are on your own, you need to spend your time wisely. Free time means opportunity to learn new stuff.

I was happy to understand the whole workflow of Vagrant and quite like it actually. Everything went fine. Installed CentOS 6.5 using Vagrant and setup LAMP on it. I even installed a blank Drupal site just to test it out. It worked fine too. I even created a package and moved this customized CentOS box to another machine and it worked perfectly too. I loved this idea to have exact same development environment. I will now ask everyone in the team to use this box.

So far it was great, until I actually cloned one of our complex Drupal project which we have to deliver in few days. That site was running horribly slow. I came to know that the performance can be increased if we enable NFS for file sharing but unfortunately NFS is not supported on windows.

So I searched a lot on google for possible improvements. I mean Vagrant can be installed on Windows but just because of this NFS issue it is impossible to use it for LAMP. Finally I found we tricks, which I applied and it really improved the performance. Not great but atleast usable.

Install the following Vagrant plugin in your host, Windows in my case.
Someone has written this plugin to enable NFS on Windows. I found this after searching a lot on google.

vagrant plugin install vagrant-winnfsd

Now enable the root of your project folder with /vagrant folder where I keep my website files. This could be any directory on your setup. don't forget to enable NFS by using type: "nfs"

Do the following change in your Vagrantfile.

config.vm.synced_folder ".", "/vagrant", type: "nfs"

I realised that increasing the memory also has positive effects on the performance.

Also increase the memory of your virtual machine. I have 8 GB of RAM so I can afford to allocate 3GB to my virtual machine.

config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--memory", "3000"]

Lastly some tweaks in the Apache configuration file for some extra improvements.

Finally do the following change in your httpd.conf file

<IfModule prefork.c>
StartServers       2
MinSpareServers    6
MaxSpareServers   4
ServerLimit      4
MaxClients       4
MaxRequestsPerChild  3000

These are some of the things that I tried, I cannot guarantee that it will help you too, but there is not harm in trying. It might work for you.

Have fun!

How to install VirtualBox on Fedora 20

For the past few days I am trying to setup Vagrant for uniform development environment in our company, personall I work on Windows 8.1, iMac, Fedora for development and our servers are running CentOS. It is pain I know.

Last weekend I installed and understood Vagrant on windows 8.1, it was great. I will not get into the details on setup here. You can check the documentation on their website.

Today I cloned my Vagrant box, which I want to duplicate on my fedora machine. So for that I need to install VirtualBox first on Fedora 20. It is not as simple as yum install VirtualBox, it requires some effort. Here are the steps.

Step 1: Add the VirtualBox .repo

su -
cd /etc/yum.repos.d/

Step 2: Update your system

sudo yum update

Step 3: Install the required packages

yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms

Step 4: Install VirtualBox

sudo yum install VirtualBox-4.3

Step 5: Build modules

/etc/init.d/vboxdrv setup

Step 6: Add the user in vboxusers group

sudo usermod -a -G vboxusers YOUR_USERNAME

Installation complete. Now I will install Vagrant on Fedora 20. Have fun.

How to use Emacs & Org-mode on multiple computers with same settings

I am a big fan of Emacs. I am not saying it is the best editor but I feel it is light weight, yet powerful and it can be customized easily. Of course vi is equally good. It is just a matter of personal taste. I also now rely heavily on Org-mode for storing all my tasks, random thoughts and to-do in org files which is I feel by far the best to-do tool. Calling it a to-do tool is actually understatement. It can do lot more. If you need to remember something with dates, estimates, tracking then org-mode can handle it pretty well. It is fast and super powerful.

The only thing missing is the syncing. If you are like me then working on multiple computers without your tasks in hand could be difficult. Org files are just text files and it is upto you to make it portable and sync with other computers.

Here is what I did to make my org-files portable.

1. I have a folder called c:\emacs that contains the following
.emacs -> init file
emacs.d/ -> folder containing all the modes, .el files
org-mode/ -> folder containing org-files

2. By default if you run emacs it will load the init file from the current user's Home directory, but we want emacs to load init file from c:\emacs\ directory. For this I have written a batch file in windows to change the HOME variable and then load emacs.

set HOME=c:\emacs
C:\softwares\windows\emacs-24.3-bin-i386\emacs-24.3\bin\runemacs.exe %*

3. Now I run this batch file to launch emacs which considers c:\emacs as the home directory.


Now I have this folder c:\emacs which I commit and push to Git repository regularly.

But how to sync?

Ideally the commits to happen automatically after every 1 hour or so and changes should be pushed to server regularly too. So I am going to setup the following stuff and also share with everyone.

1. Auto commit files to git.
2. Issue a push on post-commit or may be few times a day using scheduler or cron.
3. Auto pull files on new computer when it is booted up for the first time.

(After implementing I will make these links)

Technically this is not sync in real sense but it is more like making your files portable and available to you as and when you need it.

2014 Half Year Update

More than half of 2014 has passed away and today it is 1st August. Today is my mother's birthday and also starting August it is festival time. Rakhi is next week, then Independence Day, next month is my birthday, then Dusshera, Diwali an so on. Really looking forward to next few months.

I am happy. There is a reason. My company Sparxsys is doing really well, especially the way I planned. We are by far the best JIRA Training provider in India right now. I don't think any other institute or organization who is into JIRA training can match our quality and experience. That is one. Second we are also one of the leading Drupal training provider in NCR. On an average I receive atleast 10-15 Drupal training requirements every week and around 5 JIRA training leads. Lastly we have some really amazing Drupal development projects lined up.

At our company we are now selective with work, we don't accept boring work just for the sake of money. We prefer working with smart clients who are willing to pay for the quality. Though our rates are still affordable and we charge less than our counter parts.

I am sure Sparxsys is on its way to become the number 1 Drupal and JIRA Consultancy firm in India.

We are planning to focus more on trainings and building products now. Recently we did some changes in the company that was difficult for me but it was necessary. I recently read Lean startup book that talks about continuously monitoring your progress and pivoting as and when necessary. The decisions I took in last few months were little difficult but now I feel that it really helped me to get more focus on things that matter the most and bring maximum value.

BTW I am also receiving some job offers :) really tempting offers but you know it is not easy to give up your dream. I recently started writing a daily journal where I summarize daily stuff in few paragraphs. It is good to write regularly, it really clears up the confusion in the mind and I think everyone should write journals.

It is 8:30 PM and I can hardly focus and write well, so winding up now.

Good Bye.

Organized 1 day JIRA and JIRA Agile Training in Polaris, Chennai

JIRA Training in Polaris Chennai
Few weeks back I went to Chennai once again but this time in a different company. I was called by Polaris to conduct a training cum doubt clearing session on JIRA and JIRA Agile. For me it was a great experience and I learned lot of new things too. Especially the level of customizations they are seeking in their instance.

It was just a 1 day session which is not really enough but the agenda for this training was decided before and I too prepared ahead. Unlike other JIRA training sessions where I usually conduct training to cover the topics which are part of standard content, this training was more like a brain storming session where they asked me lot of questions which are related to JIRA and its possibilities. I was glad to see that they already explore the JIRA quite much but were stuck at certain places and needed someone like me who can guide them well.

I can't disclose much about their customizations but will quickly mention the topics we discussed.

  • JIRA Best practices.
  • Useful plugins to extend workflow features like "JIRA Suite Utilities".
  • How to setup Issue Security Schemes and their purpose.
  • How to hide internal projects from customers who will access JIRA.
  • Is it possible to have field level permissions? - this is not possible.
  • How to hide certain fields from the edit screen?
  • How to restrict certain users to create Agile Scrum Boards? - This can be done by modifying global permission "Create Shared Objects"
  • Can be auto populate certain fields? - Use "JIRA Suite Utilities" to add this post function in the workflow
  • What is the concept of Rank in Agile?
  • Can the permission to create groups and role be given to non-admin user? - It is not possible right now.
  • Who can create Project? - Only admin
  • Who can add Project Version and Components? - Project Administrators

These are just some of the questions that they have which I cleared convincingly and rest of the day we tried to understand how Scrum Boards work. They had lot of questions about the Scrums reports, especially the Break Down Chart and Velocity Chart.

Overall it was one of the best sessions I had in recent times. After finishing the day I spent time to modify the JIRA Training Content, because there were certain topics which I though should be covered which I only realized after this session. I guess we learn as we do more and more work.

Primarily I am into Drupal and JIRA these days and I am really enjoying working on JIRA, giving consultation and training to companies, it is really a great experience for me and satisfying.


Subscribe to Ravi Sagar RSS