Using PHP-MySQL Persistent Connections to Run WordPress Blog Naudojant PHP-MySQL patvariųjų Jungtys Vykdyti WordPress blog

When connecting to MySQL database, WordPress weblog based on PHP scripting will use non-persistent connection by default. Jei prisijungti prie MySQL duomenų bazė, WordPress weblog remiantis PHP skriptų naudoja ne nuolatinis ryšys pagal nutylėjimą. 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. Tai reiškia, kad WordPress bus sukelti PHP sukurti naują ryšį su MySQL serverio kiekvienam dinaminio puslapio prašymą ir vėliau uždaryti duomenų bazę, kai tinklalapio kūrimo yra baigta. Repetitive opening and closing of MySQL connections causes overheads and uses up precious CPU, memory and system resources on the web host. Pasikartojančios atidarymo ir uždarymo MySQL jungčių sukelia viršutinės ir naudoja ne tauriųjų procesoriaus, atminties ir išteklių sistemos į žiniatinklio prieglobos.

Using persistent connection to connect to MySQL database server is not always a good option. Naudodamiesi nuolatinių ryšio prisijungti prie MySQL duomenų bazių serveris, ne visada yra geras pasirinkimas. 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. Kiekviena jungtis užima išteklių, įskaitant atminties buferio, stalo arba temoje talpyklos viduje MySQL ir kištukiniai lizdai, atidaryti failus, arba IO veiklos OS lygiu. 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. Taigi, kai daug patvarios jungtys yra atidarytas, bet ne uždaryti po sandoriai baigti, išteklių sistema gali nusausinti ir degraduoja atlikti žiniatinklio serveryje, arba blogiausiu atveju, sukelti HTTP nepakankamumas. 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. Be to, jei nuolatinis ryšys užstrigo, neaktyvūs arba tapo pasenusios arba nebeatitinka, jis nėra nutrauktas, ir MySQL serverio bus tik uždaryti išleisti išteklių okupuotų ryšį po maždaug 28800 sekundžių (8 valandas), nebent pakeitė laiko parametrus my.cnf konfigūracijos failus. 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. Šis keli veiksniai gali sukelti problemų, tokiomis kaip MySQL atsisakyti naujų BP jungčių arba lėtai serverio, jei paraiškos nėra tinkamai valdyti patvarūs ryšiai. Thus if you're not experience webmasters, please do not attempt to change Wordpress to use persistent connections. Taigi, jei nesate patirtį webmasters, prašome ne bandyti pakeisti WordPress naudotis nuolatiniai ryšiai.

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. Tačiau, Bloggers, kurie yra užimtas ir didelis dienoraštį, ir susiduria su apribojimais pagerinti žiniatinklio prieglobos sistemos specifikacijas ir nenorite naudoti statinį puslapį buforowanie įjungti pvz WP-niais, patvarūs ryšiu yra prieinama galimybė suderinti ir optimizuoti interneto serverio norėdami pamatyti, jei tinklalapio įteikimą galima greičiau. Persistent connection allows connection to be open once and will not be closed when the execution of the script ends. Patvarūs ryšys leidžia ryšį būtų galima atidaryti vieną kartą ir bus uždaryta, kai vykdant scenarijų baigiasi. Instead, the link is kept in pool and will remain open for future use. Vietoj to, nuoroda yra saugoma baseinas ir išliks atvira ateityje. Thus, using persistent connections will eliminate the process of opening and closing the connection. Taigi, naudojant patvarūs ryšiai bus pašalinti procesas atidaryti ir uždaryti ys. 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. Tai netiesiogiai sumažinti MySQL ryšio susiję serverio pridėtinių išlaidų, tokių kaip autentiškumo nustatyti ryšį, kai tik reikia, sutaupant papildomą srautą, ir ištekliai, naudojami dirbti su papildomų ryšį. 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. Šalia, gali būti kai kurių ryšys lygio talpyklos, kurias reikia užpildyti ir tinkamai atlikti, ir potencialiai sumažinti skambučių į duomenų bazę.

By default, WordPress is using mysql_connect() function that establishes a new database connection on every page. Pagal nutylėjimą, WordPress naudoja mysql_connect () funkciją, kuri sukuria naują duomenų bazę apie kiekvieną puslapį. 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. Nuolatinis ryšio funkcija reikalauja mysql_pconnect () funkciją, kurie naudoja tą patį API, tačiau turi įmontuotą ryšio kaupti išlaikyti ryšius gyvas tarp prašymus. So to switch to use persistent connection to run WordPress, the mysql_connect() function has to be replaced with mysql_pconnect(). Taigi pereiti naudotis nuolatinių ryšio paleisti WordPress, kad mysql_connect () funkciją, turi būti pakeistos 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. Norìdami çjungti ir naudoti nuolatinių ryšių su WordPress, tiesiog prisijungti prie savo žiniatinklio prieglobos su SSH (ar nesaugių TELNET), ir pakeisti į webroot namų katalogą, kur WordPress dienoraštis įdiegta. Then change directory into wp-includes directory. Tada pakeisti katalogo į wp-includes kataloge. Inside the wp-includes directory, there is wp-db.php file. Viduje wp-includes kataloge yra wp-db.php failą. Use any text editor such as vi to edit wp-db.php. Naudoti bet tekstų redaktorių, tokį kaip vi redaguoti wp-db.php. Search or locate the function of mysql_connect (or @mysql_connect ). Ieškoti arba suraskite funkcija mysql_connect (arba @ mysql_connect). There is only one instance of mysql_connect. Yra tik vienas egzempliorius mysql_connect. Just change the mysql_connect to mysql_pconnect , then save and exit the wp-db.php. Tiesiog pakeisti mysql_connect į mysql_pconnect, tada išsaugokite ir išeikite iš 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 ir PHP (kol nereikia išjungti mysql.allow_persistent į php.ini) bus iš karto naudoti patvarios jungtys, norint prisijungti prie MySQL duomenų bazė. It's worth to try out which setting is best for your environment. Tai verta pabandyti, kuris parametras yra geriausias jūsų aplinką.

