Using PHP-MySQL Persistent Connections to Run WordPress Blogを使用してphp - mysqlの持続的接続を実行してワードプレスにブログ

When connecting to MySQL database, WordPress weblog based on PHP scripting will use non-persistent connection by default. MySQLデータベースが、ワードプレスへの接続はPHPスクリプトではデフォルトで非永続的な接続を使用するベースのウェブログ。 That is, WordPress will trigger PHP to generate a new connection to MySQL server for each dynamic page request, and subsequently close the database connection once the web page building is completed.つまり、ワードプレスの各動的ページリクエストに対してサーバMySQLへの新しい接続を生成するために、 PHPをトリガし、その後、データベースとの接続後は、 Webページの構築が完了するとすぐ近くにあります。 Repetitive opening and closing of MySQL connections causes overheads and uses up precious CPU, memory and system resources on the web host.反復を開き、 MySQL接続の閉鎖を貴重なCPUのオーバーヘッドが発生すると、ウェブホスト上のメモリとシステムリソースを使用しています。

Using persistent connection to connect to MySQL database server is not always a good option.永続的な接続を使用してデータベースサーバーのMySQLに接続するためには、常に良いオプションではありません。 Each connections takes up resources, including memory, buffers, table or thread caches internally in MySQL and sockets, open files or IO activity at OS level.各接続、メモリ、バッファ、テーブルやスレッドMySQLとソケット、開いているファイルやキャッシュのIOで内部のOSレベルでの活動などのリソースをかかります。 Thus when a lot of persistent connections are opened but not closed after transactions are completed, the resources on system may drain up and degrade performance of web server, or in worst case, cause HTTP failure.このように永続的な接続がオープンされていないが、多くの取引終了後に完了すると、システム上のリソースを排水することがあります故障の原因とHTTP Webサーバー、または最悪の場合、パフォーマンスが低下する。 Furthermore, if a persistent connection is stalled, inactive or became defunct or no longer in used, it is not terminated, and MySQL server will only close it to release the resource occupied by the connection after about 28800 seconds (8 hours) by default unless changed the timeout parameters in my.cnf configuration files.さらに動けなくなっている場合、永続的な接続、または旧なったまたは使用されなくなり、強制終了されていない、とMySQLサーバーを非表示だけでは、リソースについては、デフォルトでは28800秒( 8時間)後には、接続によって占有リリースに閉鎖する場合を除きmy.cnf設定ファイル内のタイムアウトのパラメータを変更した。 This few factors may bring troubles such as MySQL refusing new DB connections or slow server if the applications do not properly handle persistent connections.このようないくつかの要因MySQLの場合は、アプリケーションが正常に永続的な接続を処理しない新しいDB接続または低速サーバー拒否として問題をもたらす可能性があります。 Thus if you’re not experience webmasters, please do not attempt to change Wordpress to use persistent connections.したがってウェブマスター経験していない場合は、永続的な接続を使用するようにWordpressの変更しようとしないでください。

However, for bloggers who have busy and large blog, and facing constraints in upgrading web host system specifications, and do not want to use static page caching plugin such as WP-Cache, persistent connection is a available option to tune and optimize the web server to see if the webpage serving can be faster.しかし、大規模なブログを持って忙しく、ブロガー、およびWebホストシステムの仕様をアップグレードの制約に直面し、静的ページWPを採用などのプラグインをキャッシュ-キャッシュ、永続的な接続に使用しない場合は、利用可能なオプションを調整すると、 Webサーバの最適化ですが表示される場合には、より高速なサービスを提供することができますウェブページ。 Persistent connection allows connection to be open once and will not be closed when the execution of the script ends.永続的な接続の接続を一度オープンすることができますが、スクリプトの実行を終了閉鎖されません。 Instead, the link is kept in pool and will remain open for future use.代わりに、リンクプールで、将来の使用のため開いたままになる保たれています。 Thus, using persistent connections will eliminate the process of opening and closing the connection.したがって、持続的接続を使用して開放のプロセスを排除し、接続を閉じる。 This will indirectly reduce MySQL connection related server overheads such as authentication to establish connection where only once is needed, saving extra network traffic, and resources used to handle extra connection.この間接的には一度だけが必要な接続を確立するために、余分なネットワークトラフィックを保存すると、認証などのMySQLの接続サーバー関連のオーバーヘッドを削減し、リソースを余分な接続を処理するために使用されます。 Beside, there could be some connection level caches, which need to be filled up for proper performance, and potentially reduce the number of connections to the database.横には、適切な性能をいっぱいにする必要があるいくつかの接続レベルのキャッシュは、潜在的には、データベースへの接続の数を減らすことができます。

