performance difference between a swap partition vs a swap file >>>>>

I have done a lot of research, but I do not have any real world experience so I'm hoping you can help me understand the real world differences in performance. The research tells me that if you create a swap file on an empty disk and on a OS using kernel 2.6 then the performance differences are minor, but that the swap partition is a slight favorite in terms of pure performance. Our Scenario: Raid 1 146GB partition 33GB Swap File created on / (Note: the swap file was created when the OS was built, so the hard drives were not full and they were very empty) Kernel 2.6 Best Regards N

On Wed, Dec 2, 2009 at 6:53 AM, Narender <narender.hooda(a)gmail.com> wrote:
I have done a lot of research, but I do not have any real world experience so I'm hoping you can help me understand the real world differences in performance. The research tells me that if you create a swap file on an empty disk and on a OS using kernel 2.6 then the performance differences are minor, but that the swap partition is a slight favorite in terms of pure performance. Our Scenario:
Raid 1 146GB partition 33GB Swap File created on / (Note: the swap file was created when the OS was built, so the hard drives were not full and they were very empty) Kernel 2.6
Best Regards N
Could someone please guide me over this, which one is good. Best Regards N

Not sure what your trying to do. Adding lots of swap isn't going to help performance, swap is a bottleneck. Or are you benchmarking or something? John Narender wrote:
On Wed, Dec 2, 2009 at 6:53 AM, Narender <narender.hooda(a)gmail.com> wrote:
I have done a lot of research, but I do not have any real world experience so I'm hoping you can help me understand the real world differences in performance. The research tells me that if you create a swap file on an empty disk and on a OS using kernel 2.6 then the performance differences are minor, but that the swap partition is a slight favorite in terms of pure performance. Our Scenario:
Raid 1 146GB partition 33GB Swap File created on / (Note: the swap file was created when the OS was built, so the hard drives were not full and they were very empty) Kernel 2.6
Best Regards N
Could someone please guide me over this, which one is good.
Best Regards N _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

2009/12/2 Narender <narender.hooda(a)gmail.com>:
I have done a lot of research, but I do not have any real world experience so I'm hoping you can help me understand the real world differences in performance. The research tells me that if you create a swap file on an empty disk and on a OS using kernel 2.6 then the performance differences are minor, but that the swap partition is a slight favorite in terms of pure performance. Our Scenario:
Raid 1 146GB partition 33GB Swap File created on / (Note: the swap file was created when the OS was built, so the hard drives were not full and they were very empty) Kernel 2.6
If you have to ask this question then I would say 33G is likely far more than you need. As a general rule of thumb I advise 2* physical ram for anything up to 2G ram, and ram=swap for anything over 4G Also I think that the difference in performance between a swap partition and swap file is minimal, and the swap file has the advantage of being easily resized when you figure out that you don't actually need 33G. Also swap always wants to be on the fastest drive available. I suspect a swapfile on a RAID5 filesystem would be better than a swap partition on a single drive (though someone will no doubt correct me if I'm wrong) -- Disclaimer: By sending an email to any of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message.

On Wed, Dec 2, 2009 at 1:57 PM, Bruce Kingsbury <zcat(a)zcat.geek.nz> wrote:
2009/12/2 Narender <narender.hooda(a)gmail.com>:
I have done a lot of research, but I do not have any real world experience so I'm hoping you can help me understand the real world differences in performance. The research tells me that if you create a swap file on an empty disk and on a OS using kernel 2.6 then the performance differences are minor, but that the swap partition is a slight favorite in terms of pure performance. Our Scenario:
Raid 1 146GB partition 33GB Swap File created on / (Note: the swap file was created when the OS was built, so the hard drives were not full and they were very empty) Kernel 2.6
If you have to ask this question then I would say 33G is likely far more than you need. As a general rule of thumb I advise 2* physical ram for anything up to 2G ram, and ram=swap for anything over 4G
Also I think that the difference in performance between a swap partition and swap file is minimal, and the swap file has the advantage of being easily resized when you figure out that you don't actually need 33G.
Also swap always wants to be on the fastest drive available. I suspect a swapfile on a RAID5 filesystem would be better than a swap partition on a single drive (though someone will no doubt correct me if I'm wrong)
-- Disclaimer: By sending an email to any of my addresses you are agreeing that: 1. I am by definition, "the intended recipient" 2. All information in the email is mine to do with as I see fit and make such financial profit, political mileage, or good joke as it lends itself to. 3. I may take the contents as representing the views of your company. 4. This overrides any disclaimer or statement of confidentiality that may be included on your message. _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need. Best Regards N

On 3/Dec/2009, at 20:10 , Gible Fog wrote:
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need.
16GB? almost certainly none at all.
If you using suspend to disk mode, I was on the understanding that the swap space would be used to store a copy of the RAM for when the machine was powered down.

On Thu, Dec 3, 2009 at 12:56 PM, Warren Boyd <wazza(a)clear.net.nz> wrote:
On 3/Dec/2009, at 20:10 , Gible Fog wrote:
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need.
16GB? almost certainly none at all.
If you using suspend to disk mode, I was on the understanding that the swap space would be used to store a copy of the RAM for when the machine was powered down.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
I am going to use this server as data base indexing. that was the reason for this much RAM. Best Regards N

Hi, According to http://www.cyberciti.biz/tips/linux-swap-space.html 0.5 times your ram size might be a good idea for a database server. Bear in mind that if you use suspend to disk your swap needs to be at least the same size as your RAM. Hope my reply and the link help you a bit. Kind regards, Andreas On 3/12/2009, at 8:33 PM, Narender wrote:
On Thu, Dec 3, 2009 at 12:56 PM, Warren Boyd <wazza(a)clear.net.nz> wrote:
On 3/Dec/2009, at 20:10 , Gible Fog wrote:
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need.
16GB? almost certainly none at all.
If you using suspend to disk mode, I was on the understanding that the swap space would be used to store a copy of the RAM for when the machine was powered down.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
I am going to use this server as data base indexing. that was the reason for this much RAM.
Best Regards N _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

On Thu, Dec 3, 2009 at 1:05 PM, Andreas Löf <andreas(a)alternating.net> wrote:
Hi,
According to http://www.cyberciti.biz/tips/linux-swap-space.html 0.5 times your ram size might be a good idea for a database server.
Bear in mind that if you use suspend to disk your swap needs to be at least the same size as your RAM.
Hope my reply and the link help you a bit.
Kind regards,
Andreas
On 3/12/2009, at 8:33 PM, Narender wrote:
Thanks, it has cleared max doubts now. --N

On Thu, Dec 3, 2009 at 8:26 PM, Warren Boyd <wazza(a)clear.net.nz> wrote:
On 3/Dec/2009, at 20:10 , Gible Fog wrote:
My System have 16 GB Physical RAM. Now could you please advise how
much swap space do i need.
16GB? almost certainly none at all.
If you using suspend to disk mode, I was on the understanding that the swap space would be used to store a copy of the RAM for when the machine was powered down.
This could be true, but begs the question: what happens when you're using the whole swap capacity and power down(sleep/standby/other foreign labels)? READ CAREFULLY. By reading this email, you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

On Thu, Dec 3, 2009 at 8:26 PM, Warren Boyd <wazza(a)clear.net.nz> wrote: On 3/Dec/2009, at 20:10 , Gible Fog wrote:
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need.
16GB? almost certainly none at all.
If you using suspend to disk mode, I was on the understanding that the swap space would be used to store a copy of the RAM for when the machine was powered down.
This could be true, but begs the question: what happens when you're using the whole swap capacity and power down(sleep/standby/other foreign labels)?
That was part of the reasoning behind allocating 1.5 time to 2 times the amount of physical RAM. (From memory in other *nix systems SWAP space was also used as a place to dump the contents of memory for analysis before restarting) Of course - this still doesn't answer the question about what happens when you use all of it - which will only occur if you perform suspend to disk - sleep / standby keeps power supplied to the memory with the contents kept in RAM - if you are running a system with suspend to disk and using all the RAM and all the swap capacity, the operating system should warn / disallow the feature. Having said that, I suspect that a machine that is using all the RAM and all the swap is going to have performance issues...

On Thu, Dec 3, 2009 at 12:40 PM, Gible Fog <gible(a)gible.net> wrote:
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need.
16GB? almost certainly none at all.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

On Thu, Dec 3, 2009 at 12:40 PM, Gible Fog <gible(a)gible.net> wrote:
My System have 16 GB Physical RAM. Now could you please advise how much swap space do i need.
16GB? almost certainly none at all.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
>> 16GB? almost certainly none at all.
is this means that i do not need swap space at all. please help me to understand. Best regards N
participants (6)
-
Andreas Löf
-
Bruce Kingsbury
-
Gible Fog
-
John Billings
-
Narender
-
Warren Boyd