ezylinux
ลินุกซ์ง่ายนิดเดียว

13
Jun

ถ้า squid คุณเกิดปัญหาหรือ error message ขึ้นว่า WARNING! Your cache is running out of filedescriptors ในไฟล์ cache.log แสดงว่า Squid version ที่ใช้อยู่ได้ compile ให้ไฟล์ file descriptors ให้สามารถใช้ได้มากสุด 1024 ซึ่งปัญหานี้เราไม่สามารถแก้ไขด้วยวิธีการใช้ ulimit ได้โดยตรง

ใน Squid ที่ support จะมี option max_filedesc เพิ่มขึ้นมาเพื่อใช้ในกาีรแก้ไขปัญหานี้

Linux ที่ support (ตอนนี้ทราบแต่ทาง Red Hat)

Red Hat Enterprise Linux 3: squid-2.5.STABLE3-6.3E.18
Red Hat Enterprise Linux 4: squid-2.5.STABLE14-1.4E
Red Hat Enterprise Linux 5

ส่วนวิธีการแก้ไขนั้นเราสามารถทำได้ตามขั้นตอนข้างล่างนี้ได้เลยครับ

1. แก้ไขไฟล์ /etc/security/limits.conf โดยให้เพิ่มข้อความด้านล่างเข้าไปในไฟล์

* – nofile 4096

2. ทำการ re-login (กด Ctrl-D ก็ได้ครับ) เข้าสู่ระบบให้เพื่อให้ทำการโหลด Config ค่าที่ได้แก้ไขไปเมื่อกี้ จากนั้นให้พิมพ์เพื่อทำการตรวจสอบว่าค่าที่ได้แก้ไขถูกโหลดขึ้นมาแล้ว

# ulimit -a
open files (-n) 4096

3. แก้ไขไฟล์ /etc/squid/squid.conf แล้วเพิ่มค่าด้านล่างเข้าไป

max_filedesc 4096

ค่าที่ได้แก้ไขควรที่จะมี่าเท่ากับค่าที่แก้ไขในไฟล์ /etc/security/limits.conf ในข้อที่ 1.

4. ทำการ Restart squid service:

# service squid restart

5. พิมพ์ squidclient เพื่อตรวจสอบว่า squid ได้โหลดคอนฟิกเป็นที่เรียบร้อยแล้วดังคำสั่งด้านล่าง

# squidclient mgr:info

File descriptor usage for squid:
Maximum number of file descriptors: 4096

Related posts:

  1. Get Squid Performance Statistic from command line เมื่อต้องการทราบรายละเอียดการทำงานของ Squid เราสามารถใช้คำสั่ง squidclient เพื่อใช้ในการขอดูข้อมูลต่างๆ ใน Squid * Squid คือ โปรแกรมที่ทำหน้่่าที่เป็น proxy server ในระบบปฏิบัติการ linux หรือ Unix * squidclient...
  2. Transparent proxy in squid 2.6 การเซ็ต transparent proxy ใน squid 2.6 จะใส่แค่ค่า http_port 8080 transparent แทน (version เก่า) http_port 8080 httpd_accel_host virtual httpd_accel_port 80...
  3. Enable Core Dumps for Daemons or Services in Red Hat Enterprise Linux โดยทั่วไปแล้ว daemon เป็นการทำงานในรูปแบบ background process การสั่งให้ deamond ทำงานสามารถทำได้โดยใช้ service command หรือ ใช้ init script การเปิดใช้งาน core dump (ดูรายละเอียดของ core...
  4. Create filesystems greater than 2 Terabytes ใน RHEL 5 สามารถรองรับ file system ได้ถึง 8 TB และจะยังสามารถรองรับ file system ได้มากถึง 16 TB ในอนาคต แต่เมื่อทำการสร้าง file system...
  5. Find Out Which RPM Installed a Specific File by rpm or yum Command การตรวจสอบว่าไฟล์หรือคำสั่งต่างๆมาจาก package ไหนบ้าง สามารถทำได้ไม่ยาก โดยจะใช้คำสั่ง rpm หรือ yum ก็ได้ แต่ถ้าใช้ yum จะมีข้อจำกัดเรื่องการติดต่อกับ service ที่ให้บริการ repo data ถ้าไม่สามารถติดต่อได้และไม่มี cache อยู่ในระบบ...

Category : Squid

Sorry, the comment form is closed at this time.