问题是,如果我通过域下载文件,下载完成以毫秒为单位,但是如果我从其他域下载相同的文件,则下载开始缓慢,并且在最后返回超时 (如果文件很大,如2MB ,但是如果这个文件是100Kb的话就可以正常下载了)。
让我再解释一下:
我有一个本地服务器,我已经build立了以下结构。
www/ index.html 2mb.pdf blog/ wp-content/ 2mb.pdf wordpress.structure
我在Debian中使用2个虚拟服务器的apache2,其中包含以下域名和configuration(这些不是真名) freefri.com和freefriblog.com 。
freefri.com :
<VirtualHost *:80> DocumentRoot /var/www ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined <Directory /> Options FollowSymLinks AllowOverride None </Directory>
freefriblog.com :
<VirtualHost *:80> ServerName freefriblog.com HostnameLookups Off EnableSendfile off KeepAlive off DocumentRoot /var/www/blog <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/blog> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> CustomLog ${APACHE_LOG_DIR}/freefriblog-access.log common ErrorLog ${APACHE_LOG_DIR}/freefriblog-error.log LogLevel warn </VirtualHost>
所以,如果我打开浏览器并inputfreefri.com/2mb.pdf ,这个文件就会立即下载。 如果我inputfreefri.com/blog/2mb.pdf ,文件也会立即下载。 但是,如果我inputfreefriblog.com/2mb.pdf请求正在超时。 所有静态文件(如.png或.jpg)都比800KB大。 从freefriblog.com下载图像我得到的控制台错误“图像损坏或截断”,但同样的图像从freefri.com立即下载。
在下载期间,apache2 CPU使用率正在增加。 也许apache可以对文件做一些类似于GZIP的处理,但是我在响应头文件中看不到gzip。
在日志中我没有看到任何奇怪的东西
可能是WordPress的做一些奇怪的事情? 一些重写规则?
我可以添加更多的细节,如.htaccess,但我不想现在发送垃圾邮件,只是要求在评论中的任何东西,我添加它。 我也可以执行任何testing,因为它不是一个生产站点。