欢迎您: 游客   等级: 游客 | 注册 | 登陆 |
发 贴
请选择需要发布主题的板块
用户名 密码
欢迎新会员: briantim  
查看
27780
回复
1
jstruggle
级别超级管理员
精华0
积分100
财富100 jstruggle币
发帖数72
注册2009-8-20
状态 我暂时不在线
发表于2009-11-20 16:31 楼主
APACHE优化
apache
    今天废了好半天的劲才终于在http://www.javatang.com/这个网站找到下面这篇文章,算是解决了配置apache并发连接数的问题了吧,不容易啊,真是应了一句话就是“功夫不负有心人”哦!

    一般来说,WinNT系统下使用IIS,而Apache在Linux下应用的比较多,但是依然有很多人在WinNT系统下使用Apache而非IIS,可能是基于对Windows系统的熟悉吧。今天就来说一下在Windows系统下如果优化Apache的性能。

mpm_winnt.c是专门针对Windows NT优化的MPM(多路处理模块),它使用一个单独的父进程产生一个单独的子进程,在这个子进程中轮流产生多个线程来处理请求。也就是说mpm_winnt只能启动父子两个进程, 不能像Linux下那样同时启动多个进程。

mpm_winnt主要通过ThreadsPerChild和MaxRequestsPerChild两个参数来优化Apache,下面详细来说明一下。

ThreadsPerChild
这个参数用于设置每个进程的线程数, 子进程在启动时建立这些线程后就不再建立新的线程了. 一方面因为mpm_winnt不能启动多个进程, 所以这个数值要足够大,以便可以处理可能的请求高峰; 另一方面该参数以服务器的响应速度为准的, 数目太大的反而会变慢。因此需要综合均衡一个合理的数值。

mpm_winnt上的默认值是64, 最大值是1920. 这里建议设置为100-500之间,服务器性能高的话值大一些,反之值小一些。

MaxRequestsPerChild
该参数表示每个子进程能够处理的最大请求数, 即同时间内子进程数目.设置为零表示不限制, mpm_winnt上的默认值就是0.

官方参考手册中不建议设置为0, 主要基于两点考虑: (1) 可以防止(偶然的)内存泄漏无限进行,从而耗尽内存; (2) 给进程一个有限寿命,从而有助于当服务器负载减轻的时候减少活动进程的数量。

因此这个参数的值更大程度上取决于服务器的内存,如果内存比较大的话可以设置为0或很大的数字,否则设置一个小的数值。需要说明的是,如果这个值设置的太小的话会造成Apache频繁重启,在日志文件中会看到如下的文字:

Process exiting because it reached MaxRequestsPerChild. Signaling the parent

这样一来降低了Apache的总体性能。

另外,可以通过查看Apache提供的server-status(状态报告)来验证当前所设置数值是否合理,在httpd.conf文件中做如下设置来打开它:

  1. # 首先需要加载mod_status模块
  2. LoadModule status_module modules/mod_status.so
  3.  
  4. # 然后设置访问的地址
  5. <Location /server-status>
  6.     SetHandler server-status
  7.     Order deny,allow
  8.     Deny from all
  9.     # 如果限制某个IP访问则设置为 Allow from 192.168.1.1
  10.     Allow from all
  11. </Location>

综合来说,因为Windows NT下Apache只能启动父子两个进程,因此只能通过增大单个进程的线程数以及单个进程能够处理的最大请求数来进行优化。其他优化的参数同Linux系统下是一样的,大家可以加以参考。下面针对上述两个参数给出一个建议的设置:

  1. <IfModule mpm_winnt.c>
  2.   ThreadsPerChild 250
  3.   MaxRequestsPerChild 5000
  4. </IfModule>

Apache2.2中文参考手册网址:

http://www.phpchina.com/manual/apache/index.html

Apache+tomcat+jdk+jk安装配置(比较简单)
http://bbs.chinaunix.net/archiver/tid-447464.html

最好的apache配置教程:

http://www.shineblog.com/user5/net-work/archives/2006/661245.shtml


 

今天还把有关让jsp引擎解析后缀名不是.jsp文件的方法给攻克了,那就是在web.xml文件里进行一个映射,就像在struts里映射*.do文件一样。

 

# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf

在httpd.conf文件里,可以导入不同的配置文件。

 

另外,为了提高性能我把所有应用的日志都给关了。

WWW.8ISP.CN 为您提供专业的JSP虚拟主机!

分享  
20170808caihuali
级别新手上路
精华0
积分1
财富0 jstruggle币
发帖数0
注册2017-8-8
状态 我暂时不在线
发表于2017-8-8 09:14    1
20170808caihuali

ray-ban sunglasses

adidas outlet store

lebron james shoes

asics

marc jacobs outlet

ed hardy clothing

pandora jewelry

michael kors outlet

nike shoes

soccer shoes

cheap jordans

michael kors outlet

links of london

