½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
happycgi
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > JAVA,JSP > JSP ¼Ò½ºÃ¢°í > ±âŸ > À¥·Î±× ºÐ¼® ÇÁ·Î±×·¥ version 1.3 »ó¼¼Á¤º¸
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
CSS
HTML
MYSQL
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
À¥·Î±× ºÐ¼® ÇÁ·Î±×·¥ version 1.3
¼Ò½ºÅë°èÁ¤º¸ ¿À·ù½Å°í ¹× ¹®ÀÇ
ÇØÇÇÆÀ
³×ƼÁð
Æ®À§ÅÍ·Î º¸³»±â ÆäÀ̽ººÏÀ¸·Î º¸³»±â
¼Ò½ººÐ·ù ±âŸ
´Ù¿î·Îµå Ƚ¼ö 1127 ȸ
°£´Ü¼³¸í JSP·Î ±¸ÇöµÈ À¥·Î±× ºÐ¼® ÇÁ·Î±×·¥ÀÔ´Ï´Ù.
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
¼Ò½º´Ù¿î·Îµå µ¥¸ð ¹Ì¸®º¸±â°¡ ¾ø½À´Ï´Ù ½ºÅ©·¦Çϱâ
º» ¼Ò½º ÇÁ·Î±×·¥Àº ´©±¸³ª ÀÚÀ¯·Ó°Ô ¼öÁ¤ º¯°æ ¹èÆ÷ÇÒ ¼ö ÀÖ½À´Ï´Ù.
±×·¯³ª, ¿ø ÀúÀÚÀÇ À̸§À» »èÁ¦ÇÏ½Ã¸é ¾ÈµË´Ï´Ù.

ÀÚ¹Ù¼­ºñ½º³Ý ÀÌ¿ø¿µ
javaservice@hanmail.net

-------------------------------------------------------------------------------
Document Version History

Version 1.0 2002.03.12
Version 1.2 2002.03.25
Version 1.3 2002.05.30

---------------------------------------------------------------
Version 1.0 --> 1.1 º¯°æ»çÇ×

