[Phplib-commit] CVS: php-lib-stable/doc/sgml 03-db_sql.sgml,1.2,1.3
Brought to you by:
nhruby,
richardarcher
From: Layne W. <lay...@us...> - 2002-03-14 20:36:48
|
Update of /cvsroot/phplib/php-lib-stable/doc/sgml In directory usw-pr-cvs1:/tmp/cvs-serv13054/doc/sgml Modified Files: 03-db_sql.sgml Log Message: Modified lock() to allow list of table names. Modified lock() and unlock() to remove unnecessary variable for testing query. Added instance variable 'PConnect' to toggle between persistent and non-persistent database connections. Updated documentation to reflect above changes. Index: 03-db_sql.sgml =================================================================== RCS file: /cvsroot/phplib/php-lib-stable/doc/sgml/03-db_sql.sgml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 03-db_sql.sgml 13 Aug 2001 12:30:06 -0000 1.2 --- 03-db_sql.sgml 14 Mar 2002 20:36:43 -0000 1.3 *************** *** 160,163 **** --- 160,173 ---- environments. + <tag>lock($table, $mode = "write")</tag> + <p> + In some DB interfaces locks one or more tables using the mode(s) + specified. <tt/$table/ can be a single table, a comma separated + list of tables, or an array of mode/table (or table list) pairs. + + <tag>unlock()</tag> + <p> + In some DB interfaces releases all table locks. + <tag>link_id()</tag> <p> *************** *** 301,322 **** all PHPLIB tables as part of your application. ! Some databases (for example Oracle) have very expensive ! connect() operations. For these databases, performance is ! dramatically improved if you switch from CGI PHP to mod_php. ! This is, because PHPLIB uses the "*_pconnect()" method to ! connect to your database. In mod_php, the database connection is ! kept around by the web server process after the page has been ! processed and is reused if a further connect requires a ! connection with the same Host/Username/Password pattern. This means that there will be at most "number of web server processes" times "number of Host/Username/Password-combinations" ! many simultaneous connections to your database server. Keep that ! in mind when planning licenses and server load. Using CGI PHP ! will probably reduce the number of concurrent connects to your ! database server at the expense of connection setup time. For ! database servers where connection setup time is negligible ! (MySQL for example) this is a viable solution (don't try it with ! Oracle) though. <sect2>Using <tt/nextid()/ --- 311,347 ---- all PHPLIB tables as part of your application. ! Some databases (for example Oracle) have very expensive connect() ! operations. For these databases, performance is dramatically improved ! if you switch from CGI PHP to mod_php. This is because, for ! these database, PHPLIB uses the persistent connection methods (e.g. ! *plogon() or *_pconnect()) to connect to your database. In ! mod_php, the database connection is kept around by the web ! server process after the page has been processed and is reused if a ! further connect requires a connection with the same ! Host/Username/Password pattern. This means that there will be at most "number of web server processes" times "number of Host/Username/Password-combinations" ! many simultaneous connections to your database server. Keep that in ! mind when planning licenses and server load. Using CGI PHP and/or ! non-persistent connections will probably reduce the number of ! concurrent connects to your database server at the expense of ! connection setup time. For database servers where connection setup ! time is negligible (MySQL for example) this is the default solution; ! just don't try it with Oracle. ! ! <em/Note:/ PHPLib now uses (as of 7.4) non-persistent connections by ! default in the non-Oracle db interfaces. The majority of PHPLib users ! are operating in a virtual hosting environment where persistent ! connections eat up memory at a horrifying rate. For web servers that ! only connect to one Host/Username/Password, the persistent connections ! can be enabled by setting the <tt/$PConnect/ variable in local.inc's ! database extension class. ! ! <em/Note:/ When using persistent connections with MySQL, the ! <tt/wait_timeout/ value should be lowered in the MySQL server ! (safe_mysqld). A recommended value of 120 and 180 seconds is ! much better suited to use with PHP than MySQL's default value of ! 28800 seconds (8 hours). <sect2>Using <tt/nextid()/ |