Forum
Slow request and process times
Hello,
I'm using Runway and the Shop app. On my development environment things are running fine. However, on a live server pages that display a product or a list of products are taking longer than expected to load; similar to Mike Harrison's issue.
On the product page, I am getting up to 7s request time on the live server and under a second on my development environment. It is not a light page by any means, I'm using (apart from global layouts and a shared region) perch_shop_product, perch_shop_products, perch_shop_variants, perch_shop_brand and perch_collection.
I tired removing everything except perch_shop_product to display the product, the global layouts and the shared region. I'm getting 1-2s request and process times (0.1s on development environment).
Is there anything I could do concerning Runway's setup?
Diagnostics report:
Perch Runway: 2.8.34
Production mode: Production (100)
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_gallery (2.8.6), perch_shop_orders (1.0.12), perch_shop_products (1.0.12), perch_shop (1.0.12), perch_members (1.5), perch_mailchimp (3.0.1)
DB driver: PDO
DB tables: perch2_backup_plans (0), perch2_backup_resources (0), perch2_backup_runs (0), perch2_categories (1), perch2_category_counts (0), perch2_category_sets (1), perch2_collection_index (104), perch2_collection_items (19), perch2_collection_revisions (6), perch2_collections (1), perch2_content_index (125), perch2_content_items (25), perch2_content_regions (8), perch2_gallery_albums (1), perch2_gallery_image_versions (48), perch2_gallery_images (8), perch2_mailchimp_campaigns (0), perch2_mailchimp_imports (0), perch2_mailchimp_lists (1), perch2_mailchimp_subscribers (2), perch2_mailchimp_subscriptions (2), perch2_mailchimp_webhooks (1), perch2_members (2), perch2_members_forms (1), perch2_members_member_tags (0), perch2_members_sessions (0), perch2_members_tags (0), perch2_navigation (1), perch2_navigation_pages (3), perch2_page_routes (3), perch2_page_templates (12), perch2_pages (11), perch2_resource_log (72), perch2_resource_tags (0), perch2_resources (79), perch2_resources_to_tags (0), perch2_settings (34), perch2_shop_addresses (4), perch2_shop_admin_index (32), perch2_shop_brands (2), perch2_shop_cart (50), perch2_shop_cart_data (12), perch2_shop_cart_items (9), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (2), perch2_shop_emails (1), perch2_shop_index (2196), perch2_shop_option_values (9), perch2_shop_options (2), perch2_shop_order_items (4), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (2), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (29), perch2_shop_product_options (12), perch2_shop_product_tags (0), perch2_shop_products (39), perch2_shop_promotions (0), perch2_shop_search (7), perch2_shop_shipping_zone_countries (1), perch2_shop_shipping_zones (2), perch2_shop_shippings (1), perch2_shop_tax_exhibits (8), perch2_shop_tax_group_rates (4), perch2_shop_tax_groups (2), perch2_shop_tax_locations (2), perch2_shop_tax_rates (3), perch2_shop_variants (66), perch2_user_passwords (1), perch2_user_privileges (71), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (2)
Users: 2
PHPMailer: 5.2.21
App runtimes:
<?php
$apps_list = array(
'content',
'categories',
'perch_members',
'perch_shop',
'perch_gallery',
'perch_mailchimp',
);
Scheduled tasks for perch_mailchimp: import_data (1 mins)
Editor plug-ins: markitup
H1: 9ab69e06985262d9b7bd94ec13724bf3
L1: a3483b8220ff33d6f5fe1e3f26bc293a
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
headerColour: #000000
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.34: done
perch_shop_default_currency: 8
headerScheme: dark
update_runway_2.8.34: done
latest_version: 2.8.15
on_sale_version: 2.8.34
perch_gallery_update: 2.8.5
perch_shop_update: 1.0.12
perch_gallery_bucket_mode: single
perch_gallery_bucket: default
perch_members_login_page: /members/login.php?r={returnURL}
perch_mailchimp_api_key: ######
perch_mailchimp_campaign_url: /mailchimp/campaign/{campaignSlug}
perch_shop_price_tax_mode: exc
perch_shop_trade_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /products/{slug}
perch_shop_invoice_number_format: Invoice%d
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_gallery_basicUpload: 0
perch_shop_reporting_currency: 8
perch_mailchimp_secret: 7020639
perch_members_update: 1.4
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: /home/hvnhellc/public_html
PERCH_SCHEDULE_SECRET: MFYXGU6idyPf8t4U
PERCH_DB_USERNAME: hvnhellc_dev
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: hvnhellc_cms
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: info@hvn-hell.com
PERCH_EMAIL_FROM_NAME: Heaven and Hell
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/hvnhellc/public_html/perch
PERCH_CORE: /home/hvnhellc/public_html/perch/core
PERCH_RESFILEPATH: /home/hvnhellc/public_html/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_TZ: Australia/Adelaide
PERCH_DEBUG: 1
PERCH_RUNWAY: 1
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/hvnhellc/public_html/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_SHOP_VERSION: 1.0.12
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS
PHP: 5.5.38
Zend: 2.5.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.6.23
MySQL server: 5.6.23-cll-lve
Free disk space: 248.14 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, cgi-fcgi, bcmath, dom, fileinfo, gd, imap, intl, json, exif, mcrypt, mysql, mysqli, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, soap, sockets, tidy, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader, Zend OPcache, Zend Guard Loader
GD: Yes
ImageMagick: No
PHP max upload size: 128M
PHP max form post size: 128M
PHP memory limit: 768M
Total max uploadable file size: 128M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
DOCUMENT_ROOT: /home/hvnhellc/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTPS: on
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-GB,en-US;q=0.8,en;q=0.6,ar;q=0.4
HTTP_CONNECTION: keep-alive
HTTP_COOKIE: p_m=; geo=United+Arab+Emirates; cmsa=1; PHPSESSID=4ftlgpuat34haopklm7s0obkn4
HTTP_HOST: hvn-hell.com
HTTP_REFERER: https://hvn-hell.com/perch/core/settings/diagnostics/
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
PATH: /bin:/usr/bin
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 92.98.242.41
REMOTE_PORT: 63369
REQUEST_METHOD: GET
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/hvnhellc/public_html/perch/core/settings/diagnostics/index.php
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
SERVER_ADDR: 66.198.253.174
SERVER_ADMIN: webmaster@hvn-hell.com
SERVER_NAME: hvn-hell.com
SERVER_PORT: 443
SERVER_PROTOCOL: HTTP/1.1
SERVER_SOFTWARE: Apache
SSL_TLS_SNI: hvn-hell.com
UNIQUE_ID: WKl0XELG8BUAB43m8sYAAAIX
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1487500380.8503
REQUEST_TIME: 1487500380
Product page after removing everything except perch_shop_product and global stuff:
<?php if (!defined('PERCH_RUNWAY')) include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php');
//$title = perch_shop_product(perch_get('s'), [ 'template' => 'products/title.html' ], true);
perch_layout('global/head', [
'siteName'=>' - Heaven & Hell',
//'title'=>$title,
]);
?>
<body>
<div class="page-wrapper">
<?php
perch_layout('global/header', ['nav-level' => 1,]);
perch_shop_product(perch_get('s'), [
'template' => 'products/product_page.html',
]);
perch_content('Subscription Form');
?>
</div>
<?php perch_layout('global/footer'); ?>
Debug message:
Debug Message
[11] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID ORDER BY pr.routeOrder ASC, p.pagePath ASC
Matched route: products/[slug:cat]/[slug:s]
Using master page: /templates/pages/product.php
Page arguments:
Array
(
[0] => /products/heaven-hell-vol-1/103
[cat] => heaven-hell-vol-1
[1] => heaven-hell-vol-1
[s] => 103
[2] => 103
)
[1] SELECT * FROM perch2_pages WHERE pagePath='/products/product' LIMIT 1
[1] SELECT * FROM perch2_shop_cart WHERE cartID=53
[1] SELECT * FROM perch2_shop_cart WHERE cartID=53
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
[3] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/products/product' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-002-001', '000-002', '000') ORDER BY pageTreePosition DESC
[3] Using template: /templates/navigation/item.html
[1] SELECT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_shop_index idx JOIN perch2_shop_products main ON idx.itemID=main.productID AND idx.itemKey='productID' JOIN perch2_shop_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='productID' AND idx2.indexKey='_id' WHERE 1=1 AND ((idx.indexKey='slug' AND idx.indexValue=103)) AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey ) as tbl WHERE (productDeleted IS NULL AND productStatus=1 AND parentID IS NULL) GROUP BY itemID, sortval ORDER BY sortval ASC
[33] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[1] Using template: /templates/shop/products/product_page.html
[6] SELECT productID, productVariantDesc, stock_level FROM perch2_shop_products WHERE parentID=12 AND productDeleted IS NULL ORDER BY productOrder ASC
[2] SELECT o.* FROM perch2_shop_options o, perch2_shop_product_options po WHERE o.optionID=po.optionID AND po.productID=12 AND o.optionDeleted IS NULL ORDER BY optionPrecendence ASC
[3] SELECT valueID AS id, valueTitle AS title, valueSKUCode AS skucode FROM perch2_shop_option_values WHERE optionID=1 AND valueDeleted IS NULL ORDER BY valueOrder ASC
[2] SELECT pov.prodoptID, pov.optionID, pov.valueID, o.optionTitle, ov.* FROM perch2_shop_product_option_values pov, perch2_shop_options o, perch2_shop_option_values ov WHERE pov.productID='12' AND pov.optionID=o.optionID AND pov.valueID=ov.valueID AND o.optionDeleted IS NULL AND ov.valueDeleted IS NULL AND o.optionID='1' ORDER BY o.optionPrecendence ASC, ov.valueOrder ASC
[6] SELECT valueID AS id, valueTitle AS title, valueSKUCode AS skucode FROM perch2_shop_option_values WHERE optionID=2 AND valueDeleted IS NULL ORDER BY valueOrder ASC
[2] SELECT pov.prodoptID, pov.optionID, pov.valueID, o.optionTitle, ov.* FROM perch2_shop_product_option_values pov, perch2_shop_options o, perch2_shop_option_values ov WHERE pov.productID='12' AND pov.optionID=o.optionID AND pov.valueID=ov.valueID AND o.optionDeleted IS NULL AND ov.valueDeleted IS NULL AND o.optionID='2' ORDER BY o.optionPrecendence ASC, ov.valueOrder ASC
[1] SELECT * FROM perch2_shop_currencies WHERE currencyID=8 LIMIT 1
[1] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/products/product' OR regionPage='*' ORDER BY regionPage DESC
[1] SELECT groupID FROM perch2_navigation WHERE groupSlug='footer' LIMIT 1
[3] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 ORDER BY np.pageTreePosition ASC
[0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/products/product' LIMIT 1
[3] Using template: /templates/navigation/item-footer.html
Request time: 1.5327
Process time: 1.5319
Memory: 2.2256
Is the data the same between the two environments?
Nothing majorly different. Number of products is different, but low in both environments. Slightly different text and some products have more pictures on the live server.
There's one thing that is set up differently. The products are sequentially named 101, 102, 103, etc (manually entered). SKU and Title have the same values (e.g. both are 102). Locally I used the automatically generated slugs SKU-title (e.g. 102-102), but manually changed them to only include the title (e.g. 102) for cleaner URLs.
Do you think this might be the source of the problem?
That shouldn't make a difference at all.
Are you able to switch in to dev mode? If you do that the debug will include various timing points which might point to the cause of the slowness.
https://docs.grabaperch.com/perch/configuration/perch/
I was wondering how to display the timing points!
Here is the debug messages for a couple of products on the live server:
1
2
And here's one from the development environment for comparison:
Is there any impact if you add this to your options?
Adding the filter-mode to the options doesn't seem to have changed much:
Is the production server shared with other sites? I'm wondering what might impact its performance. Anything in the MySQL logs?
Yes, it is a shared server. Since it's a shared server I don't have access to the MySQL logs. I've contacted the hosting company's support team and they're looking into it. I'll let you know how things go.
By the way, I just found out my client's web host is recommended by Perch. I realise the recommendation does not include the use of Runway or the Shop app on there, so not sure if this piece of information is even helpful.
It would be interesting to hear what they suggest.
Prior to giving them access I switched back to the full product page that takes ~7s to load. They confirmed how slow it is (took ~9s TTFB for them).
They checked the load on the server:
They also used GTmetrix to test the product page's performance, gave me a link to the test's results and advised me to follow the suggestions on there. The suggestions included:
The remainder of their response:
Right, basically that's just saying what we already know, which is that the page is taking a while to compile.
Yep exactly. That's why I got in touch with them again and they were happy to look into it again. They ended up tweaking the MySQL settings which has drastically improved the performance.
I'm now getting between 0.5s and 2s request time for the full product page that used to get over 7s.
That sounds promising!
Could you ask your host to share the configuration changes? Had the opposite problem. Very slow on local and fast on shared hosting.