1) ./bin/ µð·ºÅ丮ÀÇ *.bat ÆÄÀÏ°ú ./target/class/* µð·ºÅ丮ÀÇ Java Ŭ·¡½ºÀ̸§°úÀÇ
¸ÊÇÎ

2) ¿É¼ÇÆĶó¸ÞÅÍ Áß ½Ã°¢Æ÷¸ä º¯°æ
yyyyMMdd/HH:mm:ss --> yyyyMMdd/HHmmss

¶ÇÇÑ, ½Ã°£°£°Ý¿É¼ÇÀÌ ºÐ´ÜÀ§ ¹× ÃÊ´ÜÀ§·Î È¥ÀçµÈ ºÎºÐÀº ¸ðµÎ
ÃÊ(seconds)´ÜÀ§·Î ÅëÀÏ

3) µ¿ÀÏÇÑ ¼­ºí·¿¿¡¼­ ´ëÇؼ­ ¼­·Î´Ù¸¥ URL±¸ºÐÀÚ°¡ ÀÖ´Ù¸é À̸¦ ±âÁØÀ¸·Î
Ãß°¡ÀûÀÎ TABLE Ä÷³À» ÁöÁ¤ÇÏ¿© ·ÎµåÇÏ´Â AccessSpecialLoad Ãß°¡
(TABLE Ä÷± txid Ãß°¡)

--------------------------------------------------------------
Version 1.1 --> 1.3 º¯°æ»çÇ×

1) ./bin/ µð·ºÅ丮ÀÇ *.bat ÆÄÀÏ°ú *.sh ÆÄÀÏ¿¡¼­ accesshitcalc.bat¸¦ hitcal.bat¿Í °°ÀÌ
¾ÕºÎºÐÀÇ Prefix¸¦ ¸ðµÎ »°½À´Ï´Ù. ÀÌÀ¯´Â À¥·Î±×ÆÄÀÏÀÎ access_log µ¥ÀÌŸ¿Í requestmon
¸ðµâÀ» ÅëÇØ ³ª¿À´Â trace.log ÆÄÀÏÀ» °°Àº DB Å×ÀÌºí¿¡¼­ µ¿ÀÏÇÏ°Ô °ü¸®Åä·Ï º¯°æÇß±â
¶§¹®ÀÔ´Ï´Ù.
2) TABLEÀ̸§ÀÌ ACCESSLOG ¿¡¼­ ANALYSIS·Î ¹Ù²î¾ú½À´Ï´Ù.


--------------------------------------------------------------
¿î¿µÈ¯°æ

ÇöÀç´Â Windows2000, UDB DB2, JDK 1.2 ÀÌ»ó ȯ°æ¿¡ ¸ÂÃß¾îÁ® ÀÖÀ½. Á¶±Ý¸¸ ÀÀ¿ëÇϸé
¾î¶² Ç÷¿Æû¿¡¼­µµ »ç¿ë°¡´É ÇÒ µí...

1. ¸ÕÀú ºÐ¼®¿¡ »ç¿ëµÈ UDB DB2 DB¸¦ »ý¼ºÇÕ´Ï´Ù.
½ÃÀÛ--> ÇÁ·Î±×·¥ --> IBM DB2 --> Command Line Processor

db2 => create database ACCLOG (´ë·« 30ÃÊ-60ÃÊÁ¤µµ °É¸± °ÍÀÔ´Ï´Ù.)
DB20000I The CREATE DATABASE command completed successfully.

db2 => update db cfg for ACCLOG using logfilsiz 1000
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
DB21026I For most configuration parameters, all applications must disconnect
from this database before the changes become effective.

db2 => update db cfg for ACCLOG using logsecond 100
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
DB21026I For most configuration parameters, all applications must disconnect
from this database before the changes become effective.

db2 => quit

2. ¹Ýµå½Ã ¼öÁ¤ÇØ¾ß ÇÒ ±¸¼ºÆÄÀÏ

2.1 [bin/env.bat]
.......
set ANALYSIS_HOME=e:applicationanalysis
set JAVA_HOME=e:applicationanalysisjdk1.2.2
.....
set CLASSPATH=%CLASSPATH%;d:sqllibjavadb2java.zip;
set CLASSPATH=%CLASSPATH%;d:sqllibjava
untime.zip
....

ÆíÁý ¿¹)
.......
set ANALYSIS_HOME=C:analysis
set JAVA_HOME=C:analysisjdk1.2.2
.....
set CLASSPATH=%CLASSPATH%;C:SQLLIBjavadb2java.zip;
set CLASSPATH=%CLASSPATH%;C:SQLLIBjava
untime.zip




3.2 [properties/jdf.properties]
....
org.jsn.reqanalysis.driver = COM.ibm.db2.jdbc.app.DB2Driver
org.jsn.reqanalysis.url = jdbc:db2:ACCLOG <-- ÇÊ¿ä½Ã DB¸í º¯°æ !!!
org.jsn.reqanalysis.user = db2admin
org.jsn.reqanalysis.password = db2admin
....


3. °£´ÜÇÑ »ç¿ë¹ý ¼³¸í

»ç¿ë¹ý: ¸Å°³º¯¼ö¸¦ »ý·«ÇÏ°í ½ÇÇàÇÏ¸é °£´ÜÇÑ »ç¿ë¹ýÀÌ ³ª¿É´Ï´Ù.

bin/accessload.bat: access_log ¸¦ DB¿¡ Insert
¿¹) accessload ..dataaccess_log XX drop

NOTE: "drop" ¿É¼ÇÀº Å×À̺íÀ» dropÇÏ°í »õ·Î ¸¸µë.
ÇÊ¿ä½Ã target/classes/AccessInsert.java ¼Ò½º ¼öÁ¤

bin/accessspecialload.bat: access_log¸¦ DB¿¡ insertÇÏ´Â °ÍÀº µ¿ÀÏÇϳª Ưº°ÇÑ
Ä÷³ÀÎ txid °¡ Ãß°¡µÇ¾î À־, °°Àº ¼­ºí·¿ÀÏ Áö¶óµµ txid ·Î ±¸ºÐÅä·Ï...
(ÀÚ¼¼ÇÑ °ÍÀº target/classes/AccessSpecialLoad.java¸¦ º¼°Í..

bin/hitcalc.bat : ´ÜÀ§½Ã°£´ç HIT°Ç¼ö ÃßÃâÇϱâ(TPM)
¿¹) hitcalc 200200529/070000 20020529/103000 60 (1ºÐ´çTPM)

bin/cumulativeip.bat : ´©ÀûIP¾îµå·¹½º°³¼ö ÃßÃâÇϱâ
¿¹) cumulativeip 200200529/070000 20020529/103000 60 (60Ãʸ¶´Ù)

bin/usercalc.bat : µ¿½Ã´Ü¸»»ç¿ëÀÚ¼ö ÃßÃâÇϱâ
¿¹) usercalc 200200529/070000 20020529/103000 60 (60ÃÊ ¸¶´Ù)

bin/bytecalc.bat : ´ÜÀ§½Ã°£´ç µ¥ÀÌŸÀü¼Û·® ÃßÃâÇϱâ

NOTE: startup.bat, shutdown.bat, load.bat, jdfaccessload.bat,
calc.bat, appcalc.bat, hosttxload.bat, hosttxcalc.bat,
access390load.bat µîµîÀº ´Ù¸¥ ¿ëµµÀÌ´Ï º°µµ ¼³¸í »ý·«.

PS: ÆÄÀÏ·Î ÀúÀåÇϱâ:
hitcalc 200200529/070000 20020529/103000 60 > hit.txt

NOTE: ¸Å°³º¯¼ö Áß ½Ã°£¿¡ ´ëÇÑ ÀԷ°ªÀÌ ¶§·Ð ÃÊ´ÜÀ§/ºÐ´ÜÀ§·Î Çò°¥¸®°Ô µÇ¾î
Àֳ׿ä. ÃÊ´ÜÀ§·Î Á¶¸¸°£ ÅëÀϽÃÄÑ¾ß ÇÒ µí ÇÕ´Ï´Ù.

4. ÇÊ¿ä½Ã ÄÄÆÄÀÏ ¹æ¹ý:
cd target/classes
cc.bat AccessInsert.java

PS: Ç×»ó ¼Ò½º¸¦ È®ÀÎÇÏ°í, ÀÌÇØÇÑ ÈÄ, ÇÊ¿ä½Ã ÀÚÀ¯·Ó°Ô ¼öÁ¤Çϼŵµ µË´Ï´Ù. ÀúÀÇ °æ¿ì,
¸Å »çÀÌÆ®¸¶´Ù Á¶±Ý¾¿ ¼öÁ¤Çؼ­ »ç¿ëÇÏ°ï ÇÕ´Ï´Ù.


5. À¯¿ëÇÑ SQL Äõ¸®

connect to LWYDB user DB2ADMIN using DB2ADMIN

describe select * from analysis
sqltype sqllen sqlname.data sqlname.length
-------------------- ------ ------------------------------ --------------
448 VARCHAR 15 HOST 4
448 VARCHAR 31 IP 2
392 TIMESTAMP 26 STARTTIME 9
392 TIMESTAMP 26 ENDTIME 7
449 VARCHAR 7 METHOD 6
448 VARCHAR 2000 URL 3
448 VARCHAR 100 SHORTURL 8
449 VARCHAR 50 TXID 4
484 DECIMAL 10, 0 ELAPSED 7
453 CHARACTER 3 RETURN_CODE 11
485 DECIMAL 10, 0 DATA_SIZE 9

select substr(shorturl,1,80), count(*), sum(elapsed), sum(elapsed)/count(*) from analysis where shorturl like ``%Servlet`` or shorturl like ``%.jsp`` group by shorturl order by count(*) desc

select substr(shorturl,1,80), count(*), sum(elapsed), sum(elapsed)/count(*) from analysis group by shorturl order by count(*) desc

select substr(shorturl,1,80), count(*), sum(elapsed), sum(elapsed)/count(*) from analysis group by shorturl order by sum(elapsed) desc

select substr(shorturl,1,80), count(*), sum(elapsed), sum(elapsed)/count(*) from analysis group by shorturl order by sum(elapsed)/count(*) desc

NOTE: Peak ½Ã°£´ë¿¡¼­, Àå¾Ö°¡ ¹ß»ýÇÏÁö Á÷Àü, Á¤»óÀûÀÎ ¼­ºñ½º¸¦ Çß´ø ¸î½ÊºÐ°£À»
¼±ÅÃÇÏ´Â °ÍÀÌ Áß¿äÇÏ´Ù.

select substr(x1.u,1,80), sum_elapsed, cnt, avert, totalsize, avesize, tpm, tpm/(20.0*60.0) as tps from (select shorturl as u, max (c) as tpm from ( select shorturl, count(*) as c from analysis where starttime >= ``2002-07-23-09.50.00`` and starttime < ``2002-07-23-10.00.00`` and (shorturl like ``%/servlet/%`` or shorturl like ``%.jsp`` ) group by shorturl, date(starttime), hour(starttime), minute(starttime)/5 ) as x group by shorturl ) as x1, (select count(*) as cnt, sum(elapsed)/count(*) as avert, sum(elapsed) as sum_elapsed, sum(data_size) as totalsize, sum(data_size)/count(*) as avesize, shorturl as u from analysis where starttime >= ``2002-07-23-09.50.00`` and starttime < ``2002-07-23-10.00.00`` and (shorturl like ``%/servlet/%`` or shorturl like ``%.jsp`` ) group by shorturl ) as x2 where x1.u = x2.u order by sum_elapsed desc


select shorturl, sum(elapsed) as SUM_elapsed, count(*) as CNT, sum(elapsed)/count(*) as RT, sum(data_size) as TotalSIZE, sum(data_size)/count(*) as AveDATA, count(*)/(4.0*3600.0) as tps from analysis where host = ``seoul`` and starttime >= ``2002-07-26-13.00.00`` and starttime < ``2002-07-26-18.00.00`` and (shorturl like ``%/servlet/%`` or shorturl like ``%.jsp`` ) group by shorturl order by SUM_elapsed desc

select subip, count(distinct ip), count(*), count(*)/count(distinct ip), sum(elapsed), sum(elapsed)/count(distinct ip) from analysis where not (shorturl like ``%/servlet/%`` or shorturl like ``%.jsp``) group by subip order by sum(elapsed)/count(distinct ip) desc


6. requestmon ¸ðµâ ·Î±× ºÐ¼® Åø

bin/load.bat: requestmon¿¡ ÀÇÇÑ trace.log ÆÄÀÏÀ» DB¿¡ Insert
¿¹) load ..data race.log M1 drop

(ÆíÁýÁß...)

-------------------------------------------------------
º» ¹®¼­´Â ÀÚÀ¯·Ó°Ô ¹èÆ÷/º¹»ç ÇÒ ¼ö ÀÖÀ¸³ª ¹Ýµå½Ã
ÀÌ ¹®¼­ÀÇ ÀúÀÚ¿¡ ´ëÇÑ ¾ð±ÞÀ» »èÁ¦ÇÏ½Ã¸é ¾ÈµË´Ï´Ù
================================================
ÀÚ¹Ù¼­ºñ½º³Ý ÀÌ¿ø¿µ
E-mail: javaservice@hanmail.net
PCS:011-898-7904
================================================
³×ƼÁð ÀÇ°ß   ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.)
³»¿ë ¾ÆÀ̵ð ÀÇ°ß³²±â±â
µî·ÏµÈ ÀÇ°ßÀÌ ¾ø½À´Ï´Ù.
1
À̸§
³»¿ë
:³×¸Â¾Æ¿ä: :È­³ª´Â±º¿ä: :Àá¿Í: :¿ì¿ïÇØ: :À̰ǾƳÄ: :¿ÕÇÏÇÏ: ¿Õ¿ôÀ½~ ³î·¥~
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
µµ¹è¹æÁöÅ°
 49168792 º¸ÀÌ´Â µµ¹è¹æÁöÅ°¸¦ ÀÔ·ÂÇϼ¼¿ä.