How To Improve Performance of Highly Commented WordPress Blogs Como melhorar a performance de grandes comentou WordPress blogs
Most of highly trafficked and highly commented wordpress blogs rely upon some smart caching solution or another. A maioria das vítimas de tráfico e altamente altamente comentou wordpress dependem de alguns blogs inteligentes caching solução ou outra. However it may not be enough to prevent slowing down your server if your post(s) are heavily commented upon. No entanto, poderá não ser suficiente para evitar a abrandar o seu servidor se o seu posto (s) estão muito comentado. This is because smart caching solutions re-create the cache whenever a new comment is posted. Isto é porque o caching soluções inteligentes re-criar o cache sempre que um novo comentário for postado. Here is a simple solution in three steps. Aqui está uma solução simples, em três etapas.
Steps: Passos:
- Install (and activate) Instalar (e ativar) Wp-Cache 2 WP-Cache 2 plugin. I have excellent experience with it for over a year. Tenho excelente experiência com ele durante mais de um ano.
- Modify wp-cache-phase2.php (one of the plugin files) to comment / delete the line: Modificar wp-cache-phase2.php (um dos arquivos do plugin) para comentar / apagar a linha:
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. Defina o cache expirar tempo de 2 horas ou mais. This can easily handle a slashdot effect without breaking a sweat. Isso pode facilmente lidar com um efeito slashdot sem quebrar um suor.
The change in step 2 ensures that the pages are not regenerated everytime a new comment is posted. A mudança na etapa 2 garante que as páginas não são regenerados sempre um novo comentário for postado. They are however regenerated after the expiration of cache. Eles são, no entanto, regenerada após a expiração do cache. This time lag saves an enormous amount of sql query when a post is heavily commented. Este desfasamento temporal economiza uma quantidade enorme de consulta SQL quando um post é fortemente comentados.
Filed under Arquivado em CMS Software CMS Software , De Headline News Headline News , De How To How To , De PHP , De Pro Blogging Blogging Pro , De Tech Note Nota Tech , De Web , De Web Services Web Services , De WordPress | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | este artigo |
Email this Article E-mail este artigo
You may also like to read Você pode também gosta de ler |




