I have a development server that is having memory problems. There is little to no traffic on this server because it is a dev environment, but apache is spawning tons of processes and using up a lot of memory?

I have wordpress sites in development on this server, but they are all behind an http authentication layer, so I don't think it could be a brute force attack...

mysql is also using a lot of memory.

When I ran memstat, mysql was using 1,095,660K - this seems like a ton of memory for mysql


The rest was used up by a ton of apache processes with the path (/usr/lib/apache2/mpm-prefork/apache2).

I don't know why apache would be using so much memory when this is a dev server with very little traffic.

Any ideas why apache&mysql would be running so high on memory?


Your Apache configuration has a correspondent part in the config files where you can specify how many httpd processes are pre-spawned. This way even on a no-traffic website you can pre-spawn a specific amount of processes.

You may need to re-visit that part and lower the values. You can get more information here: http://httpd.apache.org/docs/2.2/mod/prefork.html

You can also check your Apache log files to make sure there is no attack on your server.

The same goes to MySQL. You may need to try another my.cnf file for smaller instance. MySQL comes with some presets, so you can try something like my-small.cnf or similar. You can also get some information on your memory about MySQL using mysqltuner script: http://mysqltuner.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.