Hi everybody,

We recently had (and have) similar problems running PHP4/Apache with 10 
FreeBSD Clients and a SunE450 with Oracle 8.1.6. The machine is quite 
powerful (4 procs, 4 Gigs RAM). Anyway, we had to limit the number of 
simultaneous dedicated connections after our server was blown up with open 
connections, the apaches haven't closed (well, about 4700 oracle processes, 
not so funny). The main problem is that Oracle spawns a process for _each_ 
connection opened to the DB.  The DB runs in dedicated mode, PHP had several 
unreproducable errors running the DB in Shared or MTS mode.

If anyone has a hint what the hell is going wrong, please let me know ...

>Yes, same question. The only thing i know about, is that, if you are running
>php not ass an module, your connection will die right ever script executing
>therefore making OCIPLogon = OCILogon.
>
>If run as module the connection will last till your server thread is
>regenerated. Therefore it can have a very dark side effect if the
>connections are not reliable reused: imagine 250 Apache Spawns with each
>hundreds of OCI-COnnections still open ...
>be carefull!
>
>And this is exactly my problem. I can not try tghis since the machine is
>running heavy traffic unless i know at leasst the theory
>
>Another Idea of reduicing Logon overhead is to run the server in MTS - Mode
>which does not cause the Oracle Server to start an dedicated ServerProcess
>for every Logon/Session.
>
>Well, suggestions please ;-)
>
>mk

I don't know exactly _what_ your script is doing, anyway running PHP as CGI 
will be quite slow, as once opened and used multiple times (e.g. persistent) 
connections are not available. The way, persistent connection work is quite 
simple: the root Apache process with the root PHP instance holds a pool of 
connection resources. Now if you run OCIPLogon, PHP looks for opened and 
unassigned connections first. If no such resource is present, it simply 
opens a new connection to the database and adds it to the resource pool. 
After a script has finished, the free, but opened connection is returned to 
the pool. This is what is called persistance. By nature, this feature is not available
in CGI PHP, since the CGI instance is the root instance and all connections
are definitely closed upon termination.

Maybe a solution would be a PHP CGI-Script running _permanently_ performing 
periodically select/insert's ? And, this sounds very funny, another way is 
to run the insert/select part in Apache, returning data to the calling 
application via HTTP. This _might_ still be faster than calling PHP as a CGI 
hundred's or thousands of times ...

Check it out, and hope this helps.
Victor



>-----Ursprüngliche Nachricht-----
>Von: Serge Paquin [mailto:[EMAIL PROTECTED]]
>
>I am using Oracle8i and want to make a little php script that will be run a
>huge amount of times (i hope <g>).  PHP has the OCIPLogon for persistent
>connections and am wondering the details of how it works.
>
>I want the php script to run a simple insert then select statement and would
>like to avoid a huge logon penalty that comes with creating a new session
>to oracle since the life of the program is very short and the frequency
>very very high (again I hope).


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to