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 私のデジタルライフフォーラム . 。
Related Articles関連記事
- How to Move WordPress Blog to New Domain or Locationどのように新しいドメインまたは場所にワードプレスのブログを移動する
- StatTraq - Wordpress Plugin for Site Statistic and Traffic Counter StatTraq -ワードプレスプラグインサイトの統計情報とトラフィックのカウンタを
- How to Customize, Modify or Change WordPress Database Connection Error Pageをカスタマイズする方法、変更または変更WordPressのデータベースの接続エラーページに
- How to Delete Existing WordPress Post Revisions Stored/Saved既存のリビジョンを格納する方法ワードプレスの投稿を削除する/保存
- Integrate WordPress including Comments with bbPress Forum using bbSyncワードプレスbbPressフォーラムとのコメントを使用して統合を含むbbSync
- How to Reset WordPress Password to Recover Forgotten Secretワードプレスのパスワードをリセットする方法をお忘れに回復の秘密
- Reduce Server Load Using Akismet to Automatically Discard Spam Comments on Posts Older than A Monthサーバーの負荷を減らすのスパムのコメントを自動的に破棄アキスメットを使用して、月よりも古い投稿
- WordPress MySQL SQL Query Error in WPDB ClassワードプレスのMySQLのSQLクエリのエラーWPDBのクラス
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working Paginatingまたはスプリットワードプレスの投稿やページにNextPageが、ワードプレスが機能しない
- How to Change the Frequency or Interval WordPress Auto Saves An Editing Post or Pageどのように周波数または間隔ワードプレスオートセーブを編集ポストまたはページを変更するには

































September 27th, 2007 22:14 9月27日2007/07/14 22:14
This seemed to do the trick for.このためのトリックを行うように見えた。 Thanks so much for the info!情報をありがとう!