RadarURL

조회 수 5962 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

질문 :

Hi, our servers are running mediawiki and at certain times of the day it's taking 100% of the cpu load with only 12req/s according to mod_status.
Do you guys have any idea what's causing this?

Here's the server specs:
Windows 2003 Server SP1
Apache 2.0.58 (using apache2handler for php)
PHP 5.2.6

Xeon 5110 1.6hz CPU
4Gigs of ram


Any help would be greatly appreciated!Thanks in advance!

 

답변 :

Often some PHP extensions causes such a CPU load. Try to disable all not needed PHP extensions in your php.ini
You also can try to run PHP over fcgid and separate PHP from the httpd processes.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Hello all. I am having a similar issue. It has plagued me since I started using Apache pretty much.

Dual 2.4 ghz/4gb/Win2k3 sp1. I had been using 5.2.6 php, Apache2.2.9, but recently upgraded to PHP version 5.2.8 and Apache 2.2.11. MySQL runs on another machine entirely.

Problem: httpd.exe grows at an astonishing rate. It grows to ~550 megs in about 6 minutes under small load, and in about 2 minutes under heavy load. At about the mid 500-600 meg memory usage, Apache restarts. At the time of restart, I still have over 1.5 gb of free memory.

Code:
[Tue Jan 27 04:23:39 2009] [notice] Apache/2.2.11 (Win32) configured -- resuming normal operations
[Tue Jan 27 04:23:39 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Jan 27 04:23:39 2009] [notice] Parent: Created child process 2492
[Tue Jan 27 04:23:39 2009] [notice] Disabled use of AcceptEx() WinSock2 API
[Tue Jan 27 04:23:39 2009] [notice] Child 2492: Child process is running
[Tue Jan 27 04:23:39 2009] [notice] Child 2492: Acquired the start mutex.
[Tue Jan 27 04:23:39 2009] [notice] Child 2492: Starting 1700 worker threads.
[Tue Jan 27 04:23:39 2009] [notice] Child 2492: Listening on port 80.
[Tue Jan 27 04:27:24 2009] [notice] Parent: Received shutdown signal -- Shutting down the server.


I have tried just about every combination of values for the following settings in httpd.conf:

Code:
KeepAlive On
KeepAliveTimeout 10
MaxKeepAliveRequests 5000

<IfModule mpm_winnt.c>
ThreadLimit 1920
ThreadsPerChild 1800
MaxRequestsPerChild 0
</IfModule>


I was excited to see a new version of eAccelerator so I gave that a try and it crashes PHP within 15 minutes guaranteed with the following error:

Code:
zend_mm_heap corrupted
Error in my_thread_global_end(): 1382 threads didn't exit


...where threads is any value from 1 to 2000.

As a last resort, last night I attempted to replace apache2php2_2.dll with mod fcgi. I could not get it to work. The only 2 outcomes from configuring my Apache for fcgi were either:

1. permission on php files denied.
2. user promted to download php file.

So i reverted to the apache2php, disabled eAccelerator, and im back in the same boat of Apache bloating to 600 megs in under 5-10 minutes, restarting, and a completely pegged CPU.

I understand this is a lot of stuff, and that I really shouldnt be using windows, but ive done my due diligence here and would love some help here as im obviously over my head.

My wish list:

1. run Apache in some config so that it runs stable, doesnt restart or crash
2. keep my server CPUs from constantly being at 100% usage with only moderate traffic.
3. get eAccelerator and fcgi to work without crashing PHP and causing Apache to stop and not restart.

Thanks all!

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Update: I switched from php5apache2_2.dll to using mod_fcgid and my memory issues are resolved. it took over 3 hours for apache to climb to 200 mb today using this setup. On a side note, eAccelerator seems to behave better with fcgid over php5apache2_2.dll.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Fastcgi is running PHP not as module, but over the binary as cgi. The f(ast)cgid(daemon) keeps the process alive so apache does not have to start it new for every request. which makes it faster over regular cgi.

For a setup on debian / ubuntu see http://www.howtoforge.com/how-to-set-up-apache2-with-mod_fcgid-and-php5-on-ubuntu-8.10

just a every short example without explaining. For more details see the docs => http://fastcgi.coremail.cn/configuration.htm

fcgid.conf

Code:

<IfModule mod_fcgid.c>
        AddHandler fcgid-script .fcgi
        IPCConnectTimeout 20
</IfModule>


Starter-Script
Code:

#!/bin/sh
PHPRC="/etc/php5/"
PHP_FCGI_MAX_REQUESTS=5000
export PHPRC
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php5-cgi


vHost-Config
Code:

<VirtualHost <ip>:80>
        ServerName <ip>
        ServerAdmin webmaster@example.com
        DocumentRoot /var/www/default/html/
        ErrorLog /var/www/default/logs/error.log
        LogLevel warn
        CustomLog /var/www/default/logs/access.log actra

        SuexecUserGroup apache-default apache-default
        AddHandler fcgid-script .php
        AddHandler cgi-script .pl .cgi

        <Directory /var/www/default/html/>
                Options Indexes FollowSymLinks MultiViews +ExecCGI
                FCGIWrapper /var/www/default/php-fcgi/php-fcgi-starter .php
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

 

출처 : http://www.apachelounge.com/viewtopic.php?t=2851

?

공부 게시판

공부에 도움되는 글을 올려주세요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 928126
298 웹 프로그래밍 메모리 부족 현상 (allowed memory size of 134217728 bytes..) JaeSoo 2023.08.01 2207
297 웹 프로그래밍 Guzzle - cURL error 60: SSL certificate problem: unable to get local issuer certificate 문제 해결 file JaeSoo 2023.07.30 2188
296 웹 프로그래밍 XE 캐시파일 재성생후 404 Oops, Sorry. Page is not found! 나올때 JaeSoo 2023.07.29 2117
295 웹 프로그래밍 XE - " Fatal error: Class 'Object' not found in " / class 낫파운드 오류 file JaeSoo 2023.03.20 147
294 웹 프로그래밍 iOS 앱 개발을 위한 인증서 생성 및 관리 file JaeSoo 2023.01.18 218
293 웹 프로그래밍 PHP 파서 이해하기 (<?php의 php를 생략하고 간단히 <? 태그 와 ?> 태그를 사용하는 방법) JaeSoo 2016.08.10 322
292 웹 프로그래밍 XE 비회원 글쓰기 항목 지우기 file JaeSoo 2016.04.28 499
291 웹 프로그래밍 오른쪽 마우스 금지 소스 / 드래그 금지 소스 JaeSoo 2016.01.20 475
290 웹 프로그래밍 Strict standards and C5 support errors JaeSoo 2015.12.02 524
289 웹 프로그래밍 ICT노트 :: 반응형웹을 만드는 기술은? file JaeSoo 2015.09.26 489
288 웹 프로그래밍 [번역] 2014년 가장 인기있는 5가지 프론트엔드 프레임워크 비교 file JaeSoo 2015.09.25 862
287 웹 프로그래밍 최고의 반응형 CSS 프레임워크 18선 (2013년 7월기준) file JaeSoo 2015.09.25 586
286 웹 프로그래밍 가장 진보된 반응형 웹을 위한 프레임워크 UIkit file JaeSoo 2015.09.25 559
285 웹 프로그래밍 반응형 웹을 위한 프론트-엔드 프레임 워크 (front-end framework for developing responsive web) file JaeSoo 2015.09.25 739
284 웹 프로그래밍 한국형 반응형웹 프레임웍을 찾아서 - 왜 우리는 IE 7,8때문에 고통받아야 하는가? file JaeSoo 2015.09.25 611
283 웹 프로그래밍 한국을 위한 CSS 그리드 디자인 프레임워크 JaeSoo 2015.09.25 531
282 웹 프로그래밍 과연 반응형 웹 디자인만이 해답일까? file JaeSoo 2015.09.25 535
281 웹 프로그래밍 반응형 웹 디자인의 단점 file JaeSoo 2015.09.25 567
280 웹 프로그래밍 웹디자인 신기술 트렌드 및 적용 사례 file JaeSoo 2015.07.28 510
279 웹 프로그래밍 제이쿼리(jQuery) 튜토리얼(Tutorial) 모음 file JaeSoo 2015.07.28 1253
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너