1. configue max. processes (optimize lighttpd or apache)
2. optimize your php script and mysql indexes (don't use UNION and similar mysql commands which makes a temp and loads the memoryload skyhigh)
3. disable all plugins / addons / features which you don't need
4.think of a way to code your php script different, more small databases, instead of one big.
5. if none of this helps, buy a better server. simple as that.