CI 묻고 답하기

제목 시간이 지나면서 로딩 속도가 느려지는 원인이 무엇일까요?
글쓴이 에반스 작성시각 2015/09/15 14:26:48
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 14628   RSS
안녕하세요.
얼마전부터 CI 로 작업하고 있는데 처음에는 1초도 안걸리던 것들이
시간이 지나면 7~8초 길면 20~30초까지도 걸리는 현상이 나타납니다. 

윈도우 8 이었다가 윈도우 10으로 업데이트 했습니다.
XAMPP ,WAMPP, IIS  모두 동일한 현상으로 애를 먹고 있습니다.
여러번 재설치 한 결과, 서버 탓은 아닌 것 같습니다.

현재 로컬에서 저만 사용하고 있습니다. 메모리 과부하는 없습니다.

밴치마크 결과 값을 올려 드립니다. 추측 가능한 원인이 있다면 도움 부탁드립니다.
베이스 클래스만 2.4초라니...
뭐가 문제일까요?
 
Loading Time: Base Classes   2.4890
Controller Execution Time ( Shop / Category )   4.9360
Total Execution Time   7.4270

메모리 2,792,472 bytes

  DATABASE:  (Shop:$db)   QUERIES: 23 (0.0316 초)  (보기)


HTTP HEADER
HTTP_ACCEPT   text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT   Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
HTTP_CONNECTION   keep-alive
SERVER_PORT   80
SERVER_NAME   localhost
REMOTE_ADDR   ::1
SERVER_SOFTWARE   Apache/2.4.9 (Win32) PHP/5.5.12
HTTP_ACCEPT_LANGUAGE   ko,en-US;q=0.8,en;q=0.6,ja;q=0.4,zh-CN;q=0.2,zh;q=0.2,zh-TW;q=0.2
SCRIPT_NAME   /index.php
REQUEST_METHOD   GET
HTTP_HOST    
REMOTE_HOST    
CONTENT_TYPE    
SERVER_PROTOCOL   HTTP/1.1
QUERY_STRING    
HTTP_ACCEPT_ENCODING   gzip, deflate, sdch
HTTP_X_FORWARDED_FOR    
HTTP_DNT 

CONFIG VARIABLES  (감추기)
base_url   http://localhost/
index_page    
uri_protocol   REQUEST_URI
url_suffix    
language   korean
charset   UTF-8
enable_hooks    
subclass_prefix   MY_
composer_autoload    
permitted_uri_chars   a-z 0-9~%.:_\-
allow_get_array   1
enable_query_strings    
controller_trigger   c
function_trigger   m
directory_trigger   d
log_threshold   4
log_path    
log_file_extension    
log_file_permissions   420
log_date_format   Y-m-d H:i:s
error_views_path    
cache_path    
cache_query_string    
encryption_key   299c9ac31e6d652940f8747f1c8a8355
sess_driver   files
sess_cookie_name   cw_session
sess_expiration   7200
sess_save_path    
sess_match_ip    
sess_time_to_update   300
sess_regenerate_destroy    
sess_use_database   1
sess_table_name   ci_sessions
cookie_prefix    
cookie_domain    
cookie_path   /
cookie_secure    
cookie_httponly    
standardize_newlines    
global_xss_filtering    
csrf_protection    
csrf_token_name   cw_token
csrf_cookie_name   cw_kookie
csrf_expire   7200
csrf_regenerate   1
csrf_exclude_uris   Array ( )
compress_output    
time_reference   local
rewrite_short_tags    
proxy_ips  

// 해당 메소드

    function category($ca_id){
              
        $this->include_head();
        $this->load->model("yc4_category");
        $ca_info = $this->yc4_category->get_a_cat_tree($ca_id);

        $this->load->model("item");
        $items = $this->item->itemlist_by_ca_id($ca_id);
        for ($i=0; $i < count($items); $i++) { 
             $items[$i]['options'] = $this->item->item_price($items[$i]['it_id']);
        } 
        $token = $this->set_token();        
        $this->load->view("category/ca_list.php", array("items"=>$items, "ca_info"=>$ca_info, "ca_id"=>$ca_id, "token"=>$token));
        $this->load->view("shop.footer.php");
    }
    function include_tail($data=array()){
        //footer
        $error = $this->session->flashdata('error');
        $data['error'] = $error;
        $this->load->view("shop.footer.php", $data);

    }
    function include_head($plugins=array()){
        $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));

        if ( !$menus = $this->cache->get('menus'))
        {
            $this->load->model("yc4_category");
            $menus = $this->yc4_category->get_category_tree();

            // Save into the cache for 5 minutes
            $this->cache->save('menus', $menus, 300);
        }
        $this->load->view("shop.head.php", array("plugins"=>$plugins));
        $this->load->model('cart');
        $cart_list = $this->cart->ct_list();
        $total = $this->cart->total();
        $this->load->view("shop.nav.php", array("menus"=>$menus, "member"=>$this->session->userdata, "cart_list"=>$cart_list, "ct_total"=>$total));
        return $menus;
    }
 다음글 encrypt 문제 (2)
 이전글 js에서 컨트롤안에 함수 호출하는 방법.. (1)

댓글

변종원(웅파) / 2015/09/15 14:44:23 / 추천 0
로그 남기시는 것 같네요. (로그때문에 동일한 현상을 겪었습니다.)

로그 남기시면 에러만 남기도록 하거나 로그를 남기지 않도록 설정을 바꾸세요.
에반스 / 2015/09/15 14:58:53 / 추천 0
아, 로그 때문이었군요.
이제 더이상 서버 재설치는 안해도 되겠네요.
정말 감사합니다!
변종원(웅파) / 2015/09/15 15:57:47 / 추천 0
리눅스는 그런 현상이 없는데 윈도우에 설치하면 그런 현상이... ^^;
에반스 / 2015/09/15 19:40:43 / 추천 0
네 맞습니다! 리눅스 서버에 올리면 빠르게 잘 돌아가서 전혀 감을 잡지 못했는데...
일주일 짜리 고민이 해결되었습니다!
CI 기반으로 쇼핑몰 + POS + ERP 작업 중인데 덕분에 속도가 붙었습니다.
감사합니다!