Using PHP-MySQL Persistent Connections to Run WordPress Blog PHP - باستخدام وصلات ماي. س. ك المستمرة لادارة ووردبرس] بلوق
When connecting to MySQL database, WordPress weblog based on PHP scripting will use non-persistent connection by default. عندما ربط لقاعدة البيانات ماي. س. ك ، ووردبرس] weblog على أساس 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. وهذا هو ، ووردبرس] سوف يؤدي PHP لتوليد جديدة الصدد الى خادم ماي. س. ك عن كل صفحة دينامية الطلب ، وبعد إغلاق قاعدة بيانات الصدد صفحة ويب بمجرد الانتهاء من بناء. Repetitive opening and closing of MySQL connections causes overheads and uses up precious CPU, memory and system resources on the web host. التكرار افتتاح واختتام ماي. س. ك صلات أسباب النفقات العامة والاستخدامات الثمينة وحدة المعالجة المركزية ، الذاكرة وموارد النظام على الشبكة المضيفة.
Using persistent connection to connect to MySQL database server is not always a good option. باستخدام الصدد إلى استمرار ربط لماي. س. ك خادم قاعدة البيانات ليست دائما خيارا جيدا. 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. حتى يأخذ كل وصلات الموارد ، بما في الذاكرة ، والمخزونات الاحتياطية ، الجدول أو الخيط مخابئ داخليا في ماي. س. ك ومقابس ، وفتح الملفات أو نشاط الإعلام والتوعية على مستوى نظام التشغيل. 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. 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. وعلاوة على ذلك ، إذا كان استمرار الصدد هو المتوقفة ، وأصبحت خاملة أو الميتة أو لم تعد تستخدم ، أنها لا تنتهي ، وماي. س. ك الخادم لن يؤدي إلا أنها قريبة إلى الإفراج عن الموارد التي تشغلها الصدد بعد حوالي 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. هذه بعض العوامل قد تتسبب فى مشكلات مثل رفض ماي. س. ك (كوبر) وصلات جديدة أو بطء الخادم إذا كانت الطلبات لا التعامل على نحو مناسب مع استمرار الصلات. Thus if you’re not experience webmasters, please do not attempt to change Wordpress to use persistent connections. وهكذا فانك اذا لم تكن تجربة مشرفي المواقع ، يرجى لا محاولة لتغيير وورد لاستخدام الاتصالات المستمرة.
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. ومع ذلك ، لمن المدونين الذين مزدحمة وكبيرة بلوق ، والقيود التي تواجه في رفع مستوى استضافة المواقع على الشبكة ، نظام المواصفات ، ولا يريدون استخدام البرنامج المساعد تخزين الصفحة في الذاكرة المخبئية ساكنة مثل الفسفور الابيض بين ذاكرة التخزين المؤقت ، واستمرار الصدد هو الخيار المتاح لقيمتها والأمثل لخدمة الويب لمعرفة ما اذا كانت صفحة ويب خدمة يمكن أسرع. 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. هذا وسوف غير مباشر ماي. س. ك الصدد الحد من النفقات العامة ذات الصلة الخادم مثل التوثيق لإنشاء الصدد حيث هناك حاجة مرة واحدة فقط ، لإنقاذ اضافية شبكة المرور ، واستخدام موارد اضافية للتعامل الصدد. 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. استمرار الصدد ميزة سيتطلب 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 (أو غير آمنة التلنت) ، وتغيير إلى دليل webroot المنزل حيث هو تركيب بلوق ووردبرس]. Then change directory into wp-includes directory. ثم تغير إلى دليل الفسفور الابيض بين ويشمل الدليل. Inside the wp-includes directory, there is wp-db.php file. داخل الفسفور الابيض بين ويشمل الدليل ، هناك ملف الفسفور الابيض - db.php. Use any text editor such as vi to edit wp-db.php. استخدام أي محرر نصوص مثل السادس لتحرير الفسفور الابيض - 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. Just change the mysql_connect to mysql_pconnect , then save and exit the wp-db.php. مجرد تغيير mysql_connect لmysql_pconnect ، ثم حفظ والخروج من الفسفور الابيض - 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.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 كيفية التحرك بلوق ووردبرس] إلى نطاق جديد أو موقع
- WordPress MySQL SQL Query Error in WPDB Class ووردبرس] ماي. س. ك مزود استفسار خطأ في الطبقة WPDB
- AdSense and Display Banner Ads Rotation in WordPress Blog or Websites AdSense وعرض شعار الاعلانات التناوب في المواقع أو بلوق ووردبرس]
- Moderate WordPress Blog Comments Via Moderator with Desktop Client معتدلة ووردبرس] بلوق التعليقات عن طريق وسيط مع سطح المكتب العملاء
- WLWManifest Disabler Plugin to Remove XLM Link in WordPress Blog Header WLWManifest Disabler البرنامج المساعد لازالة XLM صلة في رأس بلوق ووردبرس]
- Replace Google Blog Search with Technorati for Incoming Links in Dashboard of WordPress Google تحل محل بحث المدونات مع ستثمبليوبون القادمين من وصلات في لوحة التحكم الرئيسية ووردبرس]
- Integrate and Display Google AdSense for Search and Co-Op Custom Search Engine Results in WordPress Blog Page Template دمج وعرض جوجل AdSense للبحث والتعاوني نتائج محرك البحث المخصص في قالب الصفحة ووردبرس] بلوق
- Publish Blog with Windows Live Writer Offline Blog Editor Tool نشر بلوق مع ويندوز لايف الكاتب غير متصل بلوق أداة تحرير
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working ترقيم صفحات او سبليت ووردبرس] الصفحة بوست أو مع NextPage ليس العامل في ووردبرس]
- Limit Maximum TCP Connections to Web Servers الحد الأقصى لمشاريع التعاون التقني وصلات إلى خدمة ويب

































September 27th, 2007 22:14 سبتمبر 27th ، 2007 22:14
This seemed to do the trick for. هذا ما يفعله على ما يبدو فإن خدعة ل. Thanks so much for the info! شكرا جزيلا للمعلومة!