[Ilugc] different network I/O handling methods

2012-03-31 Thread Girish Venkatachalam
Dear LUG,

Been a long while since I initiated a mail to LUG.

I thought I will discuss different network I/O schemes or rather the
 way CPU and memory is used to perform what most of us do today.

Be it google search or facebook or mail or whatever this is what is key.

Right from publishing SSLC results to Deepavali mails to some event
 like earthquake jamming communications, the ability to scale with load
 and the load handling capability of servers is put to test.

I am an expert in server side gear. I have been doing this the last 10
years and
 more and starting from OpenBSD kernel, IPsec, routing to Apache to web
 development I have seen quite a bit of programming techniques.

It is a no brainer that if you want performance you write in C. You may know
Linus Torvald's comments on C++.

Okay I am not really concerned about programming language right now.

Only the high level design and coding will just follow.

Broadly put there are a few ways by which multi processing is done.

1) fork() based process creation(Apache pre forked model)

2) multi threading

3) event based I/O loop handling

You should read the paper by Ousterhout, the author of Tcl about why
threading is a bad idea and event loops are better.

This has been repeatedly demonstrated not only in my real life experience
 but also by the success of Twisted Python or nginx server.

Apache used only two approaches, 1.x pre forked model and 2.x threading.

nginx did better through event based I/O.

A lot of UNIX Programmers do not know about select(2).

It is the easiest way to handle multiple sockets, be it STDIN, TCP or UDP.

You could also use poll(2). Nowadays I just use poll.It is better than select.

You also have many methods to monitor file I/O. FreeBSD uses kqueue(2) and
 Linux has inotify and friends.

All UNICes have event(3) library which is a generic library for
network and file I/O
 using the event loop model.

If you have stayed with me so far then you can also perhaps guess why a
straight forward light weight process(thread) cannot scale or improve.

It most of the time causes bugs and performance loss.

Reason is simple.

By having multiple network connections you get performance. This is how download
 accelerators work. But using pipelining also improves performance which is
 not using multiple connections.

How to resolve this paradox?

Multiple network connections get you the bandwidth that are shared on
the LAN, so
 you can use the WAN bandwidth to your advantage.

However in protocols like SMTP and HTTP, creating a separate
connection for every
 mail or web request is a drag on performance.

Enough for now.

-Girish

-- 
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] different network I/O handling methods

2012-03-31 Thread 0

> Been a long while since I initiated a mail to LUG.
>
> I thought I will discuss different network I/O schemes or rather the
>   way CPU and memory is used to perform what most of us do today.

It will be better if you put this in a web page and provide the link. It 
is difficult to read, mostly because, formatting & plain text just don't 
go well together unless you put a lot of effort in.

> It is a no brainer that if you want performance you write in C. You may know
> Linus Torvald's comments on C++.
>

Who gives a damn about what he thinks about C or C++ for that matter. I 
hate C++ myself and he didn't have say it. I hate java too but I guess 
the discussion on "programming languages I hate" doesn't belong here. 
People who like C++/Java, please don't feel offended, this is just a 
personal opinion/choice.

-- 
0
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] why embedded Linux not having swap partition.

2012-03-31 Thread Krishna
On Thu, Mar 29, 2012 at 7:38 AM, kenneth gonsalves
wrote:

> On Wed, 2012-03-28 at 15:21 +0200, Krishna wrote:
> > > This thread is full of theoretical stuff, lot of useful info but
> > > nowadays I only deal with practical reality.
> > >
> >
> > This is No Theory, I am not understanding what you mean by practical
> > reality.
> > Can you explain the difference? How far is it from practical?
>
> if we say it, it is theory. If he says it, it is practical.
>

I agree with you ;)
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] different network I/O handling methods

2012-03-31 Thread Balachandran Sivakumar
Hi,

On Sat, Mar 31, 2012 at 8:24 PM, Girish Venkatachalam
 wrote:
>
> 3) event based I/O loop handling
>
> You should read the paper by Ousterhout, the author of Tcl about why
> threading is a bad idea and event loops are better.
>

This is something that is easy to get wrong. I still see a lot
of people argue that multi-threaded is the way to go. But event based
approaches are a lot better. Also, I guess beyond a limit,
multi-threaded approach doesn't scale.

