W3 Total Cache产生大量文件夹

Submitted by Dot on Mon, 09/02/2013 - 11:27

很久没进主机后台了,昨天在cPanel发现文件数竟然猛增到25340,吓了一跳。主机上就放了wordpress、drupal和phpMyAdmin三个目录,怎么至于呢? 进File Count看看详细,直接提示:

Your account contains more than 9740 directories and may pose a potential performance risk to the server.Please reduce the number of directories for your account to prevent possible account deactivation. 
In order to view the top 50 directories that have the most files, please navigate to your File Manager and navigate to the tmp directory, and then open the userquota file.

想了想,应该是wordpress插件W3 Total Cache导致的。

SSH到主机用ll -R|grep ^drw|wc -l命令查看wordpress目录下子目录数量,竟然有17720个。往下排查,发现主要集中在wp-content/cache/下,有16694个。这个wp-content/cache/正是W3 Total Cache的缓存目录。W3-Total-Cache-makes-huge-number-of-directories

后来我做了个简单的测试,先重命名cache/目录,然后新建一个新的cache/目录,经测试,网站被访问时cache/下就会生成临时文件夹。小网站,基本不会有人同时在线,也就我自己打开了两三个页面,cache/目录下子目录数量就上升到三千多个,网页关闭后又降至两三百。

至于当时是怎么上万的就不得而知了。

对于访问量大的网站,不知道这个数量会达到多少,W3 Total Cache里应该有相关的优化设置,只是我没找到。

随后卸载了W3 Total Cache。主机后台的File Count不是即时更新,而是每周一更新,今天星期一,登录进去查看,数量已经更新为两千多了。

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.