Suggestion required for performance

Ashutosh Pandey asked on June 13, 2020 11:52

We are having very slow website load times. Using JMeter, with 5 users, site load times goes to 10 seconds per page.

We have used codes like this at multiple places:

using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CMSConnectionString"].ConnectionString))
    {
        SqlDataAdapter adapter = new SqlDataAdapter(sql, con);

        DataTable dt = new DataTable();
        adapter.Fill(dt);

        repeaterCaseStudies.DataSource = dt;
        repeaterCaseStudies.DataBind();
    }

Question: Is above code optimized? Should we use SqlConnection object as static i.e. singleton?

Sometimes the queries are complex, and hence, need to write custom codes in web parts.

Any other suggestion?

Correct Answer

Brenden Kehren answered on June 13, 2020 15:58

The code above is not optimized. You should be using the Kentico Object Query API AND caching.

Also, a few other things to look at:

  • If the site was upgraded from previous versions, did the upgrades succeed?
  • Was the rosilyn compiler properly implemented?
  • What are the specifications of your web and database servers?
  • Are you optimizing your queries by adding where clauses and specifying the column to retrieve?
    " Lastly are you using Kentico best practices for optimizing your site?

If you want further info, that's typically where we start charging our clients for consulting and optimization of the website.

3 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on June 15, 2020 07:42

And I will just add another nice article on troubleshooting performance.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.