Giter VIP home page Giter VIP logo

poe-component-dbiagent's Introduction

POE::Component::DBIAgent 0.10 README
11-07-01

The DBIAgent is your answer to non-blocking DBI in POE.

This module was written because I was developing a system that was
bogging down at ONLY 1 million hits/day on dual 1GHz processors.
That's only 11.5 requests/second!  Needless to say, it was obvious
that something wasn't working right.

After much sweat, research, and profiling, I noticed an odd thing:
Sometimes, my per-request times were in the milliseconds.  Other
times, it was taking over 25 seconds to answer a single request.  The
difference?  DBI.  During the times that my response times sucked, POE
was blocking on a DBI request.  I was actually serving my requests,
all code considered, in milliseconds.  But in the steps between
assembling the response and delivering it, my program was stuck in a
state that was making a DBI call, and waiting for the response.

The answer?  FORK!  Or, more specifically, use POE's facility for
forking off child processes to handle long-running tasks while the
main program continues to cycle between states: Wheel::Run.

DBIAgent forks off a configurable number of helper processes for
running DBI queries.  The states that depend on the output of the
queries only get called when there is data for them to process.  No
more agonizing about query optimization in terms of milliseconds
because the rest of your program will suffer.  Leave that to the
operating system!  POE is designed for doing a lot of things
concurrently.  Waiting isn't doing, it's waiting... :-)

This module will ONLY work in the places where POE::Wheel::Run will
work.  This generally means, *nix.  Meaning, not on Windows (yet).

I can't take most of the credit for this module.  Fletch
(fletch@[email protected]) had already done alot of this, and
contributed the skeleton code for the Helper module.  The Queue module
is 99.6% his.  I just packaged it up and wrote docs... (*his* was tied
into his program... *I* made distributable. :-)

Rob Bloodgood <[email protected]>

poe-component-dbiagent's People

Contributors

robbloodgood avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.