About me

Paolo Iannelli Picture

Paolo Iannelli

Big Daddy at Mega Labs

Location
Amsterdam Area, Netherlands
Industry
Information Technology and Services
Interests
C, Python, Big Data, Scalability, High Availability, Performance
Description
Expert Software Engineer with more than 12 years of experience.
Strong in critical thinking, problem solving and high performance architectures.
Paolo Iannelli Labs Rss

How To Use Memcache with Magento

Posted on : 11-04-2011 | By : Paolo Iannelli | In : E-Commerce, Magento

Tags: , , , , , , ,

0

In this short post I will show you how to use memcache in your magento setup.

First of all you need to install memcache and start it. If you are using a debian/ubuntu/aptitude enabled OS, you may run:

Once this is done, you need to modify your app/etc/local.xml file and locate the <cache> tag. Once you find it, you may replace it with the following :

And that’s all, you don’t have to do anything else ! Meanwhile, to give your shop another boost, you may enable compression, if your server is capable enough to handle it.

If you have any problems or questions, please leave a comment below !

How To Setup Magento + Nginx + FCGI + Ubuntu

Posted on : 10-04-2011 | By : Paolo Iannelli | In : E-Commerce, Magento, System Administration

Tags: , , , , , , , , , , ,

3

The tutorial I will write today is about setting up Magento (version 1.4+) on a Ubuntu box, using nginx and php5-cgi.

Preparing the system

I assume that you already installed MySQL server and setup a database / user for the Magento instance you will run.

Lets begin installing all the packages needed for our purposes :

Once you have installed them, you need to have a startup script to launch your fastcgi processes during system boot. To do so, you may create the file /etc/init.d/fastcgi with the following content :

In /usr/bin/php-fastcgi you will have the following

Now you set both files executable and place the first one in startup scripts :

In the next page we will download Magento and setup nginx.

Running ESXi 4 inside ESXi 4

Posted on : 22-03-2011 | By : Paolo Iannelli | In : System Administration, Virtualization

Tags: , , , , , , , , , , ,

2

Today I had to test a setup of ESXi 4 but I didn’t have any physical server to test, so I decided to virtualize ESXi 4.1 in my existing ESXi 4.1 instance.
It took a while, browsing VMware knowledge base and some forums, but then was even easier than what expected.

In this short post I will make you a simple list of what to do to get everything working in a snap of fingers.

Before you start : bear in mind that you can’t launch 64 bit machines virtualized in the already virtualized ESXi server. This is a known limitation.

So if you plan to create only 32 bit VMs, this tutorial is fine for you.

To begin, you need to create a Virtual machine with at least the following specs :

  1. 2 CPU
  2. 2 Gb RAM (with less you can’t install ESXi)
  3. 1 or more NICs of type E1000 (flexible or VMXNET2/3 won’t work)
  4. SCSI bus Logical Parallel or Logical SAS (no paravirtualized)
  5. Allocate a good amount of disk space for the datastore.
  6. Set Guest Operating System to Red Hat Linux version 5 or 6, 64  bit.

After you created the virtual machine go in :

Edit Settings -> Advanced -> General -> Configuration Parameters

click Add Row and set monitor_control.restrict_backdoor to TRUE

Go now in the vSwitch properties relative to the virtual machine you just created and under the Security  tab enable the Promiscous mode (Accept)

Now you can install your ESXi host simply mounting the ISO image as usual. Once installed you can either attach the server to an existing vCenter instance or use the server as standalone.

In short :

  • You create the VM as above
  • Set the configuration parameter specified
  • Configure promiscous mode
  • Install and use the ESXi host !

 

Why would you do that?

Well in some cases it may sound OK to test some functionality of ESXi (getting familiar with CLI or API for instance) without having a real hardware for it. I think is enough as a valid reason, isn’t ?

Remember one thing : try always to change the MAC address of the created VMs inside the virtualized ESXi instance else you may get a MAC address conflict and loose connectivity on one of the affected VMs.

If you have any question just leave me a comment below !

RabbitMQ in real world

Posted on : 19-03-2011 | By : Paolo Iannelli | In : Monitoring, Python, Software Development, System Administration

Tags: , , , , , , , , , ,

4

What is RabbitMQ?

Shortly, RabbitMQ is a message broker that allows you to exchange messages between heterogeneous applications.
You can find more information at http://www.rabbitmq.com.
What you do with it is just sending messages (that can be any kind of information : binary / plain-text, doesn’t matter!)  to a so-called “queue”. Any client attached to this queue will retrieve the messages.

Cool ! But why RabbitMQ and not an API ?

Well, choosing between API and messaging might be hard if you are not familiar with messaging services, but I will show you just an example where RabbitMQ is really powerful compared to a simple API.
Imagine you have 4 temperature sensors in 4 different racks. Each of these sensors are attached to a server connected to the internet. Your goal is to read the temperature of every rack and display it.
What you can do is having an API in those servers that just output the value read from the sensor. Then, from the client, you request via a REST API this value.
Alternatively you can have a centralized REST API and force each server to run a script every X seconds to update the value with a PUT request to this REST service.

REST API for temperature monitoring

So, everyone agree that the second solution would work pretty nicely. In fact, is true.
But, what if tomorrow we want to organize those “temperature servers” by location, representing for instance a datacenter in USA and one in Canada?
I have no doubt that the first thing will come in your mind is : I change the API and put a “location” field somewhere so I know from where the data comes from.
Probably the change wouldn’t take so much effort but still you have to modify an API to achieve the goal.