Linux

來自某些 ISP 的請求需要很長時間

  • September 28, 2014

我們有一個在虛擬機上執行 PHP 的 Apache 伺服器。文件根目錄位於使用者的主文件夾 ( /home/users/{first letter}/{username}/) 中,並且/home/users/安裝在 NFS 上。

似乎發生了一些奇怪的事情。當一些使用者請求一個文件時(在這個例子中我使用Hondenbol.png)它需要很長時間(起初使用者認為它根本沒有載入)而對於其他使用者(對我來說,在這種情況下)它幾乎立即載入。

這是該 vHost 的 Apache 日誌文件的一部分。我注意到的唯一奇怪的事情是 HTTP 狀態碼後面的數字,據我所知是這個(來自 Apache 文件);

2326 (%b)
   The last part indicates the size of the object returned to the client, not including the response headers. If no content was returned to the client, this value will be "-". To log "0" for no content, use %B instead.

同一個文件應該有這麼大的區別嗎?還是與瀏覽器記憶體有關?

root@web:/var/log/apache2/vhost# cat VHOST_USERNAME_USERNAME.sinners.be.log | grep -i bol
IP_USER - - [09/Sep/2014:17:18:34 +0200] "GET /SUBFOLDER/application/img/Hondenbol200.png HTTP/1.1" 404 544 "http://USERNAME.sinners.be/SUBFOLDER/index.php" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.44 Safari/537.36"
IP_USER - - [09/Sep/2014:17:20:29 +0200] "GET /SUBFOLDER/application/img/Hondenbol200.png HTTP/1.1" 404 544 "http://USERNAME.sinners.be/SUBFOLDER/index.php" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.44 Safari/537.36"
IP_USER - - [09/Sep/2014:17:43:45 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222132 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.44 Safari/537.36"
IP_USER - - [10/Sep/2014:17:13:05 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36"
IP_ME - - [20/Sep/2014:13:50:38 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222130 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:13:53:23 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:13:53:41 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_USER - - [20/Sep/2014:13:53:39 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.66 Safari/537.36"
IP_USER - - [20/Sep/2014:13:53:38 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.66 Safari/537.36"
RANDOM_IP - - [20/Sep/2014:13:55:17 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.0" 200 222094 "-" "-"
IP_ME - - [20/Sep/2014:13:56:14 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 183 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_ME - - [20/Sep/2014:13:56:15 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_ME - - [20/Sep/2014:13:56:15 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_ME - - [20/Sep/2014:13:56:15 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_USER - - [20/Sep/2014:13:53:39 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.66 Safari/537.36"
IP_ME - - [20/Sep/2014:13:59:58 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:14:01:04 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:14:01:38 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222131 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_USER - - [20/Sep/2014:14:02:39 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222130 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.66 Safari/537.36"
IP_USER - - [20/Sep/2014:14:03:17 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 183 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.66 Safari/537.36"

文件:

-rwxr-xr-x  1 USERNAME user 221841 Sep 10 01:22 Hondenbol.png

root@web:~# uname -a
Linux web 3.14-2-amd64 #1 SMP Debian 3.14.15-2 (2014-08-09) x86_64 GNU/Linux
root@web:~# apache2 -v
Server version: Apache/2.4.10 (Debian)
Server built:   Jul 23 2014 13:15:48
root@web:~# php -v
PHP 5.6.0-1 (cli) (built: Aug 28 2014 13:03:02) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
   with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

我們使用mpm-itk.


更新 1

謝謝,@kasperd。我添加%D到日誌文件中,發現一位同事也有同樣的問題。我讓他(完全)載入有問題的網站幾次。

澄清; 頁面本身載入良好。只是頁面上的圖像對某些人來說很麻煩,但它們始終是相同的圖像。

同事來訪記錄:

IP_OTHER_GUY - - [20/Sep/2014:21:18:38 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 206 339 2602 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:18:38 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 206 341 11028 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:18:38 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 984 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:18:38 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 206 252546 33461847 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:18:38 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 206 184858 61415214 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:33:29 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1078 30539 "http://l.facebook.com/lsr.php?u=http%3A%2F%2FUSERNAME.sinners.be%2FSUBFOLDER%2F&ext=1411241671&hash=" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:33:29 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 864 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:33:39 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1078 30241 "http://l.facebook.com/lsr.php?u=http%3A%2F%2FUSERNAME.sinners.be%2FSUBFOLDER%2F&ext=1411241671&hash=" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:33:39 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 2659 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:33:39 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 506 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:34:04 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1078 50469 "http://l.facebook.com/lsr.php?u=http%3A%2F%2FUSERNAME.sinners.be%2FSUBFOLDER%2F&ext=1411241671&hash=" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:34:04 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 1663 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:34:04 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 562 8751 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:34:04 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 200 310256 48043620 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:34:04 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 200 222130 61975581 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:35:07 +0200] "GET /favicon.ico HTTP/1.1" 404 506 2452 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:36:08 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1078 33676 "http://l.facebook.com/lsr.php?u=http%3A%2F%2FUSERNAME.sinners.be%2FSUBFOLDER%2F&ext=1411241671&hash=" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:36:08 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 3005 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:36:08 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 562 8426 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"
IP_OTHER_GUY - - [20/Sep/2014:21:36:08 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 200 310256 60066766 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"

記錄我的訪問:

IP_ME - - [20/Sep/2014:21:32:59 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1078 55236 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:32:59 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 1154 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:32:59 +0200] "GET /favicon.ico HTTP/1.1" 404 506 216 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:32:59 +0200] "GET /favicon.ico HTTP/1.1" 404 506 183 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:16 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1078 51083 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:16 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 2006 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:16 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 774 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:16 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 717 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:16 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 304 183 9232 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:16 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1077 9386 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 657 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 304 182 488 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 183 8270 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 392 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1077 9150 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 1028 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 777 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 304 182 487 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:17 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 340 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1077 8646 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 746 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 287 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 304 182 699 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 311 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1077 7981 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 349 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 304 182 238 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 2150 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:18 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 291 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:19 +0200] "GET /SUBFOLDER/ HTTP/1.1" 200 1077 22099 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:19 +0200] "GET /SUBFOLDER/application/css/style.css HTTP/1.1" 200 1304 822 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:19 +0200] "GET /SUBFOLDER/application/img/Hondenbol.png HTTP/1.1" 304 182 345 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:19 +0200] "GET /SUBFOLDER/application/img/banner.jpg HTTP/1.1" 304 182 217 "http://USERNAME.sinners.be/SUBFOLDER/" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"
IP_ME - - [20/Sep/2014:21:37:19 +0200] "GET /SUBFOLDER/application/css/afbeeldingen/template/pattern.png HTTP/1.1" 404 561 265 "http://USERNAME.sinners.be/SUBFOLDER/application/css/style.css" "Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0"

如您所見,我訪問的載入/處理時間要短得多

所有對此有問題的人似乎都將 Telenet 作為他們的網際網路服務提供商。擁有 Belgacom(這是這裡唯一的其他選擇)的人似乎沒有這個問題。不過,這可能是巧合。這只是我注意到的事情;我不確定這是否相關。

更新 2

供參考,測試頁;http://robinj1995.sinners.be/test/index_en.php

第一個欄位集(塊)是這裡最相關的。

更新 3

我們嘗試使用非 Apache Web 伺服器(GitLab 的 Unicorn)並遇到了同樣的問題。問題似乎與網路/防火牆問題有關,而不是我們的 Apache 配置問題。

我們的防火牆和/或墊腳石是執行 Debian 穩定版的伺服器iptables

狀態碼304表示記憶體的副本仍然是最新的,並且沒有數據發送到客戶端。您會看到所有帶有狀態碼的請求的字節數都很小,而對於所有帶有狀態碼的請求304,它的文件大小差不多200

但是,如果您有不錯的連接速度,傳輸 200KB 的靜態數據應該只需要幾分之一秒。所以這可能不是您正在尋找的瓶頸。

對於調試 Apache 性能問題,我發現包含%DLogFormat. 這將告訴您處理請求需要多少微秒。

這裡有幾個變數(不同的瀏覽器、源 IP 地址),但這些都是 Web 伺服器外部的。如果您已經看到基於使用者 ISP 的模式,那麼請嘗試圍繞它提出一些量化指標。例如,您可以跟踪網路時間以從瀏覽器載入圖像。

例如,在 Chrome(開發者工具,點擊“網路標籤”)中,您可以通過 URL 載入圖像並跟踪請求大小、HTTP 方法、HTTP 狀態和總網路延遲。請注意,您可以切換“禁用記憶體”複選框以查看記憶體影響 - 您的大多數 IP_ME 請求是 304(記憶體)與 IP_OTHER,它們是 200(未記憶體)。

嘗試使用您自己的 Hondenbol.jpg URL(記憶體/未記憶體)進行測試。然後還嘗試從不相關的伺服器載入中性圖像(我使用任意伺服器進行了測試,http ://telefonica.cl/images/new-home/banners/banner-tripack-moviecity.jpg ,位於智利某處)。

通過此測試,您應該能夠確認 a) 它只是記憶體,還是 b) 延遲在您的 Web 伺服器外部並且與使用者的 ISP 相關。

引用自:https://serverfault.com/questions/630018