CentOS6 APACHE2 2工作模式

2021-10-19 06:08:53 字數 1912 閱讀 4093

vim /etc/httpd/conf/httpd.conf
prefork:多程序i/o模型.乙個主程序生成多個子程序,每個子程序響應乙個請求

# prefork mpm

# startservers: number of server processes to start

# minspareservers: minimum number of server processes which are kept spare

# maxspareservers: maximum number of server processes which are kept spare

# serverlimit: maximum value for maxclients for the lifetime of the server

# maxclients: maximum number of server processes allowed to start

# maxrequestsperchild: maximum number of requests a server process serves

startservers 8 #服務啟動時開啟的程序數

minspareservers 5 #最少空閒程序數

maxspareservers 20 #最大空閒程序數

serverlimit 256 #子程序最大值

maxclients 256 #最大的請求數

maxrequestsperchild 4000 #子程序能處理的最大請求數量,在處理完maxrequestsperchild個請求後,子程序就會被父程序終止,然後重新生成子程序.0表示不做限制

worker:復用的多程序i/o模型.多程序多執行緒.乙個主程序,生成m個子程序,每個子程序生成n個執行緒,每個執行緒響應乙個請求,併發響應請求:m*n

# worker mpm

# startservers: initial number of server processes to start

# maxclients: maximum number of simultaneous client connections

# minsparethreads: minimum number of worker threads which are kept spare

# maxsparethreads: maximum number of worker threads which are kept spare

# threadsperchild: constant number of worker threads in each server process

# maxrequestsperchild: maximum number of requests a server process serves

startservers 4 #伺服器啟動時啟動的程序數,不包括主控程序

maxclients 300 #伺服器啟動的最大執行緒數

minsparethreads 25 #最小空閒執行緒數

maxsparethreads 75 #最大空閒程序數

threadsperchild 25 #每個程序能啟動的執行緒數

maxrequestsperchild 6000 #子程序能處理的最大請求數量,在處理完maxrequestsperchild個請求後,子程序就會被父程序終止,然後重新生成子程序.0表示不做限制

執行相關命令即可

centos7安裝apache2 2總結

centos7環境下安裝apache2.2總結如下 tar zxvf apache2.2.29.tar.gz c usr local 2.配置apache2.2,並安裝 編繹並安裝apr 進入apr目錄 cd usr local apache2.2.29 cd srclib apr編繹安裝 apr ...

CentOS 6 3安裝配置Apache2 2 6

安裝位置 urs local apache 安裝apache 將httpd 2.4.3.tar.gz上傳到 usr local中,執行以下操作 root localhost local cd usr local root localhost local tar zxv f httpd 2.4.3.t...

Apache2 2與Tomcat6的簡單整合

我在安裝配置好apache,php,mysql以架設wordpress之前,其實我的計算機上早就有mysql和tomcat了。這些是為j2ee開發用的,而且我在配置apache和php的時候就順便把apache和tomcat的整合搞定了,現在就來講一講。其實apache和tomcat的整合就是解決請...