www-data takes up 90% memory

Hello, I ran the following command:

ps axo %mem,comm,pid,euser | sort -nr | head -n 10

to check the top memory consuming processes.

I am always getting apache2 service by www-data user as the top memory consumers, there are close to 10 of these. The thing is even after restarting apache, these processes start showing up immediately.

I have just a Wordpress installation on the server and can confirm that it is not generating any such data files via php.

Can anyone please help - I am running out of RAM just by running one wordpress install :(

5 Replies

Are you? You probably aren't running out of RAM, although those processes are behaving normally. (PHP typically infects Apache with an on-the-fly interpreter.)

What does the output of "free -m" say?

Thanks for replying.

Here is the output of free -m:

total used free shared buffers cached

Mem: 487 440 46 0 8 135

-/+ buffers/cache: 297 190

Swap: 511 82 429

Also, I am regularly getting these Disk I/O alerts from Linode.

I'm assuming you're using Apache, mod_php, and mpm-prefork… what is your MaxClients set to in your Apache configuration?

MaxClients is set to 40. Earlier it was set to 10 but started getting this error meesage of "consider increasing maxclients" after which i set the number to 40.

My Apache processes still take up close to 70MB RAM each which means at this rate the server will be able to handle just ~6 apache processes. The sad thing is I am noticing traffic drop after moving to Linode now :(

What's KeepaliveTimeout set to? Should be maybe 5 seconds, tops. Also, mod_php is a horrible, terrible thing.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct