수정된 ab를 활용한 동적 페이지 성능 테스트 (get 방식) 본문

Programming

수정된 ab를 활용한 동적 페이지 성능 테스트 (get 방식)

halatha 2013. 3. 25. 10:17

  • installation

# wget http://mirror.apache-kr.org//httpd/httpd-2.4.4.tar.gz

# tar xfz httpd-2.4.4.tar.gz

# cd httpd-2.4.4


httpd-2.4.4# mv /some/path/abc.c ./support # abc.c를 받아 support로 이동

httpd-2.4.4# vi Makefile.in

httpd-2.4.4# ./configure

...

checking for APR... no

configure: error: APR not found. Please read the documentation.


# wget http://mirror.apache-kr.org//apr/apr-1.4.6.tar.gz # yum install apr이 동작하면 yum으로 설치 가능

# tar xfz apr-1.4.6.tar.gz

# cd apr-1.4.6

apr-1.4.6# ./configure # --prefix=/usr/local/apr-1.4.6 옵션을 사용해 설치 directory 변경 가능

apr-1.4.6# make && make install


httpd-2.4.4# ./configure --with-apr=/usr/local/apr # apr directory가 다른 경우 해당 directory 사용

...

checking for APR-util... no

configure: error: APR-util not found. Please read the documentation.


# wget http://mirror.apache-kr.org//apr/apr-util-1.4.1.tar.gz # yum install apr-util-devel이 동작하면 yum으로 설치 가능

# tar xfz apr-util-1.4.1.tar.gz

# cd apr-util-1.4.1

apr-util-1.4.1# ./configure --prefix=/usr/local/apr-util-1.4.1 --with-apr=/usr/local/apr # --prefix의 설치 directory 변경 가능, --with-apr의 apr directory가 다른 경우 해당 directory 사용

apr-util-1.4.1# make && make install


httpd-2.4.4# ./configure --with-apr=/usr/local/apr

httpd-2.4.4# make && make install


# /usr/local/apache2/bin/abc

/usr/local/apache2/bin/abc: wrong number of arguments

Usage: /usr/local/apache2/bin/abc [options] [http[s]://]hostname[:port]/path

Options are:

-n requests Number of requests to perform

-c concurrency Number of multiple requests to make

-t timelimit Seconds to max. wait for responses

-p postfile File containing data to POST

-R reqfile File containing lines to append to each request URL

-T content-type Content-type header for POSTing

-v verbosity How much troubleshooting info to print

-w Print out results in HTML tables

-i Use HEAD instead of GET

-x attributes String to insert as table attributes

-y attributes String to insert as tr attributes

-z attributes String to insert as td or th attributes

-C attribute Add cookie, eg. 'Apache=1234. (repeatable)

-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'


Inserted after all normal header lines. (repeatable)


-A attribute Add Basic WWW Authentication, the attributes are a colon separated username and password.

-P attribute Add Basic Proxy Authentication, the attributes are a colon separated username and password.

-X proxy:port Proxyserver and port number to use

-V Print version number and exit

-k Use HTTP KeepAlive feature

-d Do not show percentiles served table.

-S Do not show confidence estimators and warnings.

-g filename Output collected data to gnuplot format file.

-e filename Output CSV file with percentages served

-h Display usage information (this message)

-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)

-f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)


  • httpd-2.4.4/support/Makefile.in ab가 있는 부분을 복사해 일부를 abc로 바꿔 abc binary를 만들도록 수정

...

bin_PROGRAMS = htpasswd htdigest htdbm ab abc logresolve httxt2dbm

...

ab_OBJECTS = ab.lo

ab_LDADD = $(PROGRAM_LDADD) $(MATH_LIBS)

ab.lo: ab.c

$(LIBTOOL) --mode=compile $(CC) $(ab_CFLAGS) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \

$(ALL_INCLUDES) $(PICFLAGS) $(LTCFLAGS) -c $< && touch $@

ab: $(ab_OBJECTS)

$(LIBTOOL) --mode=link $(CC) $(ALL_CFLAGS) $(ab_LDFLAGS) $(PILDFLAGS) \

$(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $(ab_LTFLAGS) $(ab_OBJECTS) $(ab_LDADD)

...

abc_OBJECTS = abc.lo

abc.lo: abc.c

$(LIBTOOL) --mode=compile $(CC) $(ab_CFLAGS) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \

$(ALL_INCLUDES) $(PICFLAGS) $(LTCFLAGS) -c $< && touch $@

abc: $(abc_OBJECTS)

$(LIBTOOL) --mode=link $(CC) $(ALL_CFLAGS) $(ab_LDFLAGS) $(PILDFLAGS) \

$(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ $(ab_LTFLAGS) $(abc_OBJECTS) $(ab_LDADD)


  • Usage

$ /usr/local/apache2/bin/abc –c 한 번에 수행할 다중 요구 수 –n 페이지 요청 수 –t 테스트 허용 최대 시간 –R 요청 URL에 입력할 데이터를 가진 파일 URL

/usr/local/apache2/bin/abc -c [l] -n [m] -t [n] -R some_file_name http://12.34.56.78:9999/q=

Comments