LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > default php.ini mysql.allow_persistent

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2006, 07:32 AM
sofatime sofatime is offline
Senior Member
 
Join Date: Jul 2006
Location: Switzerland
Posts: 65
Default default php.ini mysql.allow_persistent

I noticed that in the default php.ini for lsws mysql.allow_persistent is Off. I understand that this should be off if you are using CGI for PHP, because those processes die anyway, but wouldn't it be better to turn this On for lsphp? As the php process stays up anyway and could reuse the connections to mysql?

Thanks for info
Daniel
Reply With Quote
  #2  
Old 07-20-2006, 09:42 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Sometimes, a persistent mysql connection may hang PHP process and causes various trouble. So we recommend turning it off. You can turn it on if you want to.
Reply With Quote
  #3  
Old 07-20-2006, 02:02 PM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
Generally LiteSpeed packages will include very "conservative" configurations.

Persistent mysql connection from php has always been a problem with large scale operations in the past so we will play it safe. Users are more than welcome to performance-tune their php.ini to the max. Let us know how well it works with your setup and traffic level.
Reply With Quote
  #4  
Old 07-25-2006, 12:22 PM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
We have performed reliability testing with PDO and mysql persistent connection enabled in the last few days and the results are not good and re-affirms the fact that users should not enable mysql persistent connection under high volume situations.

Please note persistent test is with PDO mysql module. Not with mysqli or mysql extension directly.
Reply With Quote
  #5  
Old 07-26-2006, 02:59 AM
sofatime sofatime is offline
Senior Member
 
Join Date: Jul 2006
Location: Switzerland
Posts: 65
Thank you for the information. I will leave it off for now and try it later. I am quite new to PHP, but in our ColdFusion installation we only use persistent connections.
Reply With Quote
  #6  
Old 07-27-2006, 08:36 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
I believe it was fine to use persistent connections in ColdFusion because of the very different way both engines connect to mysql.

ColdFusion is basically a java engine using mysql's JDBC type4 driver. JDBC provides builtin connection pooling. When you use persistent connection, JDBC is able to manage dead connections.

PHP mysql modules connectis to mysql server directly with no inbetween connection pooling ability.

JDBC pooling method allows a more reliability operation when using persistent connections.
Reply With Quote
  #7  
Old 07-27-2006, 08:41 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
One more note and regarding performance.

Non-persistent php mysql connections can be just as fast as persistent conections provided your mysql server is tuned correctly:

my.cnf: thread_cache = 16

The thread_cache value in my.cnf must be configured to a value just high enough so when viewing statics, mysqladmin extended-status, "Threads_created" value does not increase during peak hours. Do not set it too high and suffer wasted cpu cycles.
Reply With Quote
  #8  
Old 08-04-2006, 11:08 AM
sofatime sofatime is offline
Senior Member
 
Join Date: Jul 2006
Location: Switzerland
Posts: 65
Ok, thanks, I have configured that setting and will see how it performs.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
default server page felosi Install/Configuration 10 06-20-2007 12:23 AM
syntax of Expires Default gjanga Install/Configuration 1 05-22-2007 04:27 AM
please list default settings in all popup help tips aww Feedback/Feature Requests 1 05-05-2007 01:04 PM
Upgrade replaced some content in DEFAULT directory pcguru Bug Reports 1 01-15-2006 11:51 AM
default autoindex script djkoopman Bug Reports 2 05-09-2005 11:12 AM


All times are GMT -7. The time now is 07:38 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.