Originally Posted by ac_kumar
What is more good for system speed swap= ram or swap= 2 times of ram ?
The swap size needs to be what it needs to be and does not affect system speed. The old guidelines of swap having to be so many times RAM are so rough as to be useless. One of the best ways to determine what you need is to configure swap to file instead of partition and then load your system to the max and see how big the file is -- then set up the swap space a little bigger to be safe. Given the huge size of current HDDs compared with memory you can afford to be generous.
Given the low cost of memory now and the resulting large amounts of memory installed, many systems never swap. In that case there is no need to have any swap -- but not having swap when you need it is very messy and, as above, you probably have plenty of HDD space to spare so why not?
If you plan to use hibernate then the swap must normally be around the same size as the RAM. "Around" because it is compressed and the compression factor cannot be predicted. Assuming the worst case of all RAM in use and compression not reducing the size (very pessimistic) then the swap needs to be a little bigger than the RAM. If the system is using swap when you hibernate then even that will not work and you need a dedicated swap space for hibernating. Exactly what happens when hibernating is not well documented so what I have said is guidelines.