How To Improve Performance of Highly Commented WordPress Blogs Come migliorare le prestazioni di grandi commentato i blogs di WordPress
Most of highly trafficked and highly commented wordpress blogs rely upon some smart caching solution or another. La maggior parte di altamente trafficate e molto commentato WordPress Blogs contare su qualche soluzione intelligente di caching o di un altro. However it may not be enough to prevent slowing down your server if your post(s) are heavily commented upon. Tuttavia può non essere sufficiente a prevenire rallentare il server, se il tuo post (s) sono fortemente commentati. This is because smart caching solutions re-create the cache whenever a new comment is posted. Questo perché il caching delle soluzioni intelligenti ricreare la cache ogni volta che un nuovo commento è distaccato. Here is a simple solution in three steps. Qui è una soluzione semplice in tre fasi.
Steps: Procedura:
- Install (and activate) Installare (e attivare) Wp-Cache 2 Wp-Cache 2 plugin. I have excellent experience with it for over a year. Ho eccellente esperienza con esso per più di un anno.
- Modify wp-cache-phase2.php (one of the plugin files) to comment / delete the line: Modificare wp-cache-phase2.php (uno dei plug file) per commentare / eliminare la riga:
add_action('comment_post', 'wp_cache_get_postid_from_comment', 0);add_action ( 'comment_post', 'wp_cache_get_postid_from_comment', 0); - Set the cache expiration time to 2 hours or more. Impostare la data di scadenza della cache a 2 ore o più. This can easily handle a slashdot effect without breaking a sweat. Questo può facilmente gestire un effetto slashdot senza rompere uno sudore.
The change in step 2 ensures that the pages are not regenerated everytime a new comment is posted. La variazione del passo 2 garantisce che le pagine non sono sempre rigenerata un nuovo commento è distaccato. They are however regenerated after the expiration of cache. Essi sono tuttavia rigenerata dopo la scadenza del termine di cache. This time lag saves an enormous amount of sql query when a post is heavily commented. Questo lasso di tempo di risparmiare una quantità enorme di query SQL quando un post è fortemente commentati.
Filed under Elencato sotto CMS Software CMS Software , Headline News Headline News , How To Come , PHP , Pro Blogging Pro Blogging , Tech Note Nota tech , Web , Web Services Servizi Web , WordPress | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |





