簡體   English   中英

Windows上的Apache 2.4閑置后掛起20秒

[英]Apache 2.4 on Windows hangs for 20 seconds after being idle

我的筆記本電腦上的Windows 10 VM上運行着Apache。 如果我的Apache服務器閑置了一段時間,大約閑置了5分鍾,那么我的下一個請求將花費大約20秒。 后續請求將花費毫秒。 對於所有Apache請求,甚至圖像和404,都會發生這種情況。 我將LogLevel trace6設置為試圖找出正在發生的情況。

下面的日志輸出是針對這些緩慢請求之一的。 您可以看到第12行比上一行延遲了約20秒。 看起來掛斷與授權有關。 我還包括來自服務器狀態的mod_authz_core.c模塊的配置輸出。 我尚未啟用HostNameLookups。

我也嘗試過設定

AcceptFilter http none
AcceptFilter https none

通常建議將其作為Windows上慢速Apache的修復程序,但這沒有幫助。

 1 [Thu Aug 10 16:22:04.361111 2017] [filter:trace4] [pid 3004:tid 1072] mod_filter.c(168): [client 192.168.26.1:63869] Content-Type 'text/html;charset=utf-8' ... 2 [Thu Aug 10 16:21:41.705842 2017] [core:trace5] [pid 3004:tid 1072] protocol.c(643): [client 192.168.26.1:63869] Request received from client: GET /index.cfm?event=home HTTP/1.1 3 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(419): [client 192.168.26.1:63869] Headers received from client: 4 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Host: mydevsite.local 5 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Connection: keep-alive 6 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Upgrade-Insecure-Requests: 1 7 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 8 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 9 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Accept-Encoding: gzip, deflate 10 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Accept-Language: en-US,en;q=0.8 11 [Thu Aug 10 16:21:41.705842 2017] [http:trace4] [pid 3004:tid 1072] http_request.c(422): [client 192.168.26.1:63869] Cookie: blah-blah-removed 12 [Thu Aug 10 16:22:02.716531 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of Require all granted: granted 13 [Thu Aug 10 16:22:02.716898 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of <RequireAny>: granted 14 [Thu Aug 10 16:22:02.716898 2017] [core:trace3] [pid 3004:tid 1072] request.c(291): [client 192.168.26.1:63869] request authorized without authentication by access_checker_ex hook: /index.cfm 15 [Thu Aug 10 16:22:02.737002 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of Require all granted: granted 16 [Thu Aug 10 16:22:02.737002 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of <RequireAny>: granted 16 [Thu Aug 10 16:22:02.737002 2017] [core:trace3] [pid 3004:tid 1072] request.c(291): [client 192.168.26.1:63869] request authorized without authentication by access_checker_ex hook: /index.htm 18 [Thu Aug 10 16:22:04.249955 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of Require all granted: granted 19 [Thu Aug 10 16:22:04.249955 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of <RequireAny>: granted 20 [Thu Aug 10 16:22:04.249955 2017] [core:trace3] [pid 3004:tid 1072] request.c(291): [client 192.168.26.1:63869] request authorized without authentication by access_checker_ex hook: /views/home.cfm 21 [Thu Aug 10 16:22:04.288220 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of Require all granted: granted 22 [Thu Aug 10 16:22:04.288220 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of <RequireAny>: granted 23 [Thu Aug 10 16:22:04.288220 2017] [core:trace3] [pid 3004:tid 1072] request.c(291): [client 192.168.26.1:63869] request authorized without authentication by access_checker_ex hook: /views/header.cfm 24 [Thu Aug 10 16:22:04.305888 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of Require all granted: granted 25 [Thu Aug 10 16:22:04.305888 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of <RequireAny>: granted 26 [Thu Aug 10 16:22:04.305888 2017] [core:trace3] [pid 3004:tid 1072] request.c(291): [client 192.168.26.1:63869] request authorized without authentication by access_checker_ex hook: /views/navigation.cfm 27 [Thu Aug 10 16:22:04.324906 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of Require all granted: granted 28 [Thu Aug 10 16:22:04.324906 2017] [authz_core:debug] [pid 3004:tid 1072] mod_authz_core.c(806): [client 192.168.26.1:63869] AH01626: authorization result of <RequireAny>: granted 29 [Thu Aug 10 16:22:04.324906 2017] [core:trace3] [pid 3004:tid 1072] request.c(291): [client 192.168.26.1:63869] request authorized without authentication by access_checker_ex hook: /views/template.cfm 30 [Thu Aug 10 16:22:04.361111 2017] [filter:trace4] [pid 3004:tid 1072] mod_filter.c(174): [client 192.168.26.1:63869] ... matched 'text/html' 31 [Thu Aug 10 16:22:04.361111 2017] [filter:trace2] [pid 3004:tid 1072] mod_filter.c(185): [client 192.168.26.1:63869] Content-Type condition for 'deflate' matched 32 [Thu Aug 10 16:22:04.363823 2017] [http:trace3] [pid 3004:tid 1072] http_filters.c(1086): [client 192.168.26.1:63869] Response sent with status 200, headers: 33 [Thu Aug 10 16:22:04.363823 2017] [http:trace5] [pid 3004:tid 1072] http_filters.c(1095): [client 192.168.26.1:63869] Date: Thu, 10 Aug 2017 21:21:41 GMT 34 [Thu Aug 10 16:22:04.363823 2017] [http:trace5] [pid 3004:tid 1072] http_filters.c(1098): [client 192.168.26.1:63869] Server: Apache/2.4.25 (Win64) mod_jk/1.2.41 35 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Content-Language: en-US 36 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Expires: Thu, 10 Aug 2017 21:22:04 GMT 37 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Pragma: no-cache 38 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Vary: Accept-Encoding 39 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Content-Encoding: gzip 40 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Keep-Alive: timeout=5, max=100 41 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Connection: Keep-Alive 42 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Transfer-Encoding: chunked 43 [Thu Aug 10 16:22:04.363823 2017] [http:trace4] [pid 3004:tid 1072] http_filters.c(916): [client 192.168.26.1:63869] Content-Type: text/html;charset=utf-8 44 [Thu Aug 10 16:22:04.363823 2017] [core:trace6] [pid 3004:tid 1072] core_filters.c(523): [client 192.168.26.1:63869] core_output_filter: flushing because of FLUSH bucket 45 [Thu Aug 10 16:22:04.364202 2017] [deflate:debug] [pid 3004:tid 1072] mod_deflate.c(851): [client 192.168.26.1:63869] AH01384: Zlib: Compressed 70382 to 15199 : URL /index.cfm 46 [Thu Aug 10 16:22:04.364202 2017] [core:trace6] [pid 3004:tid 1072] core_filters.c(523): [client 192.168.26.1:63869] core_output_filter: flushing because of FLUSH bucket 47 [Thu Aug 10 16:22:04.390910 2017] [core:trace6] [pid 3004:tid 1064] core_filters.c(523): [client 192.168.26.1:63870] core_output_filter: flushing because of FLUSH bucket 48 [Thu Aug 10 16:22:04.390910 2017] [core:trace6] [pid 3004:tid 1080] core_filters.c(523): [client 192.168.26.1:63872] core_output_filter: flushing because of FLUSH bucket 49 [Thu Aug 10 16:22:04.390910 2017] [core:trace6] [pid 3004:tid 1076] core_filters.c(523): [client 192.168.26.1:63873] core_output_filter: flushing because of FLUSH bucket 50 [Thu Aug 10 16:22:04.391895 2017] [core:trace6] [pid 3004:tid 1084] core_filters.c(523): [client 192.168.26.1:63871] core_output_filter: flushing because of FLUSH bucket 51 [Thu Aug 10 16:22:04.391895 2017] [core:trace6] [pid 3004:tid 1068] core_filters.c(523): [client 192.168.26.1:63874] core_output_filter: flushing because of FLUSH bucket 
在此處輸入圖片說明

謝謝你的幫助。

在證明閱讀我的問題時,我想已經找到了答案。 庫存的httpd-info.conf文件中包含Require host .example.com行。 當我添加基於ip的限制時,似乎將這些內容留在了那里。 host行將導致HostNamelookups處於打開狀態。 我已經刪除了example.com行,現在已經通過兩個空閑周期對其進行了測試,並且兩次響應都沒有延遲。

有時您只需要解釋一下就可以看到問題。 :-)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM