Elasticsearch with Logstash & Kibana using Vagrant & Virtualbox on Ubuntu 14.04

I have been working on a project where I need to send logs from Python logger to logstash so I can visualize the logs later using Kibana. Instead of setting up elasticsearch with logstash and kibana on my local workstation, I decided to setup a virtual machine running the complete stack. I have been using Virtualbox on my Ubuntu workstation and pretty happy with it. To make life easier, I put together a vagrant script to spin off VM running the elasticsearch stack so that I can share it work other developers working on the same project.

(more…)

Read More

Understanding key storage performance metrics

If you work in IT industry, you must have came across the question of how well your network storage or even your local storage is performing. There can be many reasons for looking into storage performance including but not limited to..

  • You are evaluating new storage solution to deploy in your organization.
  • You are trying to find the bottlenecks in your existing storage solution.
  • You are product engineer and working on performance testing of storage product.

Measuring storage performance of a storage can be easy but finding bottleneck in storage solution can be a cumbersome task as there can be lots of hardware/software layers in a given storage solution. Let’s take an example of NAS storage product. Below diagram shows what a typical NAS storage product architecture looks like. NAS Architecture Diagram When it comes to storage performance testing, you might be testing complete solution or any layer/component as shown in above diagram. Regardless of the component you are testing, storage performance is measured using following key metrics. Before we start digging into the details, please read the article on to better under I/O size that can impact the performance results.

(more…)

Read More

Understanding I/O request or block size

I/O request size which is also referred as block size is the size of request that application uses to perform I/O operation on storage device. Every application uses a different I/O request size and based on how big the request size is, it can have pretty good impact on storage performance.

Storage performance is measure in IOPS and/or Throughput. The size of I/O request impact both of these number. Below formula shows the relationship of these three

Throughput   =   IOPS   x   I/O size

Higher the I/O size, bigger the throughput will be. On the revere size, IOPS will be lower whereas if the I/O size is smaller you will get higher IOPS. Remember, the data is stored on the storage device in size of 512 Bytes (Most common). It take a certain amount of time for storage device to read/write single sector (512 Bytes for hard disk drives). I suggest that you read http://en.wikipedia.org/wiki/Advanced_Format to learn more about sector size.

Now let’s say that you have read I/O request (operations) which is 8KB in size. To complete this request, disk will have to read 16 sectors. As you can guess, it will take more time to read 16 sectors as compared to 1 sector from the disk drive. If we change the I/O request size to 64KB, 128 sectors will be read to complete the request and it will take even more time as compared to complete 8KB size request.

Below chart shows what the typical I/O size looks like along with the access pattern for a given application type.

Application Type Access Pattern Read % Write % Blocks (In KB)
Database (transaction processing) Random 70 30 8
Mail Server Random 70 30 8
File Copy (SMB) Random 50 50 64
Database (log file) Sequential 0 100 64
Web Server Random 0 100 64
Backup Sequential 0 100 64
Restore Sequential 100 0 64

To find the correct block size for your application, you can use your operating systems monitoring capabilities. Windows 2012 has built-in Performance monitor that can provide this data. Look for Avg. Disk Bytes/Read counter.

If you are using Linux, you can do the following to find the I/O request size

  • Run iostat and look at the avgrq-sz data. This column shows the average number of sectors requested in a given I/O request
  • Multiply this number by 512 bytes to get the block I/O request size in bytes

 

Read More

Dreamhost PHP zip extension installation

I was trying to use Duplicator plugin on one of the website using WordPress which is hosted on Dreamhost. Duplicator plugin make use of PHP zip module to compress the wordpress files and build a single package for installation on other location or backup/restore. To my surprise, Dreamhost doesn’t have PHP zip module support but what I love about dreamhost is their good documentation about these type of issues. They do have Wiki article on installing zip module http://wiki.dreamhost.com/PECL_Zip.

I create a zip.sh shell script with the content from Wiki article in Dreamhost user home directory. When I executed the script, I was returned with following error message.

