How much RAM do you have? Do you have swap? How big is your database?
This is the problem that you want to solve.