Sunday, September 30, 2012

Scanning the logs with grep

From time to time I'm analyzing the applications logs to troubleshoot possible bugs of a system.
While you have plenty of logs you need a tool, a fast one to parse the and give you a result.

I believe this tool is a grep. You can even install it on Windows, what actually did for one of my laptops.
But it's not enough to have a tool, you have to know how to use it properly. So enjoy this article - the helpfull one

I'm personally in love with -C # option. My the most often used command is:

grep -C 2 "PATTERN_OR_REGEXP" application.log*

This usually gives me information about what preceeded the error and where the Exception was raised.

Monday, September 3, 2012

Mongo MapReduce performance

A lot of people complain about mongo's performance while making a MapReduce tasks. The problem here is that the mongo is not designed to handle real-time analytic tasks.

The price of using MapReduce is speed: group is not particularly speedy, but MapReduce is slower and is not supposed to be used in “real time.” You run MapReduce as a background job, it creates a collection of results, and then you can query that collection in real time.