歡迎您光臨本站 註冊首頁

squid導致的硬碟只讀問題

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

squid導致的硬碟只讀問題

各位大大,最近我的squid的伺服器很奇怪,老是出現內存溢出,Squid頻繁重啟,但是有時候重啟的時候,在cache_dir目錄重建完成以後出現了cache_dir目錄只讀問題,只能進行格式話,請各位老大幫忙看看啥問題啊?
系統centos5.4
squid:squid-2.6.STABLE22
swap:4G,內存也是4G,整個系統就跑一個squid,我的cache_mem 設置為3000M,大家再看下面的錯誤日誌:
FATAL: xcalloc: Unable to allocate 1 blocks of 4108 bytes!

Squid Cache (Version 2.6.STABLE22): Terminated abnormally.
(squid)
(squid)
(squid)
(squid)
(squid)
(squid)
(squid)
(squid)
(squid)
(squid)
/lib/libc.so.6(__libc_start_main+0xdc)
(squid)(i2d_SSL_SESSION+0x355)
CPU Usage: 467.400 seconds = 184.970 user + 282.430 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 21
Memory usage for squid via mallinfo():
        total space in arena:  -1106184 KB
        Ordinary blocks:       -1106188 KB      6 blks
        Small blocks:               0 KB      0 blks
        Holding blocks:         45256 KB      4 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:       3 KB
        Total in use:          -1060932 KB 100%
        Total free:                 3 KB 0%
2010/08/28 20:25:13| ctx: enter level  0
2010/08/28 20:25:13| storeDirWriteCleanLogs: Starting...
2010/08/28 20:25:13| WARNING: Closing open FD   14
2010/08/28 20:25:13| commSetEvents: epoll_ctl(EPOLL_CTL_DEL): failed on fd=14: (1) Operation not permitted
2010/08/28 20:25:16| Starting Squid Cache version 2.6.STABLE22 for i686-pc-linux-gnu...
2010/08/28 20:25:16| Process ID 4298
2010/08/28 20:25:16| With 188130 file descriptors available
2010/08/28 20:25:16| Using epoll for the IO loop
2010/08/28 20:25:16| Performing DNS Tests...
2010/08/28 20:25:16| Successful DNS name lookup tests...
2010/08/28 20:25:16| DNS Socket created at 0.0.0.0, port 43075, FD 6
2010/08/28 20:25:16| Adding nameserver ×.*.*.* from /etc/resolv.con
2010/08/28 20:25:16| Adding nameserver *.*.*.* from /etc/resolv.conf
2010/08/28 20:25:16| User-Agent logging is disabled.
2010/08/28 20:25:16| Referer logging is disabled.
2010/08/28 20:25:16| Unlinkd pipe opened on FD 11
2010/08/28 20:25:16| Swap maxSize 41943040 + 3072000 KB, estimated 0 objects
2010/08/28 20:25:16| Target number of buckets: 173134
2010/08/28 20:25:16| Using 262144 Store buckets
2010/08/28 20:25:16| Max Mem  size: 3072000 KB
2010/08/28 20:25:16| Max Swap size: 41943040 KB
2010/08/28 20:25:16| Store logging disabled
2010/08/28 20:25:16| Rebuilding storage in /data/cache1 (DIRTY)
2010/08/28 20:25:16| Rebuilding storage in /data/cache2 (DIRTY)
2010/08/28 20:25:16| Using Least Load store dir selection
2010/08/28 20:25:16| Current Directory is /data
2010/08/28 20:25:16| Loaded Icons.
2010/08/28 20:25:16| Accepting accelerated HTTP connections at 0.0.0.0, port 80, FD 14.
2010/08/28 20:25:16| Accepting SNMP messages on port 3401, FD 15.
2010/08/28 20:25:16| WCCP Disabled.
2010/08/28 20:25:16| Configuring Parent *.*.*.*
2010/08/28 20:25:16| Ready to serve requests.
2010/08/28 20:25:17| Store rebuilding is  1.8% complete
2010/08/28 20:25:21| Done reading /data/cache1 swaplog (222464 entries)
2010/08/28 20:25:21| Done reading /data/cache2 swaplog (223970 entries)
2010/08/28 20:25:21| Finished rebuilding storage from disk.
2010/08/28 20:25:21|    441958 Entries scanned
2010/08/28 20:25:21|         0 Invalid entries.
2010/08/28 20:25:21|         0 With invalid flags.
2010/08/28 20:25:21|    441737 Objects loaded.
2010/08/28 20:25:21|         0 Objects expired.
2010/08/28 20:25:21|      2749 Objects cancelled.
2010/08/28 20:25:21|       660 Duplicate URLs purged.
2010/08/28 20:25:21|        61 Swapfile clashes avoided.
2010/08/28 20:25:21|   Took 5.0 seconds (88652.5 objects/sec).
2010/08/28 20:25:21| Beginning Validation Procedure
2010/08/28 20:25:21|    262144 Entries Validated so far.
2010/08/28 20:25:21|   Completed Validation Procedure
2010/08/28 20:25:21|   Validated 438488 Entries
2010/08/28 20:25:21|   store_swap_size = 26097308k
2010/08/28 20:25:22| storeLateRelease: released 14 objects
2010/08/29 00:32:28| storeUfsCreate: Failed to create /data/cache1/03/AF/0003AF8A ((30) Read-only file system)
2010/08/29 00:32:28| storeUfsCreate: Failed to create /data/cache1/03/AF/0003AF8B ((30) Read-only file system)
2010/08/29 00:32:28| storeUfsCreate: Failed to create /data/cache1/03/AF/0003AF8C ((30) Read-only file system)

這個是squid運行下系統的狀態:
top - 10:22:30 up 6 days, 16:25,  1 user,  load average: 0.11, 0.09, 0.02
Tasks:  87 total,   1 running,  86 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 98.0%id,  1.3%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:   4155116k total,  3459760k used,   695356k free,   102840k buffers
Swap:  4192924k total,       56k used,  4192868k free,  2646076k cached


請各位老大幫忙解決哈啊,被這個問題快搞死了~
《解決方案》

先把cache_mem 改改看,據說這個超過物理內存三分之一不穩定...如果你是8G內存的話可以設置3000M
《解決方案》

chmod -R 777 /usr/local/squid/var/

還有緩存目錄創建允許當前用戶讀寫的最高許可權了嗎
《解決方案》

先把cache_mem 改改看,據說這個超過物理內存三分之一不穩定...如果你是8G內存的話可以設置3000M
qczl1224 發表於 2010-08-30 11:33 http://bbs.chinaunix.net/images/common/back.gif


      這個我倒是想過,但是我其它的伺服器內存設置的也是一樣啊,但是其它的基本沒出過這個問題呢?
《解決方案》

chmod -R 777 /usr/local/squid/var/

還有緩存目錄創建允許當前用戶讀寫的最高許可權了嗎
qczl1224 發表於 2010-08-30 11:37 http://bbs.chinaunix.net/images/common/back.gif


      這個我倒沒給最高許可權,我的許可權是755,所有者給了squid的賬戶,應該也沒問題吧。
《解決方案》

高手來啊,有遇到過這種問題的幫小弟提醒哈哪裡的問題啊~謝謝

[火星人 ] squid導致的硬碟只讀問題已經有672次圍觀

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