哪些 Drupal MySQL 表可以安全地清除(以及何时)?
我正在向 Drupal 站点添加模块,但遇到了可怕的致命内存错误。我去清除了 accesslog
、cache
和 watchdog
表,但仍然收到此类错误。我在此站点上只运行一个数据库,供 Drupal 使用,但我想知道我还可以释放哪些其他表。我确信 phpMyAdmin 中列出的无数表中的一些对 Drupal 来说比其他表更重要。我可以盲目地清除所有带有“Overhead”的桌子吗?或者这会是一个重大失礼吗?
任何见解都将是最出色的。
I'm adding modules to a Drupal site and am getting dreaded fatal memory errors. I went to clear the accesslog
, cache
, and watchdog
tables, but am still getting such errors. I'm only running one database on this site and it's for Drupal use, but I am wondering what other tables I can free up. I'm sure some of the myriad tables listed in phpMyAdmin are more critical to Drupal than others. Can I blindly clear all tables with "Overhead" or would that be a major faux pas?
Any insight would be most excellent.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,您不能简单地清除某些表。无论如何,它对于内存不足错误也没有任何帮助。
实际上只有两种方法可以解决内存不足错误。 a) 增加内存限制,最低64MB,模块较多,甚至可能需要更多。 b) 禁用某些模块。
No, you can not simply clear some tables. It also doesn't help at all with out of memory errors anyway.
There are really only two ways to fight out of memory errors. a) Increase the memory limit, 64MB should be the minimum, with many modules, it might even need more. and b) disable some modules.
为了补充 Berdir 的答案,ac)将分析内存使用情况并找出正在消耗内存的内容,以及是否有办法优化或缓存其输出。
安装 devel 并打开性能日志记录,它会告诉您哪些查询和模块占用了最多的内存。您还可以使用 xdebug 和 cachegrind 实用程序来深入诊断此问题,但设置需要一段时间。
如果您截断数据库表,当更多内容填满这些表时,问题就会再次出现。
不过,最好的办法就是增加 PHP 内存限制。
To add to Berdir's answer, a c) would be to profile memory usage and figure out what's eating memory, and if there's a way to optimize or cache it's output.
Install devel and turn on performance logging, it'll tell you what queries and modules are eating up the most memory. You can also use xdebug and a cachegrind utility to diagnose this in-depth, but it'll take a while to set up.
If you truncate database tables, the problem will just come back when more stuff fills up those tables.
Best thing to do is just to increase your PHP memory limit, though.