Google
 

Saturday, December 25, 2010

Load Balancing LTSP clients using Ethernet Bridging

Typical LTSP setup has the following configuration:


+-------------+
| Server |
+-------------+
| eth0 | eth1 |
+------+------+
/ |
/ |
Internet Switch
|
+---------+-------------+
| | |
Client-1 Client-2 ... Client-n

LTSP Clients

The problem with this is that the network card bottlenecks the performance. Once the number of clients increases (usually >5), even though the server is capable of handling the load, the network card (usually, 100BASE-TX) can't provide the throughput.

There are two solutions to this:
1. Use 1000BASE-T (gigabit) ethernet cards and switches
2. Use load balancing

Using gigabit ethernet cards solves the problem but they are expensive. The switches are expensive too. Plus there are flow control problems if the clients have 100Base-TX cards, which is usually the case.

Load balancing is an easier and cheaper approach. Although this can also go fairly complicated, here i'm going for the simplest one using ethernet bridging.

The trick is to use multiple NICs connected to multiple switches. Then bridge the cards to provide a common interface. Here's what it looks like:

+--------------------+
| Server |
+------------------- +
| eth0 | eth1 = eth2 |
+------+------+------+
/ | |
/ | |
Internet Switch Switch
| |
+----+-------+ +----+-------+
| | | | | |
C-1 C-2 ... C-n C-1 C-2 ... C-n

LTSP Clients LTSP Clients

Lets say, there are three NICs: eth0, eth1 and eth2. eth0 is connected to internet. eth1 (say, 192.168.0.254) is connected to LTSP clients. eth2 is unused and is supposed to be bridged with eth1.

First install bridge-utils
# apt-get install bridge-utils
Create a bridge (br0) and add eth1 and eth2 to it
# brctl addbr br0
# brctl stp br0 off
# brctl addif br0 eth1
# brctl addif br0 eth2
Now release the IP addresses of eth1 and eth2
# ifconfig eth1 down
# ifconfig eth2 down
# ifconfig eth1 0.0.0.0 up
# ifconfig eth2 0.0.0.0 up
Assign the LTSP IP address to bridge.
# ifconfig br0 192.168.0.254 up
Now connect eth1 and eth2 to separate switches, and each switch to (equal number of) LTSP clients.

Tuesday, December 21, 2010

Tiny Issue Tracker

I find most issue trackers bloated for most of my requirements. I usually need a simple issue tracker to communicate between couple of persons but most issue trackers available have plethora of features, usually with full blown database.

So here's my solution: Tiny Issue Tracker. A PHP/SQLite based, single-file issue tracker.
Source: https://github.com/jwalanta/tit


Features

- Super Lightweight (currently ~17KB, ~500 lines of code)
- Multi-user
- Email Notifications
- Auto DB creation on first run
- Issue Priority (High, Medium, Low)
- Comment on issues
- Throw and run!

Installation is as simple as it can get:
- Modify configurations in the file (tit.php)
- Upload to webserver (rename if necessary) & load from browser

Demo
http://diyaalo.com/tit
username, password = demo, demo123
Check email notifications at http://demo123.mailinator.com/

PS: The acronym is a complete coincidence though :P

Tuesday, December 14, 2010

HackJatra v0.1

Jitendra started the discussion, but i wouldn't be wrong if i say we all had the itch. A hackathon was in everybody's mind since quite a while. So we started a email discussion among fellow hackers, mostly Pulchowk Campus BCT'ians. We had few projects in mind - ATM Locator, Khanchuwa and Online Nepali Donation system. All we needed was a date for the event. But before we could finalize that, we coined a term for the event.

HackJatra. For non-Nepalis out there, Jatra means festivity. Later the term was also informally understood as "Hack by day, Jatra by night" :P. More on that later..

Finally, we fixed the date and venue: 11th December, 2010 at IT Park Banepa, starting from 9am.


The project we did were:

1. ATM Locator
Map enabled app to list and search ATMs in Nepal.
Team: Abhinav Singh, Bibek Shrestha, Jitendra Harlalka, Subodh Satyal, Sushil Shilpakar

2. Khanchuwa
Community based delicacies listing portal. The idea was discussed at BarCamp Kathmandu 2010.
Team: Jwalanta Shrestha, Abhishek Singh

3. Tweet NEA
Automated twitter accounts to tweet the loadshedding schedule.
Team: Manish Modi, Suraj Sapkota

More on the projects in the wiki.

Needless to say, the event was extremely fun. The joy of hacking for fun with extremely talented fellow hackers is indescribable. The projects we started are almost done; few more hours of collaborations and they'll all be ready to launch.


Future plans:
1. Do some branding of HackJatra; create a logo, have a website and make the projects more accessible and sharable.
2. Encourage other teams to do similar HackJatras
3. Do another HackJatra ASAP

O BTW, we even had booze party by night (Jatra :P)