歡迎您光臨本站 註冊首頁

那為兄弟幫忙看看這個squid問題。

←手機掃碼閱讀     火星人 @ 2014-03-05 , reply:0

那為兄弟幫忙看看這個squid問題。

squid的cache_log裡面的日誌如下:

CPU Usage: 0.033 seconds = 0.020 user + 0.013 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
        total space in arena:    3976 KB
        Ordinary blocks:         3896 KB      2 blks
        Small blocks:               0 KB      1 blks
        Holding blocks:          2292 KB      2 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:      79 KB
        Total in use:            6188 KB 99%
        Total free:                79 KB 1%
2007/05/14 12:12:44| Starting Squid Cache version 2.6.STABLE12 for i686-pc-linux-gnu...
2007/05/14 12:12:44| Process ID 25063
2007/05/14 12:12:44| With 1024 file descriptors available
2007/05/14 12:12:44| Using epoll for the IO loop
2007/05/14 12:12:44| Performing DNS Tests...
2007/05/14 12:12:44| Successful DNS name lookup tests...
2007/05/14 12:12:44| DNS Socket created at 0.0.0.0, port 49496, FD 5
2007/05/14 12:12:44| Adding nameserver 61.155.43.208 from squid.conf
2007/05/14 12:12:44| helperOpenServers: Starting 10 'redir.pl' processes
2007/05/14 12:12:44| Unlinkd pipe opened on FD 19
2007/05/14 12:12:44| Swap maxSize 134217728 KB, estimated 10324440 objects
2007/05/14 12:12:44| Target number of buckets: 516222
2007/05/14 12:12:44| Using 524288 Store buckets
2007/05/14 12:12:44| Max Mem  size: 1048576 KB
2007/05/14 12:12:44| Max Swap size: 134217728 KB
2007/05/14 12:12:44| Store logging disabled
2007/05/14 12:12:44| Rebuilding storage in /home/cache (DIRTY)
2007/05/14 12:12:44| Using Least Load store dir selection
2007/05/14 12:12:44| Set Current Directory to /home/cache
2007/05/14 12:12:44| Loaded Icons.
2007/05/14 12:12:44| Accepting transparently proxied HTTP connections at 0.0.0.0, port 80, FD 22.
2007/05/14 12:12:44| Accepting SNMP messages on port 3401, FD 23.
2007/05/14 12:12:44| WCCP Disabled.
2007/05/14 12:12:44| Ready to serve requests.
2007/05/14 12:12:44| Store rebuilding is  0.4% complete
2007/05/14 12:12:54| Done reading /home/cache swaplog (936588 entries)
2007/05/14 12:12:54| Finished rebuilding storage from disk.
2007/05/14 12:12:54|    724164 Entries scanned
2007/05/14 12:12:54|         0 Invalid entries.
2007/05/14 12:12:54|         0 With invalid flags.
2007/05/14 12:12:54|    721498 Objects loaded.
2007/05/14 12:12:54|         0 Objects expired.
2007/05/14 12:12:54|    199362 Objects cancelled.
2007/05/14 12:12:54|      2190 Duplicate URLs purged.
2007/05/14 12:12:54|       476 Swapfile clashes avoided.
2007/05/14 12:12:54|   Took 10.3 seconds (70181.6 objects/sec).
2007/05/14 12:12:54| Beginning Validation Procedure
2007/05/14 12:12:54|    262144 Entries Validated so far.
2007/05/14 12:12:54|   Completed Validation Procedure
2007/05/14 12:12:54|   Validated 522134 Entries
2007/05/14 12:12:54|   store_swap_size = 46136168k
2007/05/14 12:12:55| storeLateRelease: released 174 objects
2007/05/14 12:19:42| WARNING: 1 swapin MD5 mismatches
2007/05/14 12:19:54| WARNING: 10 swapin MD5 mismatches
2007/05/14 12:25:38| squidaio_queue_request: WARNING - Queue congestion
2007/05/14 12:43:43| squidaio_queue_request: WARNING - Queue congestion
2007/05/14 13:18:00| squidaio_queue_request: WARNING - Queue congestion
2007/05/14 13:28:11| parseHttpRequest: Unsupported method ':37:38'
2007/05/14 13:28:11| clientReadRequest: FD 31 (222.178.216.164:22482) Invalid Request
2007/05/14 14:09:49| WARNING! Your cache is running out of filedescriptors
2007/05/14 14:09:54| WARNING: All url_rewriter processes are busy.
2007/05/14 14:09:54| WARNING: up to 10 pending requests queued
2007/05/14 14:14:18| WARNING! Your cache is running out of filedescriptors
2007/05/14 14:14:34| WARNING! Your cache is running out of filedescriptors
2007/05/14 14:14:38| WARNING: All url_rewriter processes are busy.
2007/05/14 14:14:38| WARNING: up to 28 pending requests queued
2007/05/14 14:14:38| Consider increasing the number of url_rewriter processes to at least 38 in your config file.
2007/05/14 14:22:36| WARNING! Your cache is running out of filedescriptors
2007/05/14 14:22:41| WARNING: All url_rewriter processes are busy.
2007/05/14 14:22:41| WARNING: up to 48 pending requests queued
2007/05/14 14:22:52| WARNING! Your cache is running out of filedescriptors
2007/05/14 14:23:01| squidaio_queue_request: WARNING - Queue congestion
2007/05/14 14:33:05| WARNING! Your cache is running out of filedescriptors
2007/05/14 14:33:06| WARNING: All url_rewriter processes are busy.
2007/05/14 14:33:06| WARNING: up to 27 pending requests queued
2007/05/14 14:33:21| WARNING! Your cache is running out of filedescriptors



這些日誌一出現,速度就很慢。。。



在官方也沒有找到解決的辦法。那問兄弟遇到這重情況。幫忙分析一下。是那裡問題。
《解決方案》

WARNING! Your cache is running out of filedescriptors

超過文件連接數,所以會出現問題

1,ulimit -HSn 10240
2,編譯squid
3,運行squid,這樣squid的文件描述符就變成10240了

但這樣有個問題就是重啟,文件描述符就會失效,所以

vi /etc/rc.local,加入

ulimit -HSn 10240
/dir/squid/sbin/squid -N &  #啟動squid

這樣就行了,如果需要手動啟動squid,請
vi /root/.bashrc添加
ulimit -HSn 10240

這樣每次以root身份登陸后,環境的文件描述符就變成10240了,然後手動啟動squid,squid的文件描述符就也是10240了
《解決方案》

liuhanzhao兄,謝謝了。
《解決方案》

debian 下安裝的squid

我是在debian下安裝的sqiud,配置完成後squid啟用的是80埠,apache啟用的是81埠。

squid和apache的埠都已經啟用。


但是訪問的時候,訪問頁面無法顯示,squid的errorlog里會有
WARNING! Your cache is running out of filedescriptors
這樣的警告。然後查看netstat -an |grep 80 |wc -l

937個鏈接

是在測試機上的,不可能有這麼多鏈接
查看后發現
都是
192.168.0.200:****   192.168.0.200:80
本機的一些埠鏈接本機的80埠。


有哪位大俠能告訴我怎麼解決這個問題嗎?

[火星人 ] 那為兄弟幫忙看看這個squid問題。已經有489次圍觀

http://coctec.com/docs/service/show-post-38645.html