Setting CentOS 5.5 up to cache the disk more heavily for wri

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
j0rd0n420
This is my homepage
This is my homepage
Posts: 157
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Mon Jul 07, 2008 1:47 pm

Setting CentOS 5.5 up to cache the disk more heavily for wri

Post by j0rd0n420 »

Thanks John.
User avatar
Edge100x
Founder
Founder
Posts: 12948
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Setting CentOS 5.5 up to cache the disk more heavily for

Post by Edge100x »

If you're seeing problems due to occasional large spikes in disk access and you still have free memory available, try telling Linux to cache more of those writes in memory before it forces them to be flushed to disk and stalls applications.

A high dirty_ratio will allow more memory to be used for the write cache, and a low dirty_background_ratio will ensure that it gets written to disk regularly in the background, so that it doesn't stack up:

Code: Select all

echo 80 > /proc/sys/vm/dirty_ratio
echo 5 > /proc/sys/vm/dirty_background_ratio
Note that if you are seeing constant decently high amounts of disk writes, these settings probably won't help, and may even hurt. The same is true if you have a read-heavy application; with lots of reads, it's good to keep the write cache small.
j0rd0n420
This is my homepage
This is my homepage
Posts: 157
Joined: Mon Jul 07, 2008 1:47 pm

Re: Setting CentOS 5.5 up to cache the disk more heavily for

Post by j0rd0n420 »

Do I just enter those into the terminal?
User avatar
Edge100x
Founder
Founder
Posts: 12948
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Setting CentOS 5.5 up to cache the disk more heavily for

Post by Edge100x »

Yes, that's correct.

Also, if you don't have much RAM free, they may not make a very big difference for you.
j0rd0n420
This is my homepage
This is my homepage
Posts: 157
Joined: Mon Jul 07, 2008 1:47 pm

Re: Setting CentOS 5.5 up to cache the disk more heavily for

Post by j0rd0n420 »

Hmmm...I'll prolly just keep it as is and upgrade my VPS next month.
Jesse
A semi-regular
A semi-regular
Posts: 15
Joined: Sun Nov 07, 2010 6:02 pm

Re: Setting CentOS 5.5 up to cache the disk more heavily for

Post by Jesse »

j0rd0n420 wrote:Hmmm...I'll prolly just keep it as is and upgrade my VPS next month.
You can upgrade it whenever, because its pro-rated. So whatever you already paid goes into the upgraded servers cost. NFo Ftw.
j0rd0n420
This is my homepage
This is my homepage
Posts: 157
Joined: Mon Jul 07, 2008 1:47 pm

Re: Setting CentOS 5.5 up to cache the disk more heavily for

Post by j0rd0n420 »

I didn't have the funds to do that till the beginning of the month though. :D
Post Reply