canada goose jackets

oakley sunglasses

mulberry outlet store

nike shoes

michael kors

true religion jeans

ugg boots

ugg outlet

nike air max

soccer jerseys

cheap jordans

longchamp bags

oakley sunglasses

ralph lauren uk

swarovski crystal

longchamp handbags

cheap nba jerseys

michael kors outlet

cheap oakley sunglasses

cheap ray bans

ray ban sunglasses

ray bans

oakley sunglasses

longchamp outlet

oakley sunglasses

michael kors outlet online

cheap jordans

kate spade outlet

tory burch outlet

pandora charms

ray ban sunglasses

christian louboutin outlet

coach outlet

canada goose jackets

oakley sunglasses

nba jerseys

michael kors outlet

ugg boots clearance,ugg boots,ugg boots outlet,ugg boots for women,ugg boots on sale,ugg boots for men,ugg boots for kids,ugg boots clearance sale women,ugg boots clearance outlet

michael kors outlet

polo outlet

michael kors factory outlet

michael kors outlet

fitflops shoes

true religion outlet

nike free 5

ugg boots

coach factory outlet

ugg boots

ralph lauren polo

birkenstock outlet

michael kors

cheap snapbacks

christian louboutin uk

coach outlet

longchamp bags

michael kors wallets

oakley sunglasses

uggs outlet

coach outlet online

ralph lauren outlet

ray ban sunglasses

ray ban sunglasses

nike huarache

ray ban sunglasses

nike huarache

longchamp outlet

Basketball Shoes

coach outlet store online

nike store

nike roshe one

oakley sunglasses

air max uk

oakley sunglasses

kate spade outlet

puma outlet

michael kors outlet

prada handbags

oakley sunglasses wholesale

tory burch outlet

nfl jerseys wholesale

true religion jeans

coach outlet online

basketball shoes

ugg outlet

ugg boots,ugg boots outlet,cheap uggs boots,ugg boots for women,ugg boots on sale,ugg boots clearance,ugg boots clearance sale women,ugg boots clearance outlet,ugg boots for men,ugg boots for kids

coach outlet

ugg outlet

chrome hearts

christian louboutin outlet

oakley sunglasses

polo shirts

ralph lauren polo

michael kors

canada goose outlet

ray ban sunglasses

michael kors outlet

pandora jewelry

oakley sunglasses

polo ralph lauren

nike trainers

cheap mlb jerseys

hermes outlet

kate spade handbags

Nike Free shoes

mcm outlet

canada goose outlet

michael kors handbags

mulberry handbags

canada goose jackets

air max 90

michael kors outlet

oakley sunglasses

michael kors outlet online

swarovski outlet

ferragamo shoes

polo outlet

fitflops shoes

nike roshe

ferragamo shoes

coach outlet

christian louboutin shoes

coach outlet online

nike air max

canada goose jackets

pandora outlet

bottega veneta outlet

nike air force 1

coach outlet

tory burch outlet

tory burch outlet

canada goose outlet

polo ralph lauren

hermes belt

longchamp handbags

adidas nmd runner

adidas uk

true religion jeans

fred perry polo shirts

oakley sunglasses

ugg outlet

fitflops sale clearance

coach outlet online

nfl jersey wholesale

vans shoes

ray ban sunglasses

true religion jeans

ugg outlet,ugg outlet sale,uggs outlet,ugg outlet online clearance,ugg outlet store,ugg outlet coupons,ugg outlet boots,ugg outlet online store

cheap nfl jerseys

ralph lauren pas cher

mbt shoes

canada goose outlet

ugg outlet,ugg outlet store,uggs outlet,ugg outlet online clearance,ugg outlet coupons,ugg outlet boots,ugg outlet online store,ugg outlet sale

michael kors outlet online

polo ralph lauren

nike foamposite

pandora jewelry

lacoste polo shirts

adidas shoes

michael kors handbags

mulberry sale

ray ban sunglasses

michael kors outlet

christian louboutin outlet

polo ralph lauren

hermes birkin

mulberry outlet

swarovski outlet

coach outlet online

ugg outlet

adidas outlet

mulberry bags

air max 90

coach outlet

ralph lauren polo

christian louboutin outlet

coach outlet

adidas shoes

pandora charms

montblanc pens

canada goose outlet

ralph lauren outlet

cartier outlet

ysl outlet

ugg boots,ugg boots outlet,ugg boots for women,ugg boots on sale,ugg boots clearance,ugg boots for men,ugg boots for kids,ugg boots clearance sale women,ugg boots clearance outlet

cheap jerseys wholesale

coach outlet online

cazal sunglasses

polo outlet

michael kors outlet

canada goose outlet

polo ralph lauren

michael kors outlet

michael kors outlet

kate spade outlet

air max 90

michael kors outlet clearance

christian louboutin outlet

air max 1

canada goose

burberry outlet

swarovski crystal