By default, WordPress is using mysql_connect() function that establishes a new database connection on every page.デフォルトでは、ワードプレスは、すべてのページに新しいデータベース接続を確立mysql_connect ( )関数を使用している。 The persistent connection feature will require mysql_pconnect() function which uses the exact same API, but has built-in connection pooling to keep connections alive between requests.これはまったく同じAPIを使用してmysql_pconnect ( )関数が必要になるの永続的な接続機能が組み込まれて生きリクエスト間の接続で接続プールを維持する。 So to switch to use persistent connection to run WordPress, the mysql_connect() function has to be replaced with mysql_pconnect().だから、ワードプレスは、 ( )関数mysql_connectを実行する永続的な接続を使用するようにスイッチを交換する必要がありますmysql_pconnect ( ) 。

To enable and use persistent connections with WordPress, simply login to your web host with SSH (or insecure Telnet), and change to the webroot home directory where WordPress blog is installed.有効にするには、ワードプレスとの永続的な接続を使用すると、単純にSSH (または不安定なのTelnet )を使用してウェブのホストにログインし、 webroot 。将来のホームディレクトリにインストールされているワードプレスのブログに変更します。 Then change directory into wp-includes directory. WPを採用にディレクトリを変更し、 ディレクトリが含まれています Inside the wp-includes directory, there is wp-db.php file.内部には、 WPを採用、 WPを採用- db.phpファイルがディレクトリに含まれています Use any text editor such as vi to edit wp-db.php.任意のテキストエディタなどを編集するにはviの処置、さらに、 wp - db.phpを使用します。 Search or locate the function of mysql_connect (or @mysql_connect ).検索または(またはmysql_connect ) @ mysql_connect機能を見つけます There is only one instance of mysql_connect. mysql_connectのインスタンスは1つだけです。 Just change the mysql_connect to mysql_pconnect , then save and exit the wp-db.php. mysql_pconnectだけに、 保存して WPを採用しmysql_connect - db.php出口を変更してください。 WordPress and PHP (as long as you don’t turn off the mysql.allow_persistent in PHP.INI) will immediately use persistent connections to connect to MySQL database.ワードプレスとPHP (限り)がすぐに接続するためにデータベースのMySQLへの持続的接続を使用するmysql.allow_persistent php.iniでオフにすることはありません。 It’s worth to try out which setting is best for your environment.これはあなたの環境に最適な設定を試してみる価値はある。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これはマシンとして"保証なしにされている"提供されているページを翻訳しています。 Machine translation may be difficult to understand.機械翻訳を理解するのが難しい場合があります。 Please refer toを参照してください original English articleオリジナルの英語の記事 whenever possible.可能な場合。

Share and contribute or get technical support and help at共有して貢献するかを得る技術サポートと支援 My Digital Life Forums 私のデジタルライフフォーラム .



One Response to “Using PHP-MySQL Persistent Connections to Run WordPress Blog” 1つの応答への" PHPを使う- MySQLの永続的な接続を実行し、ワードプレスのブログに"

  1. Edwardエドワード
    September 27th, 2007 22:14 9月27日2007/07/14 22:14
    1

    This seemed to do the trick for.このためのトリックを行うように見えた。 Thanks so much for the info!情報をありがとう!

