Wednesday, July 18, 2007

Ways to optimize paging files

Just read an interesting article from Microsoft on how to optimize your paging file such that it will perform most optimally. The paging file is what the system will use once you run out of real physical memory. Nowadays, it's getting easier and easier to run out of memory. Even every internet browser that you open will eat up more memory.

This is what's recommended from Microsoft:
  • Move your paging file to a different partition in a different harddisk. This is such that the read and write requests can be done in parallel and there won't be "competition" between reading of system files, and reading of the paging file.
  • It is better to keep the paging file in a partition that is created solely for the paging file. This is again so that there will not be competition of resources, and there will not be any fragmentation.
  • By algorithm, Microsoft Windows will use the paging file from the partition that is least frequently accessed. Therefore, it is possible that you can have 2 paging files, 1 on the same partition as the main operating system files, and another on a separate partition in a separate harddisk. It will by default use the paging file on the separate harddisk.

Personally for me, I used another additional method which is to "span" my paging file.
For example, I create a paging file 1GB. I have 3 partitions, Drive C, D, E. I will put the paging file as follows:
  • Drive C: 1GB paging file
  • Drive D: 1GB paging file
  • Drive E: 1GB paging file
By doing this, my overall paging file will be 1GB, according to the article I read. Reason is that the paging file is spanned across 3 partitions, therefore increasing the speed of access of your paging file.

I've used the above, but I was not able to see if there's any differences in speed. I try not to use the swap file as much as possible. :)

Hope this is helpful...

Update: I've disabled my "spanning" swap and I did see a noticeable difference in performance. Do spanning if you can afford it.


2 comments:

Anonymous said...

I don't have paging file on C drive where WinXP is. I set one 2GB partition on another physical harddisk (different from C drive harddisk) and use it solely for a 2GB paging file. I don't know if this speeds things up, didn't measure.

I also set the min and max size of paging file to be the same, so that it won't shrink/grow and compete space with other files. I think this is helpful if the paging file is sharing partition with other files.

chantc said...

Hi choozm,

Personally for me, I don't like big paging files. I do not follow the 1.5x rule. Instead, I go the other way which is that the more memory I have, the smaller my paging file is. :) I tried before with 0 paging file. Shiok...

Like you, I do set the minimum and maximum, but that's because I do not have a separate partition just for it. :)

According to the Microsoft website, it is advisable to have the paging file in "C Drive" for debugging purposes. Meaning, there will be a "core dump" if you have the paging file in "C Drive".

Visit Rhinestic's Knick Knacks @ Etsy for handmade goods and supplies!

Related Posts Plugin for WordPress, Blogger...