The settings I choose was right, the problem was caused because I was
running out of RAM as soon as the number of visitors increased and that's
why whenever I restarted the server, the problem was gone.
So now I have increased my RAM from 512MB to 1GB, and never got any
error since then.