Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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