Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running CentOS 64 bit, and jsut found out I am running prefork MPM on my dual quad xeon. I was told worker will give me lower memory usage, and higher performance, since I run a very high traffic website.

If this is true, how do I do it?

Thank you

share|improve this question
up vote 18 down vote accepted

Edit: /etc/sysconfig/httpd

Uncomment:

HTTPD=/usr/sbin/httpd.worker

Restart, voila!

share|improve this answer
    
Hi @RafiqManiar, by restart do you mean Apache or the whole server here? – eric Feb 25 '13 at 5:04
3  
Restart apache. sudo service httpd restart – Rafiq Maniar Feb 25 '13 at 8:31
    
CentOS 7. i am getting this: /usr/sbin/apachectl: line 137: /usr/sbin/httpd.worker: No such file or directory – YumYumYum Jun 12 '15 at 8:26

Edited: /etc/sysconfig/httpd

And uncommented:

HTTPD=/usr/sbin/httpd.worker

After restarting httpd (service httpd restart) I get the following error:

Stopping httpd:                                            [  OK  ]
Starting httpd: httpd.worker: Syntax error on line 222 of /etc/httpd/conf/httpd.conf: Syntax error on line 9 of /etc/httpd/conf.d/php.conf: Cannot load /etc/httpd/modules/libphp5-zts.so into server: /etc/httpd/modules/libphp5-zts.so: cannot open shared object file: No such file or directory
                                                           [FAILED]

You might need to install php-zts though.

yum install php-zts

After that no more error messages and httpd is starting normally with module worker active.

share|improve this answer

CentOS 6x:

modify file: /etc/sysconfig/httpd

HTTPD=/usr/sbin/httpd.worker

CentOS 7x:

$ cat /etc/httpd/conf.modules.d/00-mpm.conf

    #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    LoadModule mpm_worker_module modules/mod_mpm_worker.so
    #LoadModule mpm_event_module modules/mod_mpm_event.so

Restart

share|improve this answer

-- Redhat Enterprise Linux 6

php-zts in RHEL is found in the "optional" repository:

# subscription-manager repos --enable rhel-6-server-optional-rpms
Repository 'rhel-6-server-optional-rpms' is enabled for this system.
# yum install php-zts
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.