Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthoroisucf
     
    Hello, has anyone noticed any changes in their Akelos application's performance/response time?

    I recently updated our application to use the latest nightly build and admin plugin. My application specific code has not really changed but it now runs a lot slower. Are there any recent commits over the last 3 months that would have potentially impacted performance?

    One of the things I have notices is the development log is filled with the following log entries over and over now:

    Tue, 04 Nov 2008 17:47:32 -0500 [MESSAGE] : SHOW TABLES
    Tue, 04 Nov 2008 17:47:32 -0500 [MESSAGE] : SHOW TABLES
    Tue, 04 Nov 2008 17:47:32 -0500 [MESSAGE] : SHOW TABLES
    Tue, 04 Nov 2008 17:47:32 -0500 [MESSAGE] : SHOW TABLES

    Any clues??

    -Daniel
    • CommentAuthoroisucf
     
    Anyone else notice this??
    • CommentAuthoroisucf
     
    This slowdown is due to a change between rev.977 and rev.1215 I'm running both versions in parallel and the response time for the exact same scaffold code is 4 time longer.
    • CommentAuthorinsanet
     
    is not like nobody want to talk about it, but what else can we do?, ActiveRecord has like 5000 lines. i already tried to see if a i find something. but whitout any developer involved at least saying what was their goal between these revisions (and explaining what tried to improve and posible went the other way). we are kinda stuck.
    • CommentAuthorpedro
     
    From what I could see, most changes in AkActiveRecord.php between mentioned revisions (977 vs. 1215) have to do with observers and model loading (from XML and JSON). One change that might have some impact on performance is database schema caching. I believe that by default this caching it's turned off in development mode. Did the perfomance loss you noticed took place while running in development mode?

    Suggestion -- try one or more of the following define()'s in your development.php file (these were taken from the production.php file), to check if they have significant impact on performance, and then post your findings in this thread:

    ak_define('ACTIVE_RECORD_ENABLE_PERSISTENCE', true);
    ak_define('ACTIVE_RECORD_CACHE_DATABASE_SCHEMA', true);
    • CommentAuthoroisucf
     
    Tried both ak_define('ACTIVE_RECORD_ENABLE_PERSISTENCE', true) and ak_define('ACTIVE_RECORD_CACHE_DATABASE_SCHEMA', true) got a timeout error. Something is looping and causing that [MESSAGE] : SHOW TABLES to be listed over and over in the log. Find that and we find the CPU Hog.
    • CommentAuthoroisucf
     
    I think is has something to do with this code in AkActiveRecord.php that was rewritten.

    }
    if(empty($_SESSION['__activeRecordColumnsSettingsCache']['available_tables']) ||
    !AK_ACTIVE_RECORD_ENABLE_PERSISTENCE){
    $_SESSION['__activeRecordColumnsSettingsCache']['available_tables'] = $this->_db->availableTables();
    }
    $available_tables = $_SESSION['__activeRecordColumnsSettingsCache']['available_tables'];
    }
    • CommentAuthoroisucf
     
    I think there is a bug in in AkActiveRecord.php: function setTableName. Below is the current code. When I replaced it with the code above I got a big speed boost and the the repeating SHOW TABLES is no longer written to the development log.

    }
    if (!AK_ACTIVE_RECORD_CACHE_DATABASE_SCHEMA || ($available_tables = AkDbSchemaCache::getAvailableTables()) === false) {
    $available_tables = $this->_db->availableTables();
    if (AK_ACTIVE_RECORD_CACHE_DATABASE_SCHEMA) {
    AkDbSchemaCache::setAvailableTables($available_tables);
    }
    }
    }
    • CommentAuthoroisucf
     
    I opened a ticket. #249
    •  
      CommentAuthorbermi
     

    Sorry for taking such a long time to fix this issue. Please update to rev.1245 to avoid this performance issue.

    By default now, development mode does not cache information on database schema.

    If you modify your database only via migrations, you can safely add

    define('AK_ACTIVE_RECORD_CACHE_DATABASE_SCHEMA', true);
    

    to your configuration file and you'll have the caching performance advantage available on production mode.

    • CommentAuthoroisucf
     
    Thanks Bermi !! That fix look a lot better than my rolling back to the old setTableName code. I will update when we go into production.