April 27th, 2006 at 10:49 am 27 aprile 2006 alle 10:49
People like instant gratification. Persone come gratificazione istantanea. If somebody makes a comment on a website, they expect it to show up immediately. Se qualcuno fa un commento su un sito web, essi si aspettano che mostrano immediatamente. Otherwise, the commentor will be discouraged from posting a comment in the future. In caso contrario, l'commentor saranno scoraggiati dal inviare un commento in futuro.
Because of this, I think that another solution is needed. A causa di questo, credo che un'altra soluzione è necessaria.
April 27th, 2006 at 12:51 pm 27 aprile 2006 alle 12:51 pm
When the choice is between providing instant gratification versus making the site available, isn’t the solution clear? Quando la scelta è tra la gratificazione immediata rispetto a rendere disponibile il sito, non è la soluzione chiaro?
I don’t think expecting comments to appear immediately is something which users have come to expect as many sites today have manual or semi-manual moderation policy. Non credo che in attesa di commenti a comparire immediatamente è qualcosa che gli utenti si aspettano molti siti come oggi hanno manuale o semi-politica di moderazione manuale. A clear statement explaining the situation should address the expectations. Una chiara dichiarazione per spiegare la situazione dovrebbe affrontare le aspettative.
April 27th, 2006 at 10:53 pm 27 aprile 2006 alle 10:53 pm
Have you implemented this on a public site that I can see it in action on? Avete realizzato questo su un sito pubblico che posso vederlo in azione? I noticed when I posted that you don’t use it on this one. Ho notato che quando ho postato che non lo utilizzi a questo. I am really curious about the type of site you feel this would be helpful on. Sono davvero curioso circa il tipo di sito si sente questo sarebbe utile.
My feeling is that the number of comments on a weblog is going to be very low. La mia sensazione è che il numero di commenti su un blog sta per essere molto basso. But, even if somehow the volume of comments becomes a problem, wouldn’ta better solution be to move the comments onto a seperate page? Ma, anche se in qualche modo il volume dei commenti diventa un problema, wouldn'ta essere migliore soluzione per spostare i commenti su una pagina separata? This would get rid of most of the read-only load as well as the read-write load due to comments because you are only sending that page to the small fraction of people that care about the comments in the first place. Ciò sbarazzarsi della maggior parte delle read-only di carico e la lettura-scrittura di carico a causa di commenti perché siete solo l'invio di questa pagina per la piccola frazione di persone che si occupano di osservazioni in primo luogo.
Anyway, I just think that there are so many other possibilities to improve performance before taking a step that has such a negative impact on the user experience. In ogni modo, mi basta pensare che ci sono tante altre possibilità per migliorare le prestazioni prima di prendere un passo che ha un tale impatto negativo per l'esperienza utente.
April 28th, 2006 at 12:17 pm 28 aprile 2006 alle 12:17 pm
> My feeling is that the number of comments on a weblog is going to be very low. > La mia sensazione è che il numero di commenti su un weblog sarà molto basso.
Again this is not a solution for oridinary situations. Ancora una volta non si tratta di una soluzione per oridinary situazioni. There are certain popular blogs which elicit lots of comments, especially more when you break a story / get slashdotted etc. usmagazine is one such site. Ci sono alcuni blog popolare che suscitare un sacco di commenti, più in particolare quando si interrompe un racconto / Get slashdotted ecc usmagazine è uno di questi sito.
I used this technique for a limited time on this blog with good results. Ho usato questa tecnica per un periodo di tempo limitato su questo blog con buoni risultati.
> But, even if somehow the volume of comments becomes a problem, wouldn’ta better solution be to move the comments onto a seperate page? > Ma, anche se in qualche modo il volume dei commenti diventa un problema, wouldnâ € ™ di essere soluzione migliore per spostare i commenti su una pagina separata?
How are you going to do that within WordPress framework? Come intende farlo entro WordPress quadro?
> Anyway, I just think that there are so many other possibilities to improve performance > In ogni modo, mi basta pensare che ci sono tante altre possibilità per migliorare le prestazioni
Please let me know how you plan to optimize performance of a heavily commented site without slowing down page re-generation after comments? Fatemelo sapere come si prevede di ottimizzare le prestazioni di un sito fortemente commentati senza rallentare pagina ri-generazione dopo commenti?
April 28th, 2006 at 2:36 pm 28 aprile 2006 alle 2:36 pm
Sorry to be a little dense, but does this hack actually make the comments not appear on individual post pages until the cache expires? Siamo spiacenti di essere un po 'denso, ma questo hack effettivamente fare i commenti non vengono visualizzati su singole pagine di post fino a quando scade la cache? Or do the number of comments indicated on the main page simply not update to match the actual number of comments visible on individual comment pages? O il numero di commenti indicato nella pagina principale semplicemente non aggiornamento per corrispondere al numero effettivo di commenti visibili commento sulle singole pagine?
jf JF
April 28th, 2006 at 9:23 pm 28 aprile 2006 alle 9:23 pm
The new comments are published as soon as the cache expires. Il nuovo osservazioni siano pubblicate non appena la cache di scadenza. So if your cache is set to 30 minutes then you get to see the new comments every 30 minutes instead of instantly. Quindi, se la cache è impostata a 30 minuti, quindi si inizia a vedere i nuovi commenti ogni 30 minuti anziché immediatamente.
Probably this is what was not clear to Brian as I am still trying to understand why he thinks it would be such a bad thing. Probabilmente questo è ciò che non è stato chiaro a Brian come sto ancora cercando di capire il motivo per cui egli ritiene che sarebbe una tale cosa negativa.
April 29th, 2006 at 7:27 am 29 aprile 2006 alle 7:27 am
It’s not a terrible thing, but it’s not right for every site. Non è una cosa terribile, ma non è giusto per ogni sito. For sites where the community and discussion aspect is an important part of why people visit, changing the situation from comments-appear-instantly to comments-appear-after-a-pause can turn people off and eliminate one of the reasons that they came and visited in the first place. Per i siti in cui la Comunità e la discussione aspetto è una parte importante di persone visitano il motivo per cui, cambiando la situazione da commenti-appaiono istantaneamente-a-commenti appaiono dopo-a un pausa possono trasformare le persone e eliminare uno dei motivi che sono venuti e visitato in primo luogo.
Of course, having a pause before comments appear is better than having a site that doesn’t work. Naturalmente, con una pausa prima di apparire commenti è meglio che avere un sito che non funziona. But not everybody who is looking to improve WP’s performance is at a place where their site is crashing constantly. Ma non tutti che sta cercando di migliorare il rendimento del WP è a un luogo in cui il loro sito si blocca costantemente. My site for instance is still chugging along fine performance-wise, but I’ve been warned by my Web host that it’s starting to take up more server resources than they’re comfortable with, so I’m looking at ways to improve performance. Il mio sito, ad esempio, è ancora chugging lungo fine-saggio prestazioni, ma sono stato avvertito dal mio web host che è di iniziare a prendere le risorse del server di più di quello che sta bene con, per cui sto cercando il modo di migliorare prestazione. Still, because my site visitors enjoy using the comments section to talk to one another more or less in real time — and because, I suspect, a long pause after commenting would result in fewer visits on their part (and thus less revenue to me) I wouldn’t implement a technique like yours except as a last resort (ie if my Web host got fed up and was threatening to shut me down). Ancora, perché il mio sito piace ai visitatori la sezione commenti di parlare l'uno con l'altro più o meno in tempo reale - e perché, temo, una lunga pausa dopo commentando si tradurrebbe in un minor numero di visite da parte loro (e quindi meno entrate a me) Io non attuare una tecnica come la vostra, tranne in ultima istanza (vale a dire se il mio Web ospitante ha alimentato in su ed è stata la minaccia di chiudere mi giù). Still, I’m sure there are plenty of blogs for whom discussion and comments are not key features of the site, and the technique you outline would be very helpful to them. Ancora, sono sicuro che ci sono molti blog per il quale la discussione e le osservazioni non sono caratteristiche chiave del sito, e la tecnica si schema sarebbe molto utile per loro.
jf JF
May 4th, 2006 at 2:44 pm 4 maggio 2006 a 2:44 pm
[...] Falls Ihre Seite laufend mit neuen Kommentaren überschüttet wird, so sollten Sie auf eine Installation der Caching-Funktion verzichten oder diese zumindest nicht im “Auslieferzustand” einsetzen. [...] Falls Ihre Seite costantemente con nuovi Kommentaren überschüttet wird, così dovrebbero Sie auf der installazione di una cache-Funktion verzichten oder zumindest diese nicht im "Auslieferzustand" impiegare. Da die Cache-Dateien in diesem Fall eine zu kurze Gültigkeitsdauer haben, könnte die Installation Ihren Server mit den zusätzlichen Aufgaben überlasten (oder zumindest nicht entlasten). Da morire Cache-Dateien in diesem Fall eine Gültigkeitsdauer brevi zu haben, potrebbe morire la vostra economia di installazione Server con i compiti supplementari überlasten (oder zumindest nicht entlasten). Sollten Sie trotzdem nicht auch ein Caching verzichten wollen, dann können Sie mit dem folgenden kleinen Hack für Abhilfe sorgen. Dovrebbero Sie trotzdem nicht auch ein cache verzichten wollen, dann können Sie mit dem folgenden piccoli Hack sorgen für Abhilfe. Damit wird die Aufbereitung der Caching-Seite nicht von neuen Beiträgen oder Kommentaren abhängig gemacht, sondern erfolgt zeitgesteuert. Sarà così possibile per morire Aufbereitung der cache-Seite nicht von Beiträgen nuovo dipende oder Kommentaren gemacht, ma avviene zeitgesteuert. Der Nachteil: neue Kommentare oder Beiträge werden nicht sofort, sondern erst nach der zeitbasierten Löschung des Caches sichtbar. Der Nachteil: nouvel Kommentare oder nicht contributi vengono subito, ma erst nach der zeitbasierten Löschung des cache sichtbar. [...]
November 17th, 2006 at 2:41 pm 17 novembre 2006 alle 2:41 pm
Thanks for the tips. Grazie per i suggerimenti. I am not sure this will help because this looks like suitable for blogs with a lot of comments. Io non sono sicuro che questo contribuirà perché questa si presenta come adatto per i blog con un sacco di commenti.
My problem is a little different, not so much on comments. Il mio problema è un po 'diverso, non tanto su commenti. My blog is having too many visitors, thus have too many processes running at the same time. Il mio blog è avere troppi visitatori, così sono troppi processi in esecuzione allo stesso tempo. How to optimize this? Come ottimizzare questo?
November 17th, 2006 at 10:21 pm 17 novembre 2006 a 10:21 pm
If this tip doesn’t help then you are pretty much due for a dedicated server Se questo suggerimento non aiuta quindi si sono praticamente dovuto per un server dedicato
November 18th, 2006 at 12:48 pm 18 novembre 2006 alle 12:48 pm
[...] Since the machine was limited by CPU, I decided to fire up DTrace to see where the httpd process was spending it’s time. [...] Dal momento che la macchina è stata limitata dalla CPU, ho deciso di avviare DTrace per vedere dove il processo è stato httpd spesa è il momento. The DTrace results indicated that Apache was spending a considerable amount of time compiling PHP pages, and issuing queries to the back-end database. La DTrace risultati hanno indicato che Apache è stata spesa una notevole quantità di tempo di compilazione di pagine PHP, e il rilascio di query per il database back-end. Since I only update my blog a few times each week, I started to wonder if there was a way to turn the pages I created in Wordpress into static content. Dal momento che solo aggiornare il mio blog un paio di volte ogni settimana, ho cominciato a chiedermi se ci fosse un modo per girare le pagine che ho creato in WordPress in un contenuto statico. After reading through a variety of wordpress resources, I came across the wordpress cache #2. Dopo la lettura attraverso una varietà di risorse wordpress, mi sono imbattuto in wordpress la cache # 2. This super useful plugin will create a static represetnation of each dynamically generated page, and serve that file instead of the page that wordpress woudl dynamically generate. Questo super utile plug creerà una statica represetnation di ogni pagina generati dinamicamente, e servire quel file anziché la pagina che si wordpress generare dinamicamente. Once I got wp-cache2 installed, the results were right on par with what I orginally thought they should be: [...] Una volta wp-cache2 installato, i risultati sono stati diritto alla pari con quello che ho pensato orginally esse devono essere: [...]
January 1st, 2007 at 12:23 am 1 ° gennaio 2007 a 12:23 am
[...] I recommend it over external caching engines like eAccelerator because it is senstive to changes in WordPress content and will automatically refresh the cache. [...] Mi raccomando esterni come i motori di caching eAccelerator perché è senstive ai cambiamenti in WordPress contenuto e aggiornare automaticamente la cache. However it has a downside. Tuttavia ha un ribasso. On highly commented sites the effects of caching is negated because of frequent cache refreshes. Su siti altamente commentato gli effetti di memorizzazione nella cache è negata a causa di frequenti cache aggiornata. This can be addressed by this tip: How to improve performance of highly commented WordPress blogs [...] Questo può essere affrontato da questo consiglio: Come migliorare le prestazioni di grandi commentato i blogs di WordPress [...]
March 20th, 2007 at 8:18 pm 20 marzo 2007 a 8:18 pm
Would you have any tips for configuring WP-Cache 2 with interactive plugins like GamerZ PostRatings, or comment karma? Si avete suggerimenti per la configurazione di WP-Cache 2 con collegamenti interattivi come GamerZ PostRatings, o il commento del karma?
I’ve tried using the mfunc mods in my designs, but they never seem to work… do you know if a mfunc has to be within a if function_exists call? Ho provato utilizzando il mfunc comfort nella mia disegni e modelli, ma non sembra funzionare… sai se un mfunc deve essere all'interno di un se function_exists chiamata?
This is driving me nuts. Questa è la guida mi frutta a guscio.
Eric
May 1st, 2007 at 8:34 am 1 ° maggio 2007 a 8:34 am
Whilst I don’t have a high volume of comments across all posts on my blog, there are 2 posts which have a combined total of more than 1200 comments and this seems to be bogging down the site, or at least the loading of those 2 pages. Mentre io non sono un grande volume di commenti in tutti i posti nel mio blog, ci sono 2 posti che hanno un totale complessivo di più di 1200 commenti e questo sembra essere bogging il sito, o almeno il carico di quelle 2 pagine. I installed wp-cache but since installing I have also started getting internal server 500 errors for one of the posts. Ho installato wp-nascondiglio, ma dal momento che l'installazione mi hanno anche cominciato ottenere server interno 500 errori per uno dei posti. Is your solution the only way of of speeding up these pages? È la vostra soluzione l'unico modo per accelerare di queste pagine?
May 2nd, 2007 at 10:58 am 2 maggio 2007 alle 10:58 am
You can always buy a bigger and better server / load balance it, also use memcached, eAccelerator etc. Each of them works in different ways to improve performance. È sempre possibile acquistare una più grande e migliore / server di bilanciamento del carico, anche usare memcached, ecc eAccelerator Ognuno di loro opere in diversi modi per migliorare le prestazioni.
You may want to read this article for details: Ti suggeriamo di leggere questo articolo per ulteriori dettagli:
5 Golden Tips For WordPress Performance Optimization / Slashdot-Digg Protection 5 Golden Suggerimenti per l'ottimizzazione delle prestazioni wordpress / Slashdot-digg protezione