Leave a Replyは、返信のままに

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> これらのタグ :の<a href=""使用することができますtitle=""> <abbr title=""> <acronym title=""> <b>ダウンロード<blockquote cite=""> <cite>の<code> <デル日時= " " >の<em> <i> <q cite=""> <strike> <strong>

Subscribe without commentingチャンネル登録コメントなし


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article着信は、文書の検索利用規約

php mysql persistent connections phpのmysqlの持続的接続 - - mysql persistent connection mysqlの持続的接続 - - persistent connection mysql 永続的な接続のmysql - - php persistent mysql connection phpの持続的MySQL接続 - - php mysql persistent phpのmysqlの持続的 - - wordpress persistent mysql 持続的MySQLワードプレス - - mysql persistent connection php phpのmysqlの持続的接続 - - persistent connections mysql 持続的接続のmysql - - wordpress mysql persistent connection mysqlの持続的な接続ワードプレス - - mysql persistent connections mysqlの持続的接続 - - php.ini + mysql persistent connection php.iniの+ MySQLの永続的な接続 - - disable persistent connections mysql mysqlの持続的接続を無効に - - dynamic wordpress page using mysql table MySQLのテーブルを使用して動的なワードプレスページ - - mysql faster db access with persistent connection 永続的な接続でのMySQLのデータベースアクセスを高速化 - - mysql connect wordpress mysqlのワードプレスの接続 - - mysql persistent 持続的MySQL - - mysql persistent connections with php PHPにMySQLの持続的接続 - - Not closing the database connection properly, PHP 正しくは、データベース接続を閉じると、 PHP - - persistent connection to MySQL +php MySQLへの永続的な接続 + phpの - - php mysql persistent connections not working phpのmysqlの持続的接続が機能していない - - wordpress mysql connection mysqlの接続ワードプレス - - ) or mysql_connect( )またはmysql_connect ( - - how to open multiple connection in mysql + php どのようにMySQLの複数の接続をオープンします+ phpの - - integrate WordPress with MySQL ワードプレスMySQLとの統合 - - mysql_connect persistence connection mysql_connect永続接続 - - optimizing mysql_pconnect mysql_pconnectの最適化 - - persistence wordpress style switcher 永続ワードプレスのスタイルスイッチャ - - php open and close mysql persistent connections phpのmysqlの持続的接続をオープンして閉じる - - php close application how can i close connections phpの緊密なアプリケーションはどうすれば接続を閉じることができます。 - - php mysql persistent connection phpのmysqlの持続的接続 - - php mysql+srpski phpのmysqlの+ srpski - - persistent connection to OFF in mysqlでOFFに永続的な接続のmysql - - Code to connect PHP to Mysql when using blogging PHPのコードは、ブログを使用したMySQLへの接続に - - mysql php connection close auto phpのmysqlの自動接続を閉じる - - persistent database connections php mysql phpのmysqlの持続的データベース接続 - - php mysql database connection slow phpのmysqlデータベース接続が遅い - - wordpress mysql php persistent 持続的MySQL PHPのワードプレス - - disable mysql persistent connection mysqlの持続的接続を無効に - - how can we close mysql persistent connection in php どのようにPHPのMySQLの永続的な接続を閉じることができます。 - - wordpress mysql using too much cpu ワードプレスのCPU を使用してMySQLを過ぎる - - how to run mysql_connect php mysql_connect PHPを実行する方法 - - db connection php mysql phpのmysqlのDB接続 - - db connection php mysql persistent DB接続phpのmysqlの持続的 - - php mysql connectivity phpのmysqlの接続 - - wordpress connecting to mysql MySQLへの接続ワードプレス - - mysql.persistent mysql.persistent - - mysql car rental mysqlのレンタカー - - php.ini persistent connections php.iniの持続的接続 - - php how to don't close mysql connection どのようにphpのmysqlの接続を閉じていない - - php mysql table persistent phpのMySQLテーブルの永続的な - -