Try to reduce "vm.swappiness". Common default value is 60 which causes swap to be used quite frequently (once disk-cache and i/o-buffers inflate, os tries to keep them big). You can reduce it down to zero, then if some application needs more memory then currently available, cache/buffer size is first reduced to minimum before swap is touched.
Next good thing is to configure your applications so that they do not use too much memory. This especially is the case for apps like mysql (plenty of memory-related configuration options) but also apache. If performance is then not acceptable, use some known solutions (i.e. db-splitting, web-accelerator, etc.).
You could also try to optimize your OS, i.e. turn off all unnecessary services, disable per package not-needed compile optioins (i.e. disable support for perl/debug/selinux in mysql if you do not need it), re-compile kernel with only necessary drivers, reduce number of ttys running, etc.