>
> You could also use poll(2). Nowadays I just use poll.It is better than select.
>
> You also have many methods to monitor file I/O. FreeBSD uses kqueue(2) and
>  Linux has inotify and friends.
>
> All UNICes have event(3) library which is a generic library for
> network and file I/O
>  using the event loop model.
>

 In GNU/Linux, we now have epoll(7). Epoll is an event based I/O
notification based library. scales better normally, but can be a
little tricky if we are not used to event loops/event based
programming. Thanks

-- 
Thank you
Balachandran Sivakumar

Arise Awake and stop not till the goal is reached.
                                                             - Swami Vivekananda

Mail: benignb...@gmail.com
Blog: http://benignbala.wordpress.com/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] different network I/O handling methods

2012-03-31 Thread Sudharshan Sreenivasan

On 31-Mar-2012, at 2:19 PM, Balachandran Sivakumar wrote:

> 
> In GNU/Linux, we now have epoll(7). Epoll is an event based I/O
> notification based library. scales better normally, but can be a
> little tricky if we are not used to event loops/event based
> programming. Thanks
> 


And then there are libev[1] and libevent[2] libraries which offers a nice 
abstraction over 
poll, kqueue, epoll, select etc. for events based programming.

GLIb[3] has a very easy interface to write an event loop too. Feels OOP but in 
C if thats your cup of tea ;).

Needless to say, programs written using these libraries are portable across 
multiple platforms.

[1]: http://software.schmorp.de/pkg/libev.html
[2]: http://libevent.org/ 
[3]: http://developer.gnome.org/glib/2.30/glib-The-Main-Event-Loop.html

- Sudharshan



___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] Any report making tools in php for MYSQL database?

2012-03-31 Thread Ganesh Kumar
Hi Guys,

I am new to php mysql report report making. Any tools available?. I
basically need to have a layout setup. It can be making pdf.give any
clues.
My database table having four columns when user select date.
particular date, data will generated to pdf file.

-Ganesh.
Did I learn something today? If not, I wasted it.
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Any report making tools in php for MYSQL database?

2012-03-31 Thread Balachandran Sivakumar
Hi,

On Sun, Apr 1, 2012 at 9:03 AM, Ganesh Kumar  wrote:
> Hi Guys,
>
> I am new to php mysql report report making. Any tools available?. I
> basically need to have a layout setup. It can be making pdf.give any
> clues.

 Should it be specifically in PHP? If not, you can try
Python's report lab. Another option is to use phpmyadmin. IIRC, it has
options to generate some reports. For multiple users, you can provide
logins with restricted privileges. But it needs to be tried out
because I am not sure of the exact set of features that it supports.
Thanks

-- 
Thank you
Balachandran Sivakumar

Arise Awake and stop not till the goal is reached.
                                                             - Swami Vivekananda

Mail: benignb...@gmail.com
Blog: http://benignbala.wordpress.com/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] Pen input device for Linux

2012-03-31 Thread prasannatsmkumar
I am in need of a device which will show what I write on a pad in computer
screen - this will help while I read or draw some thing and want that in
digital form. Is there any such device that works with Linux? What is the
average cost of such device? It will be good if I could get something for
about 500Rs.
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Any report making tools in php for MYSQL database?

2012-03-31 Thread Girish Venkatachalam
On Sun, Apr 1, 2012 at 9:03 AM, Ganesh Kumar  wrote:
> Hi Guys,
>
> I am new to php mysql report report making. Any tools available?. I
> basically need to have a layout setup. It can be making pdf.give any
> clues.
> My database table having four columns when user select date.
> particular date, data will generated to pdf file.
>


Dunno what you mean by layout.

You have several different PDF generation Perl modules on CPAN.

They take input in various forms, text is obviously the default choice.

So you can use an SQL query tool that can get you text output
 of your columns and you can generate a table from it as a PDF file.

I use PDF::Table, PDF::API2.

-Girish
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] [OT?] Many sites not opening - BSNL BB

2012-03-31 Thread Natarajan V
Hi,

Am not very sure if it is an OT. But potential
solutions/troubleshooting guide could be of help.

