httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Issac Goldstand <>
Subject Re: mod vhost sql
Date Sat, 09 Jun 2007 18:03:57 GMT
Maikel Punie wrote:
> hey,
> I'm trying to write a mod_vhost_mysql, but this time one that can get
> all the data from the mysql db, and not just the docroot.
> So basically for every request the ap_hook_translate_name() is called to
> handle the function inside my module.
> at the moment for every request thats done the modules does the following:
> 1- create a db connection
> 2- do the sql query
> 3- parse results
> 4- close db
> 5- return OK
> basically this isn't really nice to handle, creating a db connection and
> closing it for every request will create an enormous pressure on the
> mysql db server.
you're correct :)
> So now the question, is there a hook (or hooks) that is defined so i can
> call it,
> 1- just before the server actually starts running (after config parsing
> i guess)
> 2- just before the server stops running
Don't worry about this.  Tie a cleanup function to the config pool and
it'll do it for you.  But why do you need to keep the handle open the
entire time in the first place?  Just add the mysql data to the config
tree and clean up immediately...


View raw message