Php running twice (two processes), one of which under root

June 5, 2015 856 views
Linux Basics System Tools PHP

Hey there,

First off, I am a newbie but am putting a lot of heart at searching/learning/understanding. The DO Community has been a tremendous help so far :)
Here's a problem I can't solve because I'm not sure where to start.

While reviewing the running processes on my droplet (Ubuntu), I noticed that two instances of php5-fpm are running, one under my expected www-data user, one under root.

First, I'd like to understand why this root instance is here. Second, although it's eating up a tiny amount of memory, it's still significant on my 512MB droplet.

My questions:

  • is it normal, expected or usual?
  • what steps can I take to identify what launches the extra php5, if it's not desirable?


3 Answers

Welcome to DigitalOcean,

here are some basics of Linux (Ubuntu) :

Everything with PHP sounds normal, some stuff needs to be run as root.

MySQL has a high RAM usage and 512MB are enough for the beginning.

Hi eldin,

Thank you for taking the time to answer and providing me with this link. The shortcuts section will be particularly useful, I really appreciate.

I'll dig in deeper about this, I get why there's a php5 process running as www-data because I asked for it and configured it to be like this.

I'm more annoyed about the other process that comes out of the blue and am looking at understanding why it's there (triggered by a cron, spawned by nginx, whatever).

Knowledge about this will come in its time, I guess :) Thanks again!

@Sylvain2008 some parts of PHP need to be run as root to work properly without these permission PHP would not work, e.g. a connection between PHP and Nginx (to explain it in the easiest way).

I have 3 PHP processes :-).

And thank you, it is my pleasure to help.

PS: You can use Linux Dash, it is really good :

Have another answer? Share your knowledge.