I have a BSNL BB connection connected to a PC and a Laptop through an
ADSL router NATed to a NETGEAR WiFi router. The PC runs on Kubuntu
10.04 64 bit and the laptop runs on Kubuntu 9.04 32 bit. The browsers
that I tried are FireFox 11, Opera 11.62 for Linux, Google Chrome,
Konquerer, links, lynx, etc...

Some of the sites such as icicilombard, slashdot, some of my corporate
sites, hotmail, yahoo mail, the hindu, etc.. aren't accessible. Some
of these sites stop loading midway, while someothers do not respond
(timeout). I ran a traceroute to these sites and the response is
similar to the results from www.tracert.com. When I try to connect to
the internet through my Airtel 2G (laptop connected to cellphone),
these sites open up. I tried to open these sites from my brother's
place, which has BSNL BB (different telephone exchange)  connected to
Kubuntu 32 Bit 11.10. These sites open without issues. I also verified
if there are issues with the DNS servers, and confirmed that it isn't.

This makes me think that there is some problem with the routing of the
BSNL routers in my exchange, or an issue with my router.. Is there a
way to confirm this? If that is the problem, is there a way to
circumvent the same?


with regards,
Natarajan
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] [OT?] Many sites not opening - BSNL BB

2012-03-31 Thread Balachandran Sivakumar
Hi,

On Sun, Apr 1, 2012 at 11:33 AM, Natarajan V  wrote:
> Hi,
>
> I have a BSNL BB connection connected to a PC and a Laptop through an
> ADSL router NATed to a NETGEAR WiFi router. The PC runs on Kubuntu
> 10.04 64 bit and the laptop runs on Kubuntu 9.04 32 bit. The browsers
>

 I have a BSNL broadband connection, with a D-Link router(No
Wi-Fi, this is wired).

> Some of the sites such as icicilombard, slashdot, some of my corporate
> sites, hotmail, yahoo mail, the hindu, etc.. aren't accessible. Some

   I am able to access all these. In fact, the hindu is something that
is always open in my browser :)

>
> This makes me think that there is some problem with the routing of the
> BSNL routers in my exchange, or an issue with my router.. Is there a
> way to confirm this? If that is the problem, is there a way to


   I don't think they use different routers for each exchange.
Can you try to get your brother's router and use it from your
place(after the necessary config changes) ? That will help is identify
if the issue is with your router or with BSNL's. Thanks

-- 
Thank you
Balachandran Sivakumar

Arise Awake and stop not till the goal is reached.
                                                             - Swami Vivekananda

Mail: benignb...@gmail.com
Blog: http://benignbala.wordpress.com/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Pen input device for Linux

2012-03-31 Thread Suraj Kumar
On Sun, Apr 1, 2012 at 9:21 AM, prasannatsmkumar  wrote:

> I am in need of a device which will show what I write on a pad in computer
> screen - this will help while I read or draw some thing and want that in
> digital form. Is there any such device that works with Linux? What is the
> average cost of such device? It will be good if I could get something for
> about 500Rs.
>

The device you're looking for is called a Graphics Tablet. There may be
cheaper devices  / second hand devices available within your budget but I'd
say the ones from 'wacom' are the sought after value-for-money deal (will
cost you about Rs.2000/- at a min, IIRC). I have a "Wacom Bamboo" model
tablet - and I use it extensively with gimp for hobby graphics work.

"gromit" is a useful screen-pointing / drawing utility that may also be
very handy for rough-work / demo-like uses.

cheers,

  -Suraj

-- 
Career Gear - Industry Driven Talent Factory
http://careergear.in/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] [OT?] Many sites not opening - BSNL BB

2012-03-31 Thread 0

> This makes me think that there is some problem with the routing of the
> BSNL routers in my exchange, or an issue with my router.. Is there a
> way to confirm this? If that is the problem, is there a way to
> circumvent the same?
>

It is most likely a local issue. Can you provide the following details ? 
It will help debug the issue.

1. ping ilugc.in
2. ADSL Line Attenuation (Downstream & Upstream)
3. ADSL Noise Margin (Downstream & Upstream)
4. ADSL Connection Speed (Downstream & Upstream)
5. Do you have the modem connected after the splitter ?

You can get the ADSL details from the BSNL router. If you don't have the 
username:password try the default admin:admin.

-- 
0
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc