0

I have installed PHP as an Apache module. I have had prefork running all this while. I've read that worker would consume less memory while offer higher performance]1. So, I've edited /etc/sysconfig/httpd and uncommented:

HTTPD=/usr/sbin/httpd.worker

and restarted Apache.

However, when I run httpd -l, I still get the following:

core.c prefork.c http_core.c mod_so.c

which means prefork is still running but not worker, I suppose.

Now when I run top command, I gets httpd.worker under COMMAND column instead of just httpd.

My question is: are my current settings wrong and will them do harm to performance or memory consumption of my server?

I've seen people include Apache worker and PHP FastCGI in same tutorials so I assume that those 2 go hand in hand with each other. Should I configure PHP FastCGI to replace mod_php now?

I'm using Amazon EC2 by the way.

ericn
  • 543
  • 2
  • 8
  • 20

1 Answers1

1

On a RHEL derivative, httpd uses prefork and httpd.worker uses worker.

Changing the line in sysconfig changes which binary the service uses, but when you directly run the prefork binary you'll always see prefork as the live MPM (and running httpd.worker -l will give you expected results.

So, your config is working correctly.

I've seen people include Apache worker and PHP FastCGI in same tutorials so I assume that those 2 go hand in hand with each other. Should I configure PHP FastCGI to replace mod_php now?

In the default config of a RHEL derivative, the config will have automatically switched to the ZTS module for thread safety when you switched to worker. FastCGI isn't a requirement, but you can definitely set it up if that's your preferred deployment.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248