Quote:
Originally posted by HQ
XXXManager,
I'll think about the 1GB RAM... I'm leasing, so it is a bit more expensive. $40 extra / month. That's actually not too bad.
Explain DB-connection pooling. Does it keep things resident in memory? Does it keep the connections opened so you do not have to connect and disconnect to the DB all the time? What is it exactly? Sounds similar to what I want mod_perl to do, just keep the fucking thing open and compiled so I do not have to re-do that 10 times every second.
Right now, to remind you, I am using PERL/DBI/MySQL.
|
Well. dont know about prices and server. More memory makes sense. especially 1G. Maybe consider colocated server
Anyway - DB connection pooling:
Once you said you use DBI - I shouldn't care (for that DB conn pooling) what DB you use because its all hidden behind the DBI.
Anyway...
DB connection pooling is - creating a "pool" of opened connection to the DB and when ever your script needs a connection to the DB it takes one from the pool.
This saves the time and resources needed to create a new connection. This actually helps in two places - both your web-server and your DB server (assuming they are different machines). anyway - even if its the same machine - its helps him twice. Openning a new DB connection is very laborious. It takes alot (relatively) time, cpu and memory to do that. Instead - pulling an already connected connection from the pool is very fast and easy on resources. there are mechanisms to ensure the connection is valid (like db pinging etc) but there are all done for you and you need not to worry about them. basically - you keep using your DB as you are now - mod_perl wraps all the DB commands and "covers" them with a layer that does all that funky shit.
Just to let you realize this thing - it can help you turning your script from a server killer to a neat code that can sometimes run hundrads of times faster - literally speaking!
You ofcourse need to configure it right - so you dont have too little connections opened (keeping your script waiting in queue for a connection too long) or too many connections (keeping your resources low and maybe even killing performance)
BUT in general - if you do heavy DB stuff in perl MOD_PERL will help you FAST and ALOT. both DB conn pooling and keeping a pool of processes of the compiled code.
Pools are popular with mod_perl
