Why data is loading slower in LIVE website?

Why data is loading slower in LIVE website?

iftikharuddiniftikharuddin Posts: 18Questions: 5Answers: 0
edited January 2019 in Free community support

I'm trying to load data from a table which contains 3k records. Data loads very fast in local server but when i deployed my code to server (live website) it takes 20-30 seconds to load the whole data.

My code:

```ajaxUrl: '<?php echo $this->MyHelper->Route('admin-get-blog-articles-faq')?>',
        columns: [
            my.common.admin.tableEditColumn('id'),
            { data: 'question' },
            { data: 'created_at' }
        ],```

Table code:

```<table id="records-table" class="table table-striped table-bordered" width="100%">
                                <thead>
                                    <tr>
                                        <th></th>
                                        <th class="hasinput">
                                            <input type="text" class="form-control filter" placeholder="Question">
                                        </th>
                                        <th class="hasinput">
                                            <input type="text" class="form-control filter" placeholder="Date Created">
                                        </th>
                                    </tr>
                                    <tr>
                                        <th></th>
                                        <th class="all">Question</th>
                                        <th class="all">Date Created</th>
                                    </tr>
                                </thead>
                                <tbody></tbody>
                            </table>```

Controller func:

```public function getBlogArticlesFaqAction() {

    //Get all Blog Articles FAQ from DB
    $blogArticlesFaq = BlogArticleFaqModel::getAllForDataTable(array('id', 'question', 'created_at'));

    // Return data array
    return array('data' => $blogArticlesFaq);
}```

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @iftikharuddin ,

    It could be any part of the process:

    1. the client I assume is the same, so can be ruled out
    2. is the network slow to/from the new server?
    3. is the database slower? indexes? other usage?
    4. is the server itself the same spec? and being used elsewhere?

    The best bet is to profile each of those and find the differences.

    Cheers,

    Colin

This discussion has been closed.