April 27th, 2006 at 10:49 am 27 de abril de 2006 em 10:49
People like instant gratification. Pessoas como gratificação instantânea. If somebody makes a comment on a website, they expect it to show up immediately. Se alguém faz um comentário sobre um site, eles esperam que a mostrar-se imediatamente. Otherwise, the commentor will be discouraged from posting a comment in the future. Caso contrário, o commentor serão desencorajadas de postar um comentário no futuro.
Because of this, I think that another solution is needed. Devido a isto, penso que uma outra solução é necessária.
April 27th, 2006 at 12:51 pm 27 de abril de 2006 em 12:51 pm
When the choice is between providing instant gratification versus making the site available, isn’t the solution clear? Quando a escolha é entre a prestação gratificação instantânea versus tornando o site disponível, não é a solução clara?
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. Não creio que esperava comentários a aparecer imediatamente é algo que os usuários têm vindo a esperar que muitos sites têm hoje manual ou semi-manual moderação política. A clear statement explaining the situation should address the expectations. Uma declaração clara explicando a situação deverá abordar as expectativas.
April 27th, 2006 at 10:53 pm 27 de abril de 2006 em 10:53 pm
Have you implemented this on a public site that I can see it in action on? Você já implementado este público em um site que eu possa vê-la em ação em? I noticed when I posted that you don’t use it on this one. Eu observei que você postou quando eu não usá-lo com um presente. I am really curious about the type of site you feel this would be helpful on. Estou muito curioso sobre o tipo de site que você sinta que seja útil ao.
My feeling is that the number of comments on a weblog is going to be very low. O meu sentimento é de que o número de comentários sobre um weblog vai ser muito baixa. But, even if somehow the volume of comments becomes a problem, wouldn’ta better solution be to move the comments onto a seperate page? Mas, mesmo que de certa forma o volume de comentários se torna um problema, wouldn'ta ser melhor solução para mover os comentários numa página separada? 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. Isso seria acabar com a maior parte da carga só de leitura, assim como a leitura e escrita carga devido a comentários porque você é só enviar a página para a pequena fracção de pessoas que preocupam os comentários em primeiro lugar.
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. De qualquer maneira, eu só acho que existem tantas outras possibilidades para melhorar o desempenho antes de tomar uma medida que tem um tal impacto negativo sobre a experiência do usuário.
April 28th, 2006 at 12:17 pm 28 de abril de 2006 em 12:17
> My feeling is that the number of comments on a weblog is going to be very low. > O meu sentimento é de que o número de comentários sobre um weblog vai ser muito baixa.
Again this is not a solution for oridinary situations. Mais uma vez não se trata de uma solução para oridinary situações. 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. Há certos populares blogs que obter lotes de comentários, especialmente quando você quebrar mais uma história / get slashdotted etc usmagazine é um desses sites.
I used this technique for a limited time on this blog with good results. Eu usei essa técnica por um período limitado a este blog com bons resultados.
> But, even if somehow the volume of comments becomes a problem, wouldn’ta better solution be to move the comments onto a seperate page? > Mas, mesmo que de certa forma o volume de comentários se torna um problema, wouldnâ € ™ ta melhor solução é a mover os comentários numa página separada?
How are you going to do that within WordPress framework? Como é que pensa fazer para que, dentro de WordPress quadro?
> Anyway, I just think that there are so many other possibilities to improve performance > Seja como for, eu só acho que existem tantas outras possibilidades para melhorar o desempenho
Please let me know how you plan to optimize performance of a heavily commented site without slowing down page re-generation after comments? Por favor, deixe-me saber como você planeja para otimizar o desempenho de uma fortemente comentados site sem abrandar página re-geração após comentários?
April 28th, 2006 at 2:36 pm 28 de abril de 2006 em 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? Desculpe-nos ser um pouco denso, mas será que esse truque realmente fazer os comentários não aparecem nas páginas individuais postagem até o cache expirar? 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? Ou será que o número de comentários indicado na página principal não basta atualizar para corresponder ao número real de comentários visíveis em cada comentário páginas?
jf JF
April 28th, 2006 at 9:23 pm 28 de abril de 2006 em 9:23 pm
The new comments are published as soon as the cache expires. Os novos comentários são publicados logo que o cache expirar. So if your cache is set to 30 minutes then you get to see the new comments every 30 minutes instead of instantly. Portanto, se o cache está definido para 30 minutos depois que você começa a ver os novos comentários a cada 30 minutos em vez de instantaneamente.
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. Provavelmente este é o que não era claro para Brian como estou ainda tentando entender porque ele pensa que seria uma coisa assim tão má.
April 29th, 2006 at 7:27 am 29 de abril de 2006 em 7:27 am
It’s not a terrible thing, but it’s not right for every site. Não é uma coisa terrível, mas não é razão para cada site. 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. Para os locais onde a comunidade ea discussão aspecto é uma parte importante de pessoas visitam por isso, mudar a situação a partir de observações-de aparecer instantaneamente a comentários parecem---após uma pausa-off pode transformar as pessoas e eliminar uma das razões que eles vieram e visitado em primeiro lugar.
Of course, having a pause before comments appear is better than having a site that doesn’t work. Claro, depois de uma pausa antes de comentários aparecem é melhor do que ter um site que não funciona. But not everybody who is looking to improve WP’s performance is at a place where their site is crashing constantly. Mas nem todo mundo que está olhando para melhorar o desempenho da WP está em um lugar onde seu site está falhando constantemente. 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. Meu site está ainda por exemplo chugging ao longo fino performance-wise, mas eu tenho sido avisado pelo meu host-se que é a começar a assumir mais recursos do que o servidor sinta confortável com, pelo que eu estou a estudar formas de melhorar desempenho. 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). Ainda assim, porque o meu site visitantes gostem de usar seção de comentários para falar com um outro mais ou menos em tempo real - e porque, suspeito, após uma longa pausa comentando iria resultar em menos visitas ao seu lado (e, portanto, menos receitas para mim) Eu não iria aplicar uma técnica como a sua excepto como último recurso (ou seja, se o meu Web acolhimento got farta e foi ameaçado de fechar-me para baixo). 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. Ainda assim, tenho certeza de que há abundância de blogs para quem a discussão e comentários não são características fundamentais do site, e você a técnica esboço seria muito útil para eles.
jf JF
May 4th, 2006 at 2:44 pm 4 de maio de 2006 em 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 laufend mit neuen Kommentaren überschüttet wird, de modo sollten Sie auf der eine Instalação cashing-Funktion verzichten oder diese zumindest NICHT im "Auslieferzustand" einsetzen. 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 die Cache-Dateien zu em diesem Fall eine kurze Gültigkeitsdauer haben, könnte die Ihren Instalação Servidor zusätzlichen mit den Aufgaben ü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. Sollten Sie auch NICHT trotzdem ein cashing verzichten wollen, dann können Sie mit dem folgenden kleinen 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. Damit wird die cashing-Aufbereitung der Seite von neuen NICHT Beiträgen oder Kommentaren abhängig gemacht, sondern erfolgt zeitgesteuert. Der Nachteil: neue Kommentare oder Beiträge werden nicht sofort, sondern erst nach der zeitbasierten Löschung des Caches sichtbar. Nachteil der: Neue Kommentare oder Beiträge werden NICHT sofort, sondern erst nach der zeitbasierten Löschung des caches sichtbar. [...]
November 17th, 2006 at 2:41 pm 17 de novembro, 2006 em 2:41 pm
Thanks for the tips. Agradecimentos para as pontas. I am not sure this will help because this looks like suitable for blogs with a lot of comments. Não estou certo de que este irá ajudar pois este parece adequado para blogs com uma grande quantidade de comentários.
My problem is a little different, not so much on comments. O meu problema é um pouco diferente, não tanto em comentários. My blog is having too many visitors, thus have too many processes running at the same time. Meu blog é ter muitos visitantes, assim, tem muitos processos executando ao mesmo tempo. How to optimize this? Como otimizar a este respeito?
November 17th, 2006 at 10:21 pm 17 de novembro de 2006 em 10:21 pm
If this tip doesn’t help then you are pretty much due for a dedicated server Se essa dica não ajuda então você é muito bonito, devido a um servidor dedicado
November 18th, 2006 at 12:48 pm 18 de novembro de 2006, às 12:48
[...] Since the machine was limited by CPU, I decided to fire up DTrace to see where the httpd process was spending it’s time. [...] Uma vez que a máquina foi limitado pelo CPU, eu decidi ao fogo até DTrace para ver onde o processo foi httpd gastos é a hora. The DTrace results indicated that Apache was spending a considerable amount of time compiling PHP pages, and issuing queries to the back-end database. O DTrace resultados indicaram que o Apache foi gasto uma quantidade considerável de tempo compilar PHP páginas, consultas e emissão de back-end para o banco de dados. 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. Uma vez que eu só atualizar meu blog algumas vezes a cada semana, eu comecei a saber se havia uma maneira de me virar as páginas criadas no Wordpress em conteúdo estático. After reading through a variety of wordpress resources, I came across the wordpress cache #2. Após a leitura através de uma variedade de recursos wordpress, cheguei em todo o wordpress 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. Este super útil plugin irá criar um estático represetnation dinâmicas de cada página, e esse arquivo em vez de servir a página que wordpress iria gerar dinamicamente. Once I got wp-cache2 installed, the results were right on par with what I orginally thought they should be: [...] Uma vez eu comecei wp-cache2 instalados, os resultados foram direito a par com o que eu pensava que deveria ser orginally: [...]
January 1st, 2007 at 12:23 am 1 de janeiro de 2007 em 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. [...] Eu recomendo ao longo externa caching como motores eAccelerator porque é senstive às mudanças no conteúdo e WordPress irá automaticamente atualizar o cache. However it has a downside. No entanto, tem uma desvantagem. On highly commented sites the effects of caching is negated because of frequent cache refreshes. Em sites altamente comentou os efeitos da cache é negada por causa das freqüentes cache refresca. This can be addressed by this tip: How to improve performance of highly commented WordPress blogs [...] Isto pode ser abordada por esta dica: a melhoria do desempenho de alta comentou WordPress blogs [...]
March 20th, 2007 at 8:18 pm 20 de março de 2007 em 8:18 pm
Would you have any tips for configuring WP-Cache 2 with interactive plugins like GamerZ PostRatings, or comment karma? Teria de ter alguma dicas para configurar WP-Cache 2 interativo com plugins como GamerZ PostRatings, comentário ou carma?
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? Eu tentei usar o mfunc mods nos meus desenhos, mas eles nunca parecem trabalhar a… é que eu sei se um mfunc tem que ser dentro de um function_exists se chamar?
This is driving me nuts. Isto está a levar-me castanhas.
Eric
May 1st, 2007 at 8:34 am 1 de maio de 2007 em 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. Embora eu não tenho um grande volume de comentários em todos os lugares no meu blog, há 2 lugares que têm um total combinado de mais de 1200 observações e este parece ser bogging estabelece o site, ou pelo menos a carga desses 2 páginas. I installed wp-cache but since installing I have also started getting internal server 500 errors for one of the posts. Eu instalei wp-cache mas desde que eu tenho também começou a instalar interna servidor recebendo 500 erros para um dos lugares. Is your solution the only way of of speeding up these pages? Sua solução é a única maneira de acelerar estes de páginas?
May 2nd, 2007 at 10:58 am 2 de maio de 2007 em 10:58
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. Você sempre pode comprar uma maior e melhor servidor / carga equilíbrio-lo, também utilizar memcached, etc eAccelerator Cada um deles funciona de diferentes maneiras para melhorar o desempenho.
You may want to read this article for details: Você pode querer ler este artigo para obter detalhes:
5 Golden Tips For WordPress Performance Optimization / Slashdot-Digg Protection Golden 5 dicas para otimização de desempenho WordPress / Slashdot-digg protecção