IMPORTANT : The page is machine translated and provided "as is" without warranty. DĖMESIO: Šis puslapis yra mašina išvertė ir pateikiama "kaip yra" be garantijų. Machine translation may be difficult to understand. Mašininio vertimo, gali būti sunku suprasti. Please refer to Remkitės original English article originalas anglų straipsnis whenever possible. jei įmanoma.


2 Responses to “Using PHP-MySQL Persistent Connections to Run WordPress Blog” 2 Responses to "Naudojant PHP-MySQL patvariųjų Jungtys Vykdyti WordPress blog"

  1. raja Raja
    November 22nd, 2008 10:20 Lapkritis 22, 2008 10:20
    2 2

    THANK YOU SO MUCH! Thank you so much!
    WordPress is running so much faster now! WordPress veikia daug greičiau dabar!

    I am running all on Windows Server 2008 with: Aš einu visos Windows Server 2008:
    - MySQL Server v5.0 x64 (on dedicated server) - MySQL Server V5.0 x64 (on this server)
    - IIS7 with FastCGI z32 (on dedicated server) - IIS7 su FastCGI z32 (on this server)

    Regards, Linkėjimai,
    raja Raja

  2. Edward Edward
    September 27th, 2007 22:14 Rugsėjis 27, 2007 22:14
    1 1

    This seemed to do the trick for. Tai, atrodo, tai pavyko dėl. Thanks so much for the info! Thanks so much for the info!

Leave a Reply 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> Galite naudoti šias žymeles: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Subscribe to comments funkcija buvo išjungta. To receive notification of latest comments posted, subscribe to Norėdami gauti pranešimus apie naujausius komentarų, užsiprenumeruoti My Digital Life Comments RSS feed Mano skaitmeninis gyvenimas Komentarų RSS or arba register to receive registruotis, norint gauti new comments in daily email digest. Nauji komentarai kasdien elektroniniu paštu.
Custom Search

New Articles Nauji straipsniai

Incoming Search Terms for the Article Incoming Paieška Sąlygos straipsnį

mysql persistent connection mysql patvarieji ryšys - -- php mysql persistent connection php mysql patvarieji ryšys - -- php mysql wordpress php mysql wordpress - -- MySQL persistent connections MySQL patvarūs ryšiai - -- php mysql persistent connections php mysql patvarūs ryšiai - -- php mysql persistent php mysql patvariųjų - -- wordpress mysql connection WordPress mysql ryšys - -- persistent connection mysql nuolatinis ryšys mysql - -- mysql_pconnect wordpress mysql_pconnect wordpress - -- persistent connections mysql patvarios jungtys mysql - -- php persistent connections Php patvarūs ryšiai - -- wordpress persistent connection WordPress patvarieji ryšys - -- wordpress persistent connections WordPress patvarūs ryšiai - -- wordpress mysql timeout WordPress mysql timeout - -- persistent mysql patvarieji mysql - -- php persistent mysql connection Php patvarieji mysql ryšys - -- php persistent connection Php patvarieji ryšys - -- mysql php persistent connection MySQL PHP patvarieji ryšys - -- mysql connections mysql jungtys - -- persistent connection mysql php nuolatinis ryšys MySQL PHP - -- mysql allow persistent mysql leisti nuolatinių - -- mysql persistent mysql patvariųjų - -- mysql persistent connection performance mysql nuolatinių ryšio efektyvumą - -- Wordpress connection to MySQL WordPress prisijungti prie MySQL - -- WORDPRESS PHP MYSQL WordPress PHP, MySQL - -- persistent connection php nuolatinis ryšys Php - -- php mysql persistant connection php mysql patvarieji ryšys - -- mysql php persistent connections MySQL PHP patvarūs ryšiai - -- php mysql keep connection alive php mysql Utrzymuj derinys - -- mysql persistent connect mysql patvarieji prisijungti - -- wordpress persistent mysql WordPress patvarieji mysql - -- wordpress mysql conn WordPress mysql Conn - -- mysql persistent links mysql patvarieji nuorodos - -- steps to connect on mysql through wordpress žingsnių sujungti į mysql naudojant WordPress - -- wordpress mysql connection sleep WordPress mysql ryšio miego - -- Reduce or eliminate persistent connections to reduce connection usage Sumažinti ar pašalinti patvariųjų jungtys sumažinti ryšio naudojimas - -- persistent connections patvarios jungtys - -- wordpress mysql persistent connection WordPress mysql patvarieji ryšys - -- wordpress mysql persistent connections WordPress mysql patvarūs ryšiai - -- persistent connection nuolatinis ryšys - -- wordpress mysql_connect WordPress mysql_connect - -- wp mysql_connect wp mysql_connect - -- max connection mysql wordpress maks ryšio mysql wordpress - -- wordpress mysql.allow_persistent WordPress mysql.allow_persistent - -- wordpress mysql connections WordPress mysql jungtys - -- mysql persistent connections php mysql patvarūs ryšiai Php - -- wordpress mysql pool WordPress mysql baseinas - -- php "mysql auth" changement de login Php "mysql auth" changement de prisijungti - -- wordpress close connections WordPress glaudžius ryšius - -- mysql persistent connection timeout mysql patvarieji Connection timeout - --