This is actually from RHEL admin guide but should be appropriate for CentOS as well:
Table 6.1. Recommended System Swap Space Amount of RAM in the SystemRecommended Amount of Swap Space4GB of RAM or lessa minimum of 2GB of swap space4GB to 16GB of RAMa minimum of 4GB of swap space16GB to 64GB of RAMa minimum of 8GB of swap space64GB to 256GB of RAMa minimum of 16GB of swap space256GB to 512GB of RAMa minimum of 32GB of swap space