ray ban sunglasses

mac cosmetics

ugg boots for women,ugg boots,ugg boots outlet,ugg boots on sale,ugg boots clearance,ugg boots for men,ugg boots for kids,ugg boots clearance sale women,ugg boots clearance outlet

fitflops sale clearance

true religion outlet

ralph lauren sale

cheap nfl jerseys

ralph lauren uk

oakley sunglasses

coach outlet

ugg boots

cheap nhl jerseys

nike blazer pas cher

canada goose outlet

herve leger outlet

coach factory outlet

mulberry bags

oakley sunglasses

nike store uk

swarovski crystal

mbt shoes outlet

pandora jewelry

yeezy boost 350

true religion jeans

chrome hearts outlet

michael kors outlet

coach outlet

lacoste soldes

michael kors outlet

new balance shoes

adidas trainers

coach factory outlet

coach outlet

ray ban sunglasses

uggs outlet

ugg outlet

ferragamo outlet

michael kors

nike roshe run

polo ralph lauren

coach outlet online

air jordan 4

fitflops outlet

nike air max

coach outlet online

ray ban sunglasses

polo outlet

pandora outlet

coach outlet canada

true religion jeans

ralph lauren polo

coach outlet online

oakley sunglasses

prada sunglasses

coach outlet clearance

football shirts

oakley sunglasses wholesale

los angeles lakers jerseys

coach factory outlet

ray ban sunglasses

ugg boots

oakley sunglasses

kobe bryant shoes

ugg outlet

swarovski crystal

cheap jordan shoes

tory burch outlet

ferragamo outlet

ugg boots

coach outlet

fitflops sale

ray bans

kevin durant shoes

prada outlet

air max 90

nfl jersey wholesale

michael kors outlet online

polo outlet

fitflops

cleveland cavaliers jersey

ray ban sunglasses

michael kors outlet

polo ralph lauren

ugg outlet,ugg outlet clearance,uggs outlet,ugg outlet online clearance,ugg outlet store,ugg outlet online store,ugg outlet sale,ugg outlet coupons,ugg outlet boots

ray ban sunglasses

cheap snapbacks

soccer jerseys

canada goose outlet

thomas sabo

oakley sunglasses

tory burch shoes

true religion jeans

coach outlet online

canada goose outlet

kate spade handbags

nike shoes

ferragamo outlet

air max uk

michael kors handbags

coach outlet online

michael kors

mbt shoes

ugg outlet clearance,ugg outlet online clearance,ugg outlet,uggs outlet,ugg outlet store,ugg outlet coupons,ugg outlet boots,ugg outlet online store,ugg outlet sale

jordan shoes

christian louboutin online

oakley sunglasses

ray ban sunglasses

longchamp outlet

ferragamo shoes

yeezy boost

oakley sunglasses

adidas nmd

nike trainers

polo ralph lauren

michael kors outlet clearance

michael kors handbags

michael kors outlet

michael kors handbags

oakley sunglasses wholesale

christian louboutin shoes

fitflops

mulberry handbags

futbol baratas

canada goose jackets

polo outlet

michael kors handbags

reebok outlet store

coach handbags

ecco shoes

reebok trainers

hermes bags

nike outlet store

salomon shoes

mulberry handbags

christian louboutin outlet

mulberry handbags

adidas shoes

burberry outlet

michael kors outlet

cheap uggs outlet,cheap uggs for sale,cheap ugg boots,cheap uggs for kids,cheap uggs for women,cheap uggs bailey bow,cheap uggs china,cheap uggs for men,cheap uggs for girls,cheap uggs boots for women

cheap jordans

burberry outlet

ralph lauren polo shirts

converse shoes

ugg outlet

kobe shoes

nike air max 2015

true religion jeans

true religion outlet

coach outlet

fitflops sale clearance

mlb jerseys wholesale

true religion jeans

burberry outlet

tods outlet

jordan shoes

birkenstock sandals

supra shoes

mont blanc pens

cheap jordans

coach factory outlet

ferragamo shoes

longchamp handbags

jordan shoes

oakley sunglasses

prada shoes

nike outlet store

coach outlet

adidas wings

lebron james shoes

canada goose outlet

nike air max

michael kors bags

valentino outlet

michael kors handbags

nike outlet

canada goose outlet

nike shoes

true religion jeans

ugg outlet,uggs outlet,ugg outlet online clearance,ugg outlet store,ugg outlet coupons,ugg outlet boots,ugg outlet online store,ugg outlet sale

kobe 9

ugg outlet

true religion uk

coach outlet online

giuseppe zanotti outlet

ralph lauren polo

20170808caihuali

qqqqq
JStruggle BBS

Powered by Jstruggle! 1.8 © 2006-2009

Processed in 0.016s JStruggle BBS Surprise!

粤ICP备05106211号 - 皖ICP备06010590号

copyright©JStruggle工作室版权所有 - 联系我们