Background Image
조회 수 17044 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
웹개발을 하다 보면 특정 부분에 대해서 응답 속도(response time) 나 처리량(througput) 에 대한 문제점이 발생 한다.

대부분의 웹프로그램은 DB 시스템의 영향을 받게 되는데 최대한 DB Access를 줄인다면 응답 속도나 처리량을 늘일수 있는 방법이 있어 소개 한다.

PHP PECL Cache-Lite을 이용하면 PHP에서도 Cache 기능을 사용할 수 있다.(현재 테스트 된 버전은 1.7.7 이다)
홈페이지 http://pear.php.net/package/Cache_Lite/

설치 방법
$pecl install Cache_Lite

업그래이드 방법
$pecl upgrdate Cache_Lite


샘플 코드 test_cache.php
<? require_once('Cache/Lite.php'); // Set a id for this cache $id = '123'; // Set a few options $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 3600 ); // Create a Cache_Lite object $Cache_Lite = new Cache_Lite($options); // Test if thereis a valide cache for this id if ($data = $Cache_Lite->get($id)) { echo " Cache hit !"; echo $data; // Content is in $data } else { // No valid cache found (you have to make the page) echo " Cache miss !"; // Put in $data datas to put in cache $con = cubrid_connect ("localhost", 33000, "demodb","dba",""); $req = cubrid_execute ($con, "select 1 as "id" , 2 as "name" from db_root"); if ($req) { if ($row = cubrid_fetch ($req, CUBRID_OBJECT)) { echo $row->id; echo $row->name; $data = $row->id; $Cache_Lite->save($data,'123'); } } cubrid_close_request ($req); cubrid_disconnect ($con); } ?>

cache 적용전

cache 적용후


  1. Weblogic 10.0 사용시 JDK 1.5를 사용한 JDBC 드라이버 사용시 주의사항.

    Date2012.02.22 Category응용개발 Bycubebridge Views51957
    Read More
  2. WHERE 조건에서 다중 컬럼 IN절 처리 최적화 방법 (cubrid + ibatis)

    Date2015.08.21 Category응용개발 By이상신 Views55133
    Read More
  3. PHP에서 prepared statement 사용하기

    Date2009.04.16 Category응용개발 ByPrototype Views21454
    Read More
  4. PHP에서 prepared statement 사용시 BIND 관련 팁

    Date2009.06.30 Category응용개발 ByPrototype Views14843
    Read More
  5. PHP에서 Prepared statement 사용시 NULL 값을 바인딩 하는 방법

    Date2009.11.27 Category응용개발 ByPrototype Views19722
    Read More
  6. PHP에 CUBRID 모듈 추가시 모듈이 로드되지 않는 문제에 대한 해결 방안 하나입니다

    Date2010.07.01 Category응용개발 By남재우 Views16557
    Read More
  7. PHP 프로그램을 작성할때 주의할 점

    Date2009.07.01 Category응용개발 ByPrototype Views13728
    Read More
  8. PHP 성능 최적화를 위한 고려 사항

    Date2009.07.01 Category응용개발 By웁쓰 Views17415
    Read More
  9. PHP PEAR extension 을 이용한 DB Time 추적

    Date2009.07.01 Category응용개발 By웁쓰 Views19182
    Read More
  10. PHP PEAR extension Cache-Lite 를 이용한 응용 프로그램 최적화

    Date2009.07.01 Category응용개발 By웁쓰 Views17044
    Read More
  11. ODBC 드라이버를 이용한 Prepare 사용하기.

    Date2009.06.16 Category응용개발 Byseongjoon Views19591
    Read More
  12. MySQL의 Blob타입을 CUBRID로 변환하기

    Date2009.11.18 Category응용개발 Bycubebridge Views18856
    Read More
  13. Java Data Type의 CUBRID Data Type으로의 변경 Tip

    Date2009.06.16 Category응용개발 Bycubebridge Views18032
    Read More
  14. JDBC 커넥션 스트링에 UTF-8 명시하는법

    Date2009.07.03 Category응용개발 ByPrototype Views19017
    Read More
  15. JDBC 사용시 SQL 로깅 - p6spy 사용

    Date2009.07.01 Category응용개발 By웁쓰 Views35999
    Read More
  16. JAVA SP를 통해 다른 데이터베이스 연결하는 경우 잊지 말자.

    Date2009.12.16 Category응용개발 By손승일 Views17975
    Read More
  17. JAVA SP 사용 시 로그 처리 방법

    Date2015.06.03 Category응용개발 By손승일 Views8574
    Read More
  18. CUBRID의 날짜형 타입을 java의 날짜형 타입에 할당할 때의 값 비교.

    Date2009.12.16 Category응용개발 Byseongjoon Views20420
    Read More
  19. CUBRID의 Statement pooling기능

    Date2009.11.06 Category응용개발 Bycubebridge Views16944
    Read More
  20. CUBRID와 Oracle에서의 ''(공백)의 차이 비교

    Date2010.10.01 Category응용개발 Bycubebridge Views28583
    Read More
Board Pagination Prev 1 2 3 Next
/ 3

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales