MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Hardware and Performance



Quoting Colin Mitchell (colin@5points.net):
> 
> There is a lot of overhead involved in establishing the connection between
> the SQL server and minivend.  Sockets need to be opened, etc.  In my
> network, we have a box dedicated to running mySQL, so minivend needs to
> establish a TCP connection to the server, which takes even longer than when
> they are on the same machine.
> 
> Anyway, I think Allan's point is this - a lot of programs keep a persistient
> connection open to the SQL server.  This way, that connection overhead isn't
> a problem.  It's not particularly impossible to setup.  Essentially, you
> keep a pool of already opened connections to the server, and you use those
> whenever possible instead of opening a new one.
> 
> Apologies if this was obvious or if I missed the point - Colin
> 

That part is obvious; I can probably reduce connections by doing only
one connection per separate database rather than one per table in a
single catalog, hashing the connection parameters and saving handles. My
understanding is that DBI already does this, though.

The part that is not obvious is how you do anything more in a forked
server setup. Essentially, you would have to pass data through a shared
memory space. Unless it is a threaded, and not a forked, implementation
things are not obvious. The overhead of this could easily kill any
savings.

If you pre-opened handles based on a return value, that might
help keep connections opened for a heavily-used catalog. Or you
open one global one per catalog and keep it open. But none of
these are perfect.

Opening or not before forking increases latency to what I think
is an unacceptable level.

Again, I do know what the problem is, though I still don't see numbers
from anyone. If anyone has a suggested implementation or approach,
again I am all ears. Even a pointer to a book would do; none that I
know of discuss this type of thing in detail.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
                                    131 Willow Lane, Floor 2  | ||  _ \
It's a little-known fact            Oxford, OH  45056         | || |_) |
that the Y1K problem caused         <mikeh@minivend.com>     |___|  _ <
the Dark Ages. -- unknown           513.523.7621 FAX 7501        |_| \_\


Search for: Match: Format: Sort by: