In your Apache httpd.conf, do you have the line

KeepAlive On

- this is the Apache directive to turn on persistent connections. You will
also want to play with the MaxKeepAliveRequests directive, if you set it to
0 then it will allow an unlimited number of connections. 

There may be more to it than this, but it's worth checking.

HTH
Jon



-----Original Message-----
From: Kayra Otaner [mailto:[EMAIL PROTECTED]]
Sent: 10 January 2001 15:32
To: [EMAIL PROTECTED]
Subject: [PHP] to be persistent connected or not to be persistent
connected


Hi,

I am searching for detailed information about persistent connection. I've
looked at all the web sites just for "persistent" word but always I found
the same information. All the time people are saying "persistent connection
is good if you are dealing with lots of small queries".

Here is my case: This week I've upgraded necessary server software to the
latest versions of Php and Apache (Php 4.04 and Apache 1.3.14) As I did
before upgrade I've compiled Php as an Apache Static Module ( mod_so is not
necessary ) And check MySQL for persistent connection. My site is focused on
free web services like graphic counter, polls, url redirection, webring and
news syndication to personal web sites. (www.kelalaka.net, it is Turkish
only). Only for graphic counter services, it counts 180.000+ hits per day.
It means 350.000+ queries per day. Day average is 250 query , 60 connection
per minute, but in popular hours it is very high and MySQL server gives "Too
many connections" errors. MySQL server is default and set to 100 connection
at most.

Yesterday I ordered more ram in order to increase connection number of MySQL
from 100 to 200+ connection. But today I realized that my server wasn't work
with persistent connection.
All the Php code contains mysql_pconnect for MySQL connections. Apache and
Php works in module type not in cgi mode. I've looked at phpinfo() in order
to see anything that can indicate status of persistent connection.  It says
"mysql.allow_persistent is On". But again in phpinfo it says "Active
Persistent Links 1" . It is sometime changes to "0". In MySQL I am looking
for active processess by using "mysql" and "show processlist" commands it
shows me 100 active links but most of them are in sleep state. In php.ini
there is a line in order to set maximum number of persistent connection and
I set it to just 25.
If somebody uses mysql_pconnect's instead of mysql_connect in Php cgi mode,
he doesn't see any error messages. All mysql_pconnects work like
mysql_connect.

My questions :
1 - How can users exactly determine whether they are using Php as a module
or cgi mode? (from phpinfo or ..?)
2 - Is it sufficient Php and Apache compiled in static or dynamic module
version in order to use mysql_pconnects in Php code? Anything to do with
MySQL?
3 - In a Apache + Php module compiled system is it normal to reach more than
predefined connection number in php.ini? (100 active connection but 25
defined in php.ini. In phpinfo shows same settings in the php.ini file (it
shows 25 max persistent connection))
4 - Is there any web page containing a real how-to and tutorial about
persistent connection? (If not I will certainly prepare one in a few weeks
:-))

Any kind of help will be appreciated...


Kayra Otaner
www.kelalaka.net





-- 
PHP General 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]

-- 
PHP General 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