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. जब भी संभव है.


3 Responses to “Using PHP-MySQL Persistent Connections to Run WordPress Blog” 3 उत्तर भागो WordPress ब्लॉग के लिए "का प्रयोग PHP-MySQL लगातार सम्पर्क में"

  1. Out बाहर
    September 23rd, 2009 14:37 23 सितम्बर 2009 14:37
    3 3

    Thanks a lot.I really do not know about the function mysql_pconnect().Will going to implement it practically soon. धन्यवाद lot.I सच में नहीं पता समारोह mysql_pconnect () करेंगे. इसे लागू करने के बारे में व्यावहारिक रूप से ही जा रही है.

  2. raja राजा
    November 22nd, 2008 10:20 22 नवम्बर 2008 10:20
    2 2

    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 राजा

  3. Edward एडवर्ड
    September 27th, 2007 22:14 27 सितम्बर 2007 22:14
    1 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 कर सकते हैं <blockquote title=""> <b> cite=""> <cite> <code> <डेल DateTime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. टिप्पणी की सुविधा है विकलांग गया है की सदस्यता लें. To receive notification of latest comments posted, subscribe to सदस्यता के लिए नई टिप्पणियों की सूचना प्राप्त पोस्ट किया है, My Digital Life Comments RSS feed मेरे डिजिटल जीवन टिप्पणियाँ आरएसएस फ़ीड or या register to receive रजिस्टर प्राप्त करने के लिए new comments in daily email digest. दैनिक ईमेल में नई टिप्पणियाँ डाइजेस्ट.
Custom Search

New Articles नए लेख

Incoming Search Terms for the Article के लिए खोजें शर्तें आने अनुच्छेद

mysql persistent connection mysql लगातार संपर्क - -- MySQL persistent connections MySQL लगातार कनेक्शन - -- wordpress persistent connections लगातार कनेक्शन WordPress - -- php mysql persistent connection php mysql लगातार संपर्क - -- php mysql wordpress php mysql WordPress - -- wordpress mysql connection mysql कनेक्शन WordPress - -- wordpress persistent connection लगातार कनेक्शन WordPress - -- php persistent connections php लगातार कनेक्शन - -- mysql persistent mysql निरंतर - -- php mysql persistent connections php mysql लगातार कनेक्शन - -- php mysql persistent php mysql निरंतर - -- persistent connection mysql लगातार कनेक्शन mysql - -- WORDPRESS PHP MYSQL WordPress PHP MYSQL - -- persistent connections mysql लगातार कनेक्शन mysql - -- Reduce or eliminate persistent connections to reduce connection usage कम या खत्म करने के लगातार कनेक्शन कनेक्शन उपयोग को कम करने के लिए - -- wordpress mysql_connect WordPress mysql_connect - -- wordpress mysql timeout mysql आउटः WordPress - -- mysql_pconnect wordpress mysql_pconnect WordPress - -- php persistent connection php लगातार संपर्क - -- mysql persistent links mysql लगातार संपर्क - -- wordpress mysql_pconnect WordPress mysql_pconnect - -- wordpress mysql persistent connection mysql लगातार संपर्क WordPress - -- persistent connection लगातार कनेक्शन - -- mysql connections mysql कनेक्शन - -- wordpress mysql connect mysql WordPress कनेक्ट - -- persistent connections wordpress लगातार कनेक्शन WordPress - -- mysql persistent connection performance mysql लगातार संपर्क प्रदर्शन - -- persistent mysql लगातार mysql - -- php persistent mysql connection php mysql लगातार संपर्क - -- mysql php persistent connection mysql php लगातार संपर्क - -- wordpress mysql persistent connections mysql लगातार कनेक्शन WordPress - -- persistent connection mysql php लगातार कनेक्शन mysql php? - -- wordpress connection pool WordPress कनेक्शन पूल - -- wordpress db connection WordPress DB कनेक्शन - -- mysql_connect wordpress mysql_connect WordPress - -- wordpress connection pooling WordPress pooling कनेक्शन - -- php persistent mysql लगातार php mysql - -- mysql allow persistent mysql लगातार अनुमति - -- persistent connection php लगातार कनेक्शन php? - -- persistent mysql connection लगातार mysql कनेक्शन - -- wordpress persistent mysql लगातार mysql WordPress - -- mysql persistent connection php mysql लगातार संपर्क php? - -- mysql connect persistent mysql लगातार कनेक्ट - -- wordpress database connection pool WordPress डेटाबेस कनेक्शन पूल - -- connection mysql php कनेक्शन mysql php? - -- php mysql connection pooling php mysql pooling कनेक्शन - -- wordpress persistent db लगातार DB WordPress - -- Wordpress connection to MySQL WordPress MySQL के लिए कनेक्शन - -- mysql.allow_persistent wordpress mysql.allow_persistent WordPress - -- php mysql persistant connection php mysql लगातार संपर्क - --