Speeding up Prestashop: Database Requests Amount

Apr 17, 2014290
Speeding up Prestashop: Database Requests Amount

Our clients very often ask us why their stores don’t work as fast as they want. Sometimes the bottleneck of store’s performance is its database. Some modules create a lot of non-optimized requests. Today we will speak about the ways of showing the amount of database requests.

One of the ways will help us find out if your database is overloaded. Before installing new module we recommend to check how many requests was there before and after the procedure.

So, method DB::getInstance() is responsible for every database request, so we’ll install our calculator exactly in this method. To do that let’s set $queries variable in the beginning of the method:

Add increment operation of the amount of database requests in method DB::getInstance():

Let’s also add static method DB:: getCount() to count the database requests:

Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey

To display information on the amount of requests you also have to edit file footer.tpl of your theme:

For example, Prestashop-based store that has more than 10 installed modules produces 123 requests on the product’s page with cache off and 113 requests with cache on: http://belvg.info/demo/prestashop16/breadcrumbs/en/blouses/2-blouse.html

1Speeding up Prestashop

footer.tpl

db.php

What were your results? Share your experience in the comments below!


Partner With Us Looking for a partner that will help you to grow your business? We are the right company to develop your webstore. Feel free to get in touch with us. We will be happy to discuss your business opportunities and provide you with a Free Quote. Talk to Andrey

Post a new comment

top
BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *