The commonly accepted formula for estimating max_connections is to take the number of processor cores, multiply them by 2, and add disk spindles. With the relatively recent improvement of virtual cores, contributing factors such as SSD or other high-performance storage, we have a bit more freedom than before. In addition to this, even if we were to follow this estimation method, allowing a few extra connections can prevent highly visible connection rejections. Slightly lower performance is a small price to pay for availability.
The advice for shared_buffers is likely to be different from the accepted practice of simply setting it to a quarter of the available RAM. This is only really safe advice to follow for servers with ...