/home/userdir/php5/bin/phpize: No such file or directory

The phpize command is used to prepare the build environment for a PHP extension. The workaround to move forward is pretty easy. Use following commands:

mkdir php5/bin
ln -s /usr/local/bin/phpize-5.4 php5/bin/phpize

Run the zip.sh again and everything works as expected.

Read More

Why operating system shows less disk space than what I have?

Number of times I have been asked this question as why my Operation System shows less disk space than what I have? Few years back when the disk sizes were limited to only few hundred gigabytes, this wasn’t as big of concern as the lost disk space was few gigabytes. But nowadays with disk size all the way up to 2 TB and 3TB on horizon, the lost disk space can be few hundred Gigabytes. And to make it worst, if you are building disk array (RAID or JBOD), this loss could be even more than whole 1TB.

There are few explanations for lost disk space and are explained below: (more…)

Read More

Notepad++ missing from Context Menu in Windows 7

Just upgraded my laptop to Windows 7. After installing Windows 7 and configuring devices, I started downloading all the good application without which I can’t survive a day on computer. Once of these applications was Notepad++. After installing Notepad++, I realized that the Notepad++ edit option was missing from context menu.

I am use to just right click on files and select Notepad++ so this was bit of disappointment. After doing some digging on google, I was able to create a registry entry to context menu and here are the steps which I had to follow:

  1. Launch registry editor using regedit command.
  2. Browse to HKEY_CLASSES_ROOT\*\shell registry tree.
  3. Create a new key under band name it Notepad++
  4. Under this key, create a new registry entry of type REG_SZ and enter Notepad++ as data for this registry key. (The data entry will appear as it is in context menu. You can also enter ‘Open with Notepad++’ if that’s what you want to appear in context menu.)
  5. Create another key entry under Notepad++ and name it command.
  6. Create a new registry entry of type REG_SZ and add C:\Program Files (x86)\Notepad++\Notepad++.exe %1 as data. If you installed Notepad++ at different location that default, modify the path in command accordingly.
  7. That’s it, you can close the registry editor and you should have Notepad++ in context menu for all file types. Below screenshot shows the registry editor screen with entry.
    Notepad++ Context Entry

If it seems hard to follow all the above steps, you can just download the registry file and execute it :)

Read More

Subversion with WebSVN, WebDAV and Active Directory or LDAP Authentication

I just finished setting up subversion server running on CentOS. In addition to having subversion respositories, I have few other requirements which includes:

  • Ability to browse repositories using a web browser
  • Acccess to repositories using WebDAV
  • Repositories access should be protected and authentication/authorization should be done using Active Directory

First, I was looking at using TRAC which provides most of the above and some extra features (project management and bug/issue tracking). But we already have other project management (dotProject) and bug/issue tracking (Mantis) softwares in place and TRAC doesn’t seems like very straight forward to install and configure. So, I started looking at alternatives and there isn’t much out there in form of once package which can provide all of the above.

The solution which we ended up building is running on CentOS operating system, WebSVN and other dependency libraries. I ran into some issues while setting up the solution and went through number of articles and KBs available on Internet. Almost spent whole day on this and thought it might be useful for others if I put all the info in one article.

Target is to have a setup where we can browse all the repositories using WebSVN with URL

http://<hostname>/websvn

Each of the repository should be accessible using a URL which looks like
http://<hostname>/<repository name> (more…)

Read More

Windows Server 2008 Server Core Installation and Management

With release of Windows Server 2008, Micrsoft Windows team made some major improvements to overall architecture to make Windows operating system more stable, secure and reliable. Keeping the Windows 2003 tradition alive, Microsoft ships Windows 2008 in four versions – Web Server, Standard, Enterprise and Datacenter. But one major feature addition to 2008 is the ability to do the minimal installation of Windows 2008 without any graphical utilities which most of the admins don’t need. This feature is known as “Server Core” and its basically provides a minimal environment for running a specific server role. Admins can select to perform Server Core installation during the Windows 2008 installation. The result will be a stripped down installation of Windows without any traditional components installed such as desktop shell, GUI, Windows Explorer, IE and other MMC which otherwise get installed while doing full installation. With Server Core installation, all the management and configuration tasks will be performed using command line utilities.

