ตอนนี้โฮสของ networkthai.net เครื่อง 3 ออกอาการ MySQL เดี้ยงเกือบทั้งวัน บางครั้งติดต่อ MySQL ได้ บางครั้งไม่ได้ เป็นมาตั้งแต่ต้นๆเดือนกุมภาแล้ว เห็นบอกว่าเพราะเว็บโป๊ที่เอามาลง แล้วคนเข้ามาดูเยอะ เลยทำให้โฮสเกิดอาการเดี้ยงๆเป็นช่วงๆ เลยโดนลูกค้าต่อว่าทุกวัน จนตอนนี้ปิดเว็บบอร์ดของตัวเองหนีลูกค้าเป็นที่เรียบร้อยแล้ว :blink:
เลยทำให้สงสัยว่าการที่มีคนเข้าเว็บไปดูรูปภาพเยอะๆ จะเป็นสาเหตุที่ทำให้ MySQl ของโฮสเกิดอาการเดี้ยงได้ด้วยเหรอ ผมรู้สึกว่ามันไม่น่าจะเกี่ยวกันระหว่างการโหลดรูปภาพ กับ MySQL เลยหน่ะ… :huh:
ย้ำให้ชัดๆ ตามที่คุณ SiamInterHost แนะนำไว้นะครับ คือหากตั้งค่าแบบนี้ ถ้าเครื่องมี 1G และเปิด service อื่นด้วย เช่น web server, mail server ถ้ามี traffic หน่อย รับรองเดี้ยงครับ แต่ถ้าใช้แต่ MySQL ก็ไม่เป็นไร
Index blocks for MyISAM tables are buffered and are shared by all threads. key_buffer_size is the size of the buffer used for index blocks. The key buffer is also known as the key cache.
The maximum allowable setting for key_buffer_size is 4GB. The effective maximum size might be less, depending on your available physical RAM and per-process RAM limits imposed by your operating system or hardware platform.
Increase the value to get better index handling (for all reads and multiple writes) to as much as you can afford. Using a value that is 25% of total memory on a machine that mainly runs MySQL is quite common. However, if you make the value too large (for example, more than 50% of your total memory) your system might start to page and become extremely slow. MySQL relies on the operating system to perform filesystem caching for data reads, so you must leave some room for the filesystem cache. Consider also the memory requirements of other storage engines.
sort_buffer_size
Each thread that needs to do a sort allocates a buffer of this size. Increase this value for faster ORDER BY or GROUP BY operations.
read_buffer_size
Each thread that does a sequential scan allocates a buffer of this size (in bytes) for each table it scans. If you do many sequential scans, you might want to increase this value, which defaults to 131072.