Skip to main content


Showing posts from May, 2014

New relic aha moments with Java app

I am integrating New Relic at our startup and in last 2 weeks there were several Aha moments.  Below are some of the Aha moments

1) Our DBAs had done some profiling an year ago and told me that there is this "Select 1 from dual" query that is taking most of the time in database.  I was like this is the query that we do for validating connection out of commons-dbcp pool so I cant take it out and why would select 1 from dual take time in database.  But then I installed new relic on 16 app servers in a data centre and then I went to Database tab and immediately I see this query being fired 40-50K times. This was an Aha moment and immediately I started looking for alternatives.

Finally I settled on tomcat-dbcp because it has a property called as validationInterval(default is 30 sec). So what it means is it would still fire select 1 from dual but will fire it on the connection only if it hasnt fired it in last 30 sec. This weekend the fix is going live so crossing fingers if ther…

Programming Epiphany

I hate doing tasks that are repetitive or that someone else should do but its a waste of my time. Earlier we used to store user and customer data on LDAP and there were all sort of BS requests from marketing like tell me "all customers that are on PlanY and are buy domain with >5 users".  Problem is there were 40 ldaps and each one of these would require writing a custom script. Teaching other programmers ldap was not reasonable.  One of my goals at my employer is to "Empower people to retrieve information themselves". I don’t want to be bottleneck in their chain of thoughts and they need not be bottleneck in what I want to do. I don’t want to involve humans if at all possible.

So when we migrated to Ldap->Mysql, first thing I did was consolidated 40 ldaps per data centre to 4 Mysql server per datacentre.  I could have consolidated to 1 also but that would suffer from noisy neighbour issue.  Problem is that there are 3 Data centres so in total 12 mysql server…

Jenkins Execute shell FAILURE

I was trying to run a jenkins Execute shell step with a grep to grep exceptions out of tomcat logs something like

echo "grepping logs for exceptions"
grep Exception purato.log*|grep -v WARN|grep -v DEBUG>error_summary.txt

problem was that if the log files had no exceptions then this step would fail and mark the job as failed. Now I wanted to mark the job as successful even though the grep didnt yeild any output. I tried various solutions from putting "exit 0" as last command but problem was jenkins would fail immediately first shell step it found failure.

Problem was jenkins starts shell with command

[workspace] $ /bin/sh -xe /tmp/hudson6722324600236337826.shfrom man pages """-e errexit If not interactive, exit immediately if any untested command fails.  The exit status of a command is considered to be explicitly tested  if the command is used to control an if, elif, while, or until; or if the command is the left …

Dell latitude find your windows7 product key

huh what a bummer, I had obliterated windows from my laptop and installed Ubuntu on it. Now I had an old XP VM that I was using but as Microsoft stopped supporting XP its a security nightmare if I continue to use it every time I sign in on Skype or GTM.

So I wanted a windows7 VM but I need a license and wanted to find it, I found all sorts of weird answers when I was trying to find the product key. Logging to BIOS didnt worked, logging to Dell support site didnt worked.

Finally I remembered that to solve the hardware issue with mouse when I had brought the laptop, I had removed the battery and there was some sticker under it.

That was a eureka moment :).  I remember in my old dell it was directly under the laptop and after 2 years the letters were barely visible, so dell did a good thing but they need to either put this on the website that windows product key is under the battery or put some sticker on battery or better just put the key in BIOS settings.

Reading concetration mobile vs desktop

I read a hell lot of content these days on zite quora, not sure but something has changed in past 4-6 months, earlier I was a big time consumer of netflix and now a days I rarely watch it. I have cut the cord on cable for past 2 years and I rarely miss it. 

I daily put my son to bed and the guy takes more than an hour to sleep, he will find all sorts of excuses from "I am thirsty or I have to pee" to just get out of bedroom. With kids you got to stick to the routine and consistent else if he is up beyond certain time then he gets cranky and what takes an hour usually takes 2 hours. So for that 1 hour I am in a dark room waiting for him to sleep. I recently started covering a blanket on myself and started reading on my phone, but the wifi in bedroom sucks as its far from Router in study where I work in day time. Also earlier had an Iphone 3GS and it was good for calling but apps were too slow and the Tmobile 3G network used to suck. I switched to Iphone5 a month ago and its …