Using PHP-MySQL Persistent Connections to Run WordPress Blog का उपयोग कर PHP-MySQL लगातार सम्पर्क भागो WordPress के लिए ब्लॉग
When connecting to MySQL database, WordPress weblog based on PHP scripting will use non-persistent connection by default. जब MySQL डाटाबेस, WordPress को जोड़ने 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. कि है, WordPress PHP ट्रिगर करने के लिए एक नए कनेक्शन के लिए एक गतिशील पृष्ठ अनुरोध के लिए सर्वर MySQL उत्पन्न होगा, बाद में और डेटाबेस कनेक्शन एक बार वेब पेज का निर्माण पूरा हो गया है बंद करो. 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. प्रत्येक कनेक्शन को संसाधनों लेता है, स्मृति, buffers, टेबल या धागे ओएस स्तर पर गतिविधि MySQL और कुर्सियां, खुली फ़ाइलों या कब में आंतरिक caches भी शामिल है. 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. इसके अलावा, यदि एक निरंतर कनेक्शन ठप है, या निष्क्रिय बन गया मृत या इस्तेमाल किया, यह समाप्त नहीं है अब नहीं, और MySQL सर्वर ही बंद हो जाएगा के बारे में यह 28,800 सेकंड (डिफ़ॉल्ट रूप से 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. हालांकि, ब्लॉगर्स जो व्यस्त और बड़े ब्लॉग के लिए है, और वेब होस्ट प्रणाली के विनिर्देशों के उन्नयन में कमी का सामना कर रहे हैं और स्थिर ऐसी WP प्लगइन के रूप में पृष्ठ कैशिंग-cache, लगातार कनेक्शन का उपयोग नहीं करना चाहते एक उपलब्ध धुन और वेब सर्वर अनुकूलन विकल्प है को देखने के लिए कि तेजी से हो सकता है की सेवा वेबपेज. 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. बगल में, वहाँ कोई कनेक्शन स्तर caches, जो तक उचित प्रदर्शन के लिए भर की जरूरत है और संभवतः डेटाबेस के लिए कनेक्शन की संख्या में कमी हो सकती है.
By default, WordPress is using mysql_connect() function that establishes a new database connection on every page. By default, WordPress 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 समारोह () जो उसी एपीआई का उपयोग करता है की आवश्यकता होगी, लेकिन निर्माण के संबंध में कनेक्शन अनुरोधों के बीच जीवित रखने के pooling. So to switch to use persistent connection to run WordPress, the mysql_connect() function has to be replaced with mysql_pconnect(). इतना लगातार कनेक्शन का उपयोग करने WordPress, समारोह () 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. करने में सक्षम है और WordPress के साथ लगातार कनेक्शन का उपयोग करें, बस ssh (या असुरक्षित Telnet) के साथ अपने वेब होस्ट में प्रवेश, और webroot घर कहाँ WordPress ब्लॉग स्थापित है निर्देशिका को बदलना. 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 का केवल एक उदाहरण है. Just change the mysql_connect to mysql_pconnect , then save and exit the wp-db.php. बस mysql_connect को mysql_pconnect, तो सहेजें और बाहर निकलें WP-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. WordPress और PHP (जब तक तुम दूर PHP.INI में mysql.allow_persistent बारी नहीं है) को तुरंत लगातार कनेक्शन का उपयोग करेगा से कनेक्ट करने के लिए MySQL डाटाबेस. It's worth to try out which setting is best for your environment. यह करने की कोशिश है जो बाहर की स्थापना अपने पर्यावरण के लिए सबसे अच्छा है लायक है.
IMPORTANT : The page is machine translated and provided "as is" without warranty. महत्वपूर्ण: पृष्ठ की मशीन है और अनुवाद प्रदान "के रूप में वारंटी के बिना है." Machine translation may be difficult to understand. मशीन अनुवाद मुश्किल से समझ सकते हो. Please refer to कृपया उल्लेख करने original English article मूल अंग्रेजी लेख whenever possible. जब भी संभव है.
Related Articles संबंधित लेख
- How to Move WordPress Blog to New Domain or Location कैसे नई डोमेन या स्थान के लिए WordPress ब्लॉग के लिए जाओ
- WordPress MySQL SQL Query Error in WPDB Class WordPress MySQL SQL क्वेरी WPDB में त्रुटि कक्षा
- Moderate WordPress Blog Comments Via Moderator with Desktop Client उदारवादी WordPress ब्लॉग टिप्पणियाँ Via डेस्कटॉप क्लाइंट के साथ मॉडरेटर
- How to Customize, Modify or Change WordPress Database Connection Error Page अनुकूलित करें, संशोधित करें या बदलें WordPress डाटाबेस कनेक्शन त्रुटि पेज में कैसे
- Replace Google Blog Search with Technorati for Incoming Links in Dashboard of WordPress बदलें Google ब्लॉग आने वाली लिंक के लिए WordPress के डैशबोर्ड में Technorati के साथ खोज
- WLWManifest Disabler Plugin to Remove XLM Link in WordPress Blog Header WLWManifest Disabler निकालें प्लगइन WordPress ब्लॉग शीर्षक में XLM कड़ी
- AdSense and Display Banner Ads Rotation in WordPress Blog or Websites ऐडसेंस और प्रदर्शन WordPress ब्लॉग या वेबसाइट में बैनर विज्ञापन परिक्रमण
- Integrate and Display Google AdSense for Search and Co-Op Custom Search Engine Results in WordPress Blog Page Template एकीकृत और प्रदर्शन खोजें और सह के लिए गूगल ऐडसेंस-Op कस्टम खोज WordPress ब्लॉग पृष्ठ में इंजन परिणाम टेम्पलेट
- Change and Reset MySQL root Password परिवर्तन और रीसेट MySQL रूट पासवर्ड
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working Paginating या भाजित WordPress पोस्ट या पृष्ठ NextPage के साथ WordPress में काम नहीं कर










































September 23rd, 2009 14:37 23 सितम्बर 2009 14:37
Thanks a lot.I really do not know about the function mysql_pconnect().Will going to implement it practically soon. धन्यवाद lot.I सच में नहीं पता समारोह mysql_pconnect () करेंगे. इसे लागू करने के बारे में व्यावहारिक रूप से ही जा रही है.
November 22nd, 2008 10:20 22 नवम्बर 2008 10:20
THANK YOU SO MUCH! शुक्र है कि तुम इतना!
WordPress is running so much faster now! WordPress इतनी तेजी से चल रहा है अब!
I am running all on Windows Server 2008 with: मैं Windows Server 2008 पर सब के साथ भाग रहा हूँ:
- MySQL Server v5.0 x64 (on dedicated server) - MySQL सर्वर v5.0 x64 (समर्पित सर्वर पर)
- IIS7 with FastCGI z32 (on dedicated server) - Z32 FastCGI के साथ IIS7 (समर्पित सर्वर पर)
Regards, सादर,
raja राजा
September 27th, 2007 22:14 27 सितम्बर 2007 22:14
This seemed to do the trick for. इस के लिए चाल नहीं लग रहा था. Thanks so much for the info! इतनी जानकारी के लिए धन्यवाद!