我正试图加快一个网站的速度,其中有许多图片是从一个单独的子域static.example.com (与www相同的IP )提供的。
使用pingdom注意到前5-6个请求(在static.example.com上)正在进行完全连接(DNS+SSL+Send+Wait+Receive+Connect)。
它与预叉配置有任何关系吗?
StartServers 20
MinSpareServers 20
MaxSpareServers 20
ServerLimit 150
MaxRequestWorkers 150
MaxConnectionsPerChild 10000
MaxRequestsPerChild 500这是一台4GB的机器,没有太多的流量。
Avg apache大小:
{print $6/1024;}{ avg += ($1-avg)/ NR;} {print avg“MB";}‘
11.2921 MB
MySQL大约500 MySQL
KeepAlive On,MaxKeepAliveRequests 100,KeepAliveTimeout 5
不知道怎么解决这个问题。切换到MPM事件模块有帮助吗?
发布于 2018-01-18 12:05:07
你应该转到活动上去,是的。
使用预叉,每个连接都需要一个进程。CPU方面,与新线程相比,生成进程成本最高,除非您在开始时就“预加载”它们。
但是,为了提供静态内容和规范,您可以使用事件mpm轻松地拥有httpd,并且可以轻松地允许1000个线程使用很少的进程。
举个例子:
StartServers 1
ServerLimit 5
MinSpareThreads 100
MaxSpareThreads 600
ThreadsPerChild 200
ThreadLimit 200
MaxRequestWorkers 10000
MaxConnectionsPerChild 10000000如果您因为被迫使用mod_php模块(比如线程安全的mod_proxy_fcgi模块)而使用预叉,请考虑迁移到mod_proxy_fcgi -> PHP。
https://serverfault.com/questions/892830
复制相似问题