Linuxdoc Sgml/Zend_Optimizer-KLDP
<!doctype linuxdoc system>
<article>
<title>Apache + Zend Optimizer ¼³Ä¡
<author>Á¤¿ø¿µ <htmlurl url="mailto:suni00@kernel.pe.kr"
name="suni00@kernel.pe.kr">
<date>v0.2, 2000³â 3¿ù 16ÀÏ
<abstract>
Apache À¥¼¹ö¿¡ Zend Optimizer¸¦ ¸ðµâ·Î ÄÄÆÄÀÏÇÏ°í ±âÁ¸ÀÇ PHP3,
Zend¿ÍÀÇ ¼Óµµ¸¦ Å×½ºÆ® ÇØº¸¾Ò´Ù.
</abstract>
<toc>
<sect> Zend Optimizer¶õ?<p>
Zend Optimizer´Â Ç¥ÁØ Zend ·± ŸÀÓ ÄÄÆÄÀÏ·¯¿¡ ÀÇÇØ »ý¼ºµÇ´Â Áß°£
Äڵ带 Á¶»çÇÏ°í£¬´õ ºü¸¥ ½ÇÇàÀ¸·Î ±×°ÍÀ» ÃÖÀûÈÇß´Ù°í ÇÑ´Ù.
±âÁ¸ÀÇ PHP3¿Í Zend¿¡¼ º¸¿©ÁÖ´Â ¼Óµµ¸¸Å ´õ »¡¶óÁ³´Ù´Â°É ü°¨ ÇÒ¼ö
ÀÖ¾ú´Ù.
<sect> ¼³Ä¡È¯°æ<p>
¼³Ä¡È¯°æÀº glibc 2.1 ÀÌ»ó, ¾ÆÆÄÄ¡ 1.3ÀÌ»óÀÇ ¹öÀüÀÌ¸ç °¢°¢ÀÇ
¼³Ä¡¹öÀüÀº ´ÙÀ½°ú °°´Ù.
<itemize>
<item> Apache : 1.3.12
<item> Zend : Zend beta4 p1 + Zend Optimizer
</itemize>
´ÙÀ½ »çÀÌÆ®¿¡¼ ±¸ÇÑ´Ù.
<url url="http://www.apache.org">
<url url="http://www.zend.com">
<url url="http://www.php.net">
<bf>
Zend beta4 p1À» ¼³Ä¡ÇßÀ»¶§ ÇѱÛÀÌ ±úÁö´Â Çö»óÀÌ Àִµ¥ ÀÌ´Â
/usr/local/php-4.0b4pl1/sapi/apache/mod_php4.c ÆÄÀÏÀ» ¿¾î¼
text/html;charset=iso-8859-1¸¦ text/html;charset=EUC_KR·Î ¹Ù²ãÁÖ°í
ÄÄÆÄÀÏÇØ¾ß ÇÑ´Ù.
</bf>
<sect> ÄÄÆÄÀÏ ÇϱâÀü<p>
Zend OptimizerÀÇ tar¸¦ Ç®°í ´ÙÀ½°ú °°Àº ÀÛ¾÷À» ÇÑ´Ù.
<itemize>
<item>tar Ç®¾î¼ ³ª¿Â ZendOptimizer.so¸¦ /usr/local/Zend/lib
µð·ºÅ丮¸¦ ¸¸µé¾î¼ ±× ¾È¿¡ ³Ö´Â´Ù.
</itemize>
<sect> Apache + Zend Optimizer ÄÄÆÄÀÏ<p>
¾ÆÆÄÄ¡¿Í Zend ¸ðµÎ /usr/local µð·ºÅ丮¿¡ Ç®¾úÀ¸¸ç ¾ÆÆÄÄ¡ÀÇ ¼Ò½º
µð·ºÅ丮´Â /usr/local/apache_1.3.12 À̸ç ZendÀÇ ¼Ò½º µð·ºÅ丮´Â
/usr/local/php-4.0b4pl1 ÀÌ´Ù.
¸ðµç°Ç root °èÁ¤À¸·Î ÀÛ¾÷ÇÑ´Ù.
<verb>
# cd /usr/local/apache_1.3.12 (¾ÆÆÄÄ¡ ¼Ò½º µð·ºÅ丮·Î À̵¿)
# ./configure --prefix=/etc/httpd (ÄÄÆÄÀÏÈÄ »ý¼º ÆÄÀÏÀÇ °æ·Î´Â
/etc/httpd ÀÌ´Ù)
# cd /usr/local/php-4.0b4pl1 (Zend ¼Ò½º µð·ºÅ丮·Î À̵¿)
# ./configure --with-apache=/usr/local/apache_1.3.12
--disable-debug (Optimizer¸¦ À§ÇÑ ¿É¼Ç)
(ÀÌ¿Ü ´Ù¸¥ Ãß°¡ ¿É¼Çµéµµ ÇÑÁÙ¿¡ ÀÌ¾î ½á¾ßÇÑ´Ù)
# make
# make install (Zend ¼³Ä¡)
# cp php.ini-dist /usr/local/lib/php.ini (php ¿É¼Çµé)
# cd /usr/local/apache_1.3.12 (¾ÆÆÄÄ¡ µð·ºÅ丮·Î À̵¿)
# ./configure --prefix=/etc/httpd
--activate-module=src/modules/php4/libphp4.a
(Zend¸¦ ¸ðµâ·Î Æ÷ÇÔ½ÃÅ´, ¿ª½Ã ÇÑÁÙ·Î ÀÌ¾î ½á¾ßÇÑ´Ù)
# make
# make install (¾ÆÆÄÄ¡ ¼³Ä¡)
</verb>
¼³Ä¡ÈÄ ¾ÆÆÄÄ¡ ȯ°æ¼³Á¤ ÆÄÀÏÀÎ /etc/httpd/conf/httpd.conf ÆÄÀÏÀ» ¿¾î
´ÙÀ½°ú °°ÀÌ µÇ¾îÀÖ´ÂÁö È®ÀÎÇϰí ÁÖ¼®À» Ç®¾îÁØ´Ù.
<verb>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</verb>
´ÙÀ½À¸·Î /usr/local/lib/php.ini ÆÄÀÏ¿¡ ´ÙÀ½ µÎÁÙÀ»
Ãß°¡ÇÑ´Ù.(Optimizer¿¡¼ Ãß°¡µÈ ºÎºÐ)
<verb>
zend_optimizer.optimization_level=1
zend_extension="/usr/local/Zend/lib/ZendOptimizer.so"
</verb>
ÀÌÁ¦ ¾ÆÆÄÄ¡ µ¥¸óÀ» ¶ç¿î´Ù.
<verb>
/etc/httpd/bin/apachectl start
</verb>
<sect> Å×½ºÆ® Çϱâ<p>
¿©±â¼± Zend °¡ Optimizer µÇ¾ú´ÂÁö ÀÌÀüÀÇ ¹öÀüµé°úÀÇ ¼ÓµµÂ÷ÀÌ´Â ¾î¶²Áö
´ÙÀ½°ú °°ÀÌ Å×½ºÆ® ÇØº¸ÀÚ.
<itemize>
<item> phpinfo()·Î È®ÀÎÇϱâ<p>
<verb>
<?
phpinfo();
?>
</verb>
À§¿Í°°ÀÌ ÇßÀ»¶§ ´ÙÀ½°ú °°Àº Á¤º¸°¡ ³ª¿À¸é ¼º°øÀÌ´Ù.
<verb>
This program makes use of the Zend scripting language engine:
Zend Engine v0.90, Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski
with Optimizer v0.95, Copyright (c) 1998-2000, by Zend Technologies Ltd.
</verb>
<item> ¼Óµµ Å×½ºÆ®<p>
ÀÚ½ÅÀÇ ½Ã½ºÅÛ¿¡¼ ´ÙÀ½°ú °°Àº ÇÁ·Î±×·¡¹ÖÀ¸·Î OptimizerÇϱâÀü°ú ºñ±³ÇØ
º¸¶ó.
<verb>
<?
$start = time();
for ( $i = 1; $i <= 5000000; $i++ );
$t_time = time() - $start;
echo "Time : $t_time";
?>
</verb>
Âü°í·Î ¼¿·¯·Ð 400a(128KB cache)¿¡¼ Zend beta4 p1À» ÇßÀ»¶§ 18Ãʰ¡
³ª¿Ô´Âµ¥ Optimizer¸¦ Çϰí³ÈÄ 7Ãʰ¡ ³ª¿Ô´Ù.
</itemize>
---------------------------------------------------------------------
<htmlurl url="mailto:suni00@kernel.pe.kr"
name="ÆóÀÎ">
<htmlurl url="http://kernel.pe.kr/~suni00"
name="http://kernel.pe.kr/~suni00">
</article>
|
A king's castle is his home. |