You must be thinking, why would someone use the Server Core installation? Everything to be configured from command line…. that sounds like going back to era of DOS? Well, there are multiple advantages when using Server Core:

  • Reduced maintenance
  • Reduced attack surface
  • Reduced management
  • Less disk space required for installation as footprint is very small
But don’t get disappointed, Microsoft does allow you to manage Server Core installation using your favorite MMC from remote server or workstation. (more…)

Read More

HTML and XHTML Quick Reference Sheet

Common Elements

Element Value Examples
float: <position> float is used to float an element on the left or right margin.<position> could be none, left or right. <img src=”sample.jpg” style=”float: right” />
clear: <position> clear is used to display an element in the first available space where the specified margin is clear of floating elements.
<position> could be left, right, all or none.
<hr style=”clear: right” />
margin-top: <length>
margin-right: <length>
margin-bottom: <length>
margin-left: <length>
These elements are used to set the size of margins around an element.
<length> can be unit of length, a percentage of the width of the containing element, or the keyword “auto” (the default) which enables the browser to set the margin size.
<table style=”margin-top: 15px”>
<body style=”margin-left: 20px”>
margin: <top> <right> <bottom> <left> margin element combine all margin styles in a single style. <top>, <right>, <bottom> and <left> are the margins of the top, right, bottom and left edges. If you include only three values, the margins are applied to the top, right and bottom. If only two values are specified, the first value is applied to top and bottom edges whereas second value is applied to right and left edges. If you apply only one value, it is applied to all four edges. <img src=”sample.jpg” style=”margin: 0 0 5 15″>
<body style=”margin: 10″>
background-image: url(<url>) background-image attribute is used to set the background image for any element. <url> is the name and location of the image file to set as background. <body style=”background-image: url(sample.jpg)”>
background-repeat: <type> This attribute is used used in combination with background-image attribute. It controls how browser tile an image across and element’s background. The <type> can be one of keywords out of repeat (the default), repeat-x, repeat-y, or no-repeat. <body style=”background-image: url(sample.jpg); background-repeat: repeat-x”>
background-position: <horizontal> <vertical> This attribute is used to place the background image in a specific position behind the element. <horizontal> is the horizontal position of the image, and <vertical> is the vertical position. You can specify a position as the distance from the top-left corner of the element, a percentage of the element’s width and height, or by using a keyword. Keyword options are top, center, or bottom for vertical position, and left, center, or right for horizontal placement. <body style=”background-image: url(sample.jpg); background-position: 10% 20%”>
<body style=”background-image: url(sample.jpg); background-position: right bottom”>

(more…)

Read More

Most Useful Free Applications for Windows

Unlike any Linux distrubution, Microsoft Windows lacks number of utilities or tools that you will need from time to time. If you are IT professional, there are number of utilities you will need to get through your day in addition to what Microsoft Windows comes with. Thanks to open source methodology and licensing, number of these utilities are available free along with their source codes. And there are bunch of softwares available for Windows which are free but closed source which is totally fine as long as you don’t have to go through number of hoops to get your hands on the software.

For me, the free software is one:

  • which is totally free as in free beer ;)
  • which doesn’t comes with adwares, spywares or other kind of hidden methods to make some profits from the users.
  • which doesn’t require activation or registration after few days or otherwise some of the features will be locked down and so called ‘free’ app will be stripped down version of what you were expecting.

On the other hand, I love the free applications which provide in-built update checks and auto-update features and…. well lets not get too greedy :)

Lets get started with our list of applications. The list below is not sorted out by popularity or functionality because why take extra headache of sorting and I will keep adding new apps in the future.

(more…)

Read More