PGI컴파일러를 이용한 apache엔진 구축하기
레드햇 리눅스 7.3 과 9.0 에서 테스트했습니다.
# pgcc 가져 오기 ( 원사이트에서 가져와 pgcc와 pg++를 묶어놨습니다. )
wget http://www.sapphireserver.com/pgcc-linux.tar.gz
tar zxf pgcc-linux.tar.gz -C /usr/local/
echo ‘/usr/local/pgcc/lib’ >> /etc/ld.so.conf
ldconfig
# mysql 설치
CC=”/usr/local/pgcc/bin/pgcc” CFLAGS=”-O6 -mpentiumpro -mstack-align-double -fomit-frame-pointer -march=pentiumpro” CXX=”/usr/local/pgcc/bin/pgcc” CXXFLAGS=”-O6 -mpentiumpro -march=pentiumpro -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti” LDFLAGS=”-static” ./configure –prefix=/usr/local/mysql –with-client-ldflags=-all-statoc –with-mysqld-ldflags=-all-static –with-charset=euc_kr –without-debug –enable-assembler –with-mysqld-user=mysql –with-innodb
make && make install
wget http://www.sapphireserver.com/euc_kr.conf -O /usr/local/mysql/share/mysql/charsets/euc_kr.conf
echo ‘/usr/local/mysql/lib’ >> /etc/ld.so.conf
ldconfig
# 웹서버와 PHP 설치
CC=”/usr/local/pgcc/bin/pgcc” OPTIM=”-O2″ CFLAGS=”-DDYNAMIC_MODULE_LIMIT=0″ ./configure –prefix=/usr/local/apache –enable-module=headers –disable-module=userdir –disable-module=imap –disable-module=status –disable-module=include –disable-module=auth –enable-module=mmap_static
./configure –with-mysql=/usr/local/mysql –with-apache=../apache_1.3.29 –with-imap=/usr/local/imap-2001
make && make install
CC=”/usr/local/pgcc/bin/pgcc” OPTIM=”-O2″ CFLAGS=”-DDYNAMIC_MODULE_LIMIT=0″ ./configure –prefix=/usr/local/apache –enable-module=headers –activate-module=src/modules/php4/libphp4.a –disable-module=userdir –disable-module=imap –disable-module=status –disable-module=include –disable-module=auth –enable-module=mmap_static
make && make install
header append P3P: ‘CP=”CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE”‘
아래는 웹서버에 있는 동적파일을 벤치마킹한 결과입니다.
——————————————————————————–
ab -c1000 -n30000 http://www.test.com/index.php
This is ApacheBench, Version 1.3d <$Revision: 1.70 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.test.com (be patient)
Completed 3000 requests
Completed 6000 requests
Completed 9000 requests
Completed 12000 requests
Completed 15000 requests
Completed 18000 requests
Completed 21000 requests
Completed 24000 requests
Completed 27000 requests
Finished 30000 requests
Server Software: entertainment/:)
Server Hostname: www.test.com
Server Port: 80
Document Path: /index.php
Document Length: 4473 bytes
Concurrency Level: 1000
Time taken for tests: 233.487 seconds
Complete requests: 30000
Failed requests: 6
(Connect: 3, Length: 3, Exceptions: 0)
Broken pipe errors: 0
Total transferred: 141568201 bytes
HTML transferred: 134188201 bytes
Requests per second: 128.49 [#/sec] (mean)
Time per request: 7782.90 [ms] (mean)
Time per request: 7.78 [ms] (mean, across all concurrent requests)
Transfer rate: 606.32 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 10 835 2771.9 12 188998
Processing: 72 3122 3152.3 1012 193807
Waiting: 52 3121 3152.3 1011 193807
Total: 72 3957 4208.8 1037 193826
Percentage of the requests served within a certain time (ms)
50% 1037
66% 1452
75% 3985
80% 4073
90% 8243
95% 10303
98% 22569
99% 49780
100% 193826 (last request)
————————————————————————-
테스트는 서울(KIDC-터미널상태)에서 부산(온세 IDC)센터에 있는 서버로 했습니다.
서버는 커널 피라미터쪽도 손본상태이며, 디비서버가 분리된 웹서버 전용입니다.
인덱스파일은 템플릿을 사용하는 크기가 좀 큰 파일입니다.
php 또한 pgcc 로 컴파일 하실수 있습니다.
configure 후에 생성되는 Makefile 에서 gcc 를 pgcc 로 수정하시면 됩니다.