We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    I’m putting some final touches to a community based site that I have wrote all the snippets and ajax for and I was wondering about the performance of my coding.

    The profile editing page is completely handled by sending inputs via ajax and I started to wonder about the performance of making a lot of requests to a database. What would be considered a lot of requests per page/script to carry out?

    One page I have which is quite heavy on database queries gave these results and wondered if someone could shed some light on whether or not this is too much.

    MySQL: 0.0304 seconds
    91 request(s)
    PHP: 0.2444 seconds
    total: 0.2748 seconds

    I do have a dedicated server specifically for this site so I don’t have to worry about shared hosting issues.

    Thanks
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 22303 MODX Staff
      • 10,725 Posts
      That’s definitely a lot of requests, especially if that is just one of many (AJAX) requests being made from that page. But ultimately, you have to take a holistic view to performance of dynamic pages. There’s no easy answer. If it’s too slow when you actually use it is the still the best indicator IMO. If it is, then start seeing where you can optimize it.
        • 25551 ☆ A M B ☆
        • 1,231 Posts
        Thanks OG, I tidied up some of the coding and it’s down to 34 request now... still roughly the same time to execute. Most of the requests are 1 or 2 characters and being used in json feeds.

          Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
          AugmentBLU - MODX Partner

          BLUcart - MODX Revolution E-Commerce & Shopping Cart