[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    mysql: FCGI and mysql
From:       "Alexis S. Panagides" <alex () inova ! net>
Date:       1997-09-30 16:12:23
[Download RAW message or body]

Taking a great suggestion from Monty, I made my search engine perl script
fast cgi and had a perceivable increase in speed.

I do have some questions though. Following the FCGI documentation I first
do some initialization then enter the FCGI loop with the core of my
program. The code snippet below shows that part of my initialization is the
creation of my mysql connection, which I assume is a good thing because it
make the connection persistent across server calls (ie, no need to reconnect).

Code snippet..

$dbh=Mysql->Connect('',"test_inova");
$cgi=new CGI;
while (new CGI::Fast) {
print $cgi->header; 

...end code

Question:

With the interest of speed, should I create multiple processes of my script
as per the FCGI "process X" argument or should I just fork(), i.e.
multithread, my FCGI process? If I fork(), can I do this within the FCGI
loop and thus use the same mysql connection for each thread?

I would use more processes but each eats up 2.6 Meg. I am assuming that I
will have a decent number of hits. Up to a million a month eventually (I
hope). Although I am not sure how many FCGI processes I should run to
comfortably take care of this traffic.

Any feedback would be wonderful.

Many thanks to this great list,
Alex Panagides
Ceara, Brazil

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic