Skip to content

Slow PrestaShop back office: causes and fixes, one by one

· The AYT team · 6 min read

Woman in sunglasses holding many shopping bags

A slow PrestaShop back office usually has one of five causes: debug mode or forced template compilation left on, too many modules (especially the ones on the start page, the Dashboard), statistics tables that grew for years, catalogues with a huge number of combinations, or a server without enough resources. Check them in this order, because the first ones take minutes to fix.

First, measure

Before you change anything, find out which page is slow and how slow:

  • Open your browser's developer tools (F12), the Network tab, and reload the back office page. The time for the first document shows how long the server worked. If an ordinary page takes several seconds, it's slow.
  • Compare a few pages: only the Dashboard, only the order list, only a product page, or the whole back office? One slow page points to a module or a table; every page slow points to settings or the server.
  • Compare with the shop: if the shop is slow too, the problem is more likely the server.

Cause 1: debug mode and Smarty settings

Debug mode noticeably reduces performance, and profiling (_PS_DEBUG_PROFILING_) even more. They are often left on after troubleshooting.

  1. Under Advanced Parameters → Performance, check "Debug mode". It should be No.
  2. In config/defines.inc.php, _PS_MODE_DEV_ and _PS_DEBUG_PROFILING_ should be false.
  3. Also under Performance, in Smarty: "Template compilation" set to "Never recompile template files" or "Recompile templates if the files have been updated", not "Force compilation". "Cache" on.

Each setting is covered in the articles on debug mode and clearing the cache.

Cause 2: modules

Every module can hook into back office pages, and some fetch data from external servers on every load. If the external server is slow to answer, your page waits for it.

  • The Dashboard loads statistics modules (dashactivity, dashtrends, dashgoals, dashproducts) that query the order and visitor tables. On a shop with years of data, the Dashboard is usually the slowest page. If you don't use the charts, disable the modules you don't need in Modules → Module Manager.
  • For a quick test, under Advanced Parameters → Performance, in the Modules section, click Disable next to "Disable non built-in modules" (on 1.7: "Disable non PrestaShop modules", in the Debug mode section). If the back office becomes fast, one of the third-party modules is the cause. Find it by turning them back on one at a time in the Module Manager. Careful: the option also turns off the shop's payment and courier modules, so run the test on a staging copy or at an hour with no orders.
  • Profiling (_PS_DEBUG_PROFILING_ set to true for a few minutes) shows on the page how much time each module takes.

Uninstall the modules you don't use. A disabled module no longer runs, but an uninstalled one also stops taking up tables and settings.

Cause 3: bloated statistics tables

The statistics module bundled with PrestaShop (statsdata) saves every visit in the ps_connections and ps_connections_source tables, and the pages-not-found module (pagesnotfound) saves every 404 in ps_pagenotfound. Together with ps_guest, after a few years they can hold millions of rows. The Dashboard and statistics read them, and every query on them gets slow.

Check the table sizes in phpMyAdmin, in the database's table list (the size column). If these are the largest tables in the database:

  1. Back up the database.
  2. Delete old rows from the connection and 404 tables, for example everything older than a year:
DELETE FROM ps_connections_source WHERE date_add < NOW() - INTERVAL 1 YEAR;
DELETE FROM ps_connections WHERE date_add < NOW() - INTERVAL 1 YEAR;
DELETE FROM ps_pagenotfound WHERE date_add < NOW() - INTERVAL 1 YEAR;
  1. Replace ps_ with your table prefix if it's different.

Don't empty the ps_guest table completely: carts and customers refer to it. And back office statistics for the deleted periods can't be rebuilt, so export them first if you need them.

If you don't look at the visit statistics in the back office, disable statsdata and pagesnotfound in the Module Manager: the tables stop growing altogether.

The log under Advanced Parameters → Logs (the ps_log table) also grows over time. If it has hundreds of thousands of rows, clean it up too.

Cause 4: the catalogue

A product with hundreds of combinations opens slowly in the back office, because the page loads every combination with its price and stock. The same goes for product or order lists with complex filters over tens of thousands of rows.

  • Show fewer rows per page in large lists (the pagination selector at the bottom of the list).
  • If you don't use combinations, features or customer groups, Advanced Parameters → Performance has options under "Optional features" to turn them off. PrestaShop notes there that these features can be disabled to improve performance.

Cause 5: the server

If the shop is slow too and none of the causes above apply, look at the hosting:

  • The PHP version: a newer version, within the range your PrestaShop supports, is usually faster. See PrestaShop hosting requirements.
  • memory_limit: at least 256M for PrestaShop 8 and 512M for 9.
  • The plan's limits: CPU, simultaneous PHP processes, RAM. If the resource graphs hit the ceiling exactly when you work in the back office, the plan is too small for the shop.

An object cache (Memcached) can help large shops, but it doesn't fix any of the causes above. More on that in the article on Redis and Memcached for PrestaShop.

A slow back office on AYT hosting

On AYT, the account's resource page shows CPU, memory and process graphs, and Site Performance shows how quickly the site responds. Compare them with the moments the back office is slow. The PHP version is chosen per site, memory_limit is changed in the php.ini editor, and PHP process limits are adjusted in the panel. You check and clean tables in phpMyAdmin, opened from the panel.

The Site Performance page in the panel

For PrestaShop 8 shops, the PrestaShop Toolkit lists modules with an off switch, has the Smarty and CCC options under Settings, and checks debug mode on its Security page. Redis is not offered for PrestaShop. See the plans on the hosting page and the toolkits on the features page.

More articles

All articles