MySql 帖子存档。处理需要保留的大量存档帖子的最佳方法是什么?
如果我的 WordPress 网站每天生成数千(也许数百万)个帖子,那么防止网站性能因仅在有人搜索旧帖子或出于合法目的时才需要查看的帖子而受到影响的最佳方法是什么?
我的第一个想法是在间歇期运行一个 cron 作业,并将过时的帖子移至存档数据库。如果有人想查看较旧的帖子,代码会自动在档案中查找。
有更好的办法吗?
此外,任何有关处理大量站点数据的链接都会很有帮助!
If my wordpress site generates thousands(perhaps millions) of posts a day, what is the best way to keep the site from taking a performance hit with posts that only need to be seen if someone searches old posts or for legal purposes?
My first thought was to run a cron job during a lull and move the out-of-date posts to an archive database. If anyone wanted to view an older post, the code would automatically look in the archives.
Is there a better way?
Also, any links to tuts on handling massive site data would be helpful!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您并不孤单,请参阅同一主题的编码恐怖帖子:http://www.codinghorror.com/blog/2008/04/behold-wordpress-destroyer-of-cpus.html
最简单的事情就是安装 WP-Cache 插件:
WP-Cache 是一个极其高效的 WordPress 页面缓存系统,可以使您的网站更快、响应更快。它的工作原理是缓存 Worpress 页面并将它们存储在静态文件中,以便直接从文件中处理未来的请求,而不是加载和编译整个 PHP 代码,然后从数据库构建页面。
http://mnm.uib.es/gallir/wp-cache-2/
也许使用这些推荐的数据库设置:
http:// www.codinghorror.com/blog/files/matt-mullenweg-wordpress-mysql-recommendations.txt
然后也许对 MySQL 中的查询缓存设置进行一些更改。
要了解如何执行此操作:http://dev. mysql.com/doc/refman/5.0/en/query-cache-configuration.html
You are not alone with this, see the Coding Horror post on the same topic: http://www.codinghorror.com/blog/2008/04/behold-wordpress-destroyer-of-cpus.html
The easiest thing to do is to install the WP-Cache plugin:
WP-Cache is an extremely efficient WordPress page caching system to make your site much faster and responsive. It works by caching Worpress pages and storing them in a static file for serving future requests directly from the file rather than loading and compiling the whole PHP code and then building the page from the database.
http://mnm.uib.es/gallir/wp-cache-2/
Perhaps use these recommended DB settings:
http://www.codinghorror.com/blog/files/matt-mullenweg-wordpress-mysql-recommendations.txt
Then perhaps make a few changes to your query cache settings in MySQL.
To see how to do this: http://dev.mysql.com/doc/refman/5.0/en/query-cache-configuration.html