Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 15747 invoked from network); 25 Mar 2007 05:27:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Mar 2007 05:27:55 -0000 Received: (qmail 11421 invoked by uid 500); 25 Mar 2007 05:28:02 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 11371 invoked by uid 500); 25 Mar 2007 05:28:01 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 11361 invoked by uid 99); 25 Mar 2007 05:28:01 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Mar 2007 22:28:01 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [216.138.240.12] (HELO mail.acerenting.com) (216.138.240.12) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Mar 2007 22:27:50 -0700 Received: from daniel (CPE0004e2b14a6e-CM0017ee61afdc.cpe.net.cable.rogers.com [74.122.9.143]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.acerenting.com (Postfix) with ESMTP id 885A11580058; Sun, 25 Mar 2007 01:28:08 -0400 (EDT) Message-ID: <000c01c76e9f$e7c21460$7802a8c0@dc.bestningning.com> Reply-To: "Daniel Qian" From: "Daniel Qian" To: , References: <072201c76c85$06861850$66d482d8@HP72472929110> <1174759443.5715.11.camel@test.asus> Subject: Re: load data at server startup - is ap_hook_post_config() theright place? Date: Sun, 25 Mar 2007 00:31:44 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="gb2312"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.3790.1830 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830 X-Virus-Checked: Checked by ClamAV on apache.org ----- Original Message ----- From: "Joachim Zobel" To: Sent: Saturday, March 24, 2007 1:04 PM Subject: Re: load data at server startup - is ap_hook_post_config() theright place? > Am Donnerstag, den 22.03.2007, 09:21 -0400 schrieb Danie Qian: >> I am new to module development but I want to develop a module so I can >> manage the uri of the thousand of sites more efficiently. What I want is >> to >> load a mysql table data into the memory of Apache server at its startup >> stage for fast processing of requests later. > > This is probably a misconception. If you have a database where you can > do an indexed lookup loading the table into memory will be _slower_ from > a certain amount of data on. > my database server is a remote box so I think it is slower for every request to look up in the database server than a local array or table in memory, especially in our case most the pages contain many embedded images which means many request per page. > You can of course implement an index tree in memory, too. But why > reinvent the database if you already have one. > the mysql table has many fields but only a few of them are useful to apache. but loading them in memory in advance I can reduce the size and speedup the lookup Thanks, Daniel