Forum

Thread tagged as: Question

Timing output in page debug changes?

Hi,

I'm trying to debug a page speed issue.

I'm using define('PERCH_PRODUCTION_MODE', PERCH_DEVELOPMENT); to display the timing output in the page debug. Very useful.

I'm running into an issue, when I first load a page I can clearly see what parts of the page are slow.

Before I make any changes, I reload the page and the timing output changes?

Is this related to php cache? I'm developing locally using MAMP Pro.

Trying to figure out if it's something I need to change in Perch (if so, how?), or is this something I need to resolve in MAMP Pro?

Here's a screenshot showing the page debug on page load and refresh.

Perch Screenshot

Perch information

Perch Runway: 3.0.14
Production mode: Development (10)
Installed apps: content (3.0.14), assets (3.0.14), categories (3.0.14), perch_forms (1.10)
DB driver: PDO
DB tables: perch2_backup_plans (1), perch2_backup_resources (1), perch2_backup_runs (5656), perch2_blog_authors (2), perch2_blog_comments (0), perch2_blog_index (69), perch2_blog_posts (3), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blog_webmention_queue (0), perch2_blogs (2), perch2_categories (9), perch2_category_counts (0), perch2_category_sets (5), perch2_collection_index (205383), perch2_collection_items (1192), perch2_collection_revisions (186), perch2_collections (6), perch2_content_index (1803), perch2_content_items (166), perch2_content_locks (0), perch2_content_regions (23), perch2_forms (8), perch2_forms_responses (1431), perch2_jw_activity_log_actions (1266), perch2_menu_items (18), perch2_navigation (2), perch2_navigation_pages (4), perch2_page_routes (29), perch2_page_templates (27), perch2_pages (29), perch2_resource_log (18335), perch2_resource_tags (5), perch2_resources (3043), perch2_resources_to_tags (5), perch2_scheduled_tasks (26), perch2_settings (38), perch2_user_passwords (0), perch2_user_privileges (44), perch2_user_role_buckets (0), perch2_user_role_privileges (27), perch2_user_roles (2), perch2_users (8)
Users: 8
App runtimes:
<?php
    $apps_list = array(
        'perch_forms',

    );
Scheduled tasks for Backup: plan_2 (10 mins)
Editor plug-ins:
H1: ba167287ed9b818e6008ad2765e5121e
L1: 3fabca5af968c99f35bc9d5a1464a963
F1: 3b606135b33e6a102526838f4152a807
headerColour: #000000
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.8.13: done
update_runway_2.8.15: done
headerScheme: dark
update_runway_2.8.13: done
latest_version:
on_sale_version:
dashboard: 0
hide_pwd_reset: 1
content_hideNonEditableRegions: 0
content_frontend_edit: 1
logoPath: /perch/resources/logo.png
perch_blog_update: 5.6
perch_blog_post_url: /blog/post.php?s={postSlug}
update_runway_2.8.16: done
update_runway_2.8.17: done
update_runway_2.8.18: done
update_runway_2.8.24: done
update_runway_2.8.25: done
update_runway_2.8.26: done
update_runway_2.8.27: done
perch_blog_site_name:
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
update_runway_2.8.30: done
jw_activity_log_prune_time: 30
update_runway_2.8.31: done
update_runway_2.8.32: done
update_runway_3.0.8: done
update_runway_3.0.14: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_SITEPATH: /Users/stephen/Repositories/my-site
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: XXXXXX_
PERCH_DB_PREFIX: perch2_
PERCH_EMAIL_FROM: XXXXXXX
PERCH_EMAIL_FROM_NAME: XXXXXXXXX
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/stephen/Repositories/my-site/perch
PERCH_CORE: /Users/stephen/Repositories/my-site/perch/core
PERCH_RESFILEPATH: /Users/stephen/Repositories/my-site/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_TZ: Europe/London
PERCH_RWD: 1
PERCH_SCHEDULE_SECRET: XXXXXXXXXXXXX
PERCH_CLEAN_RESOURCES:
PERCH_EMAIL_METHOD: smtp
PERCH_EMAIL_HOST: smtp.mailtrap.io
PERCH_EMAIL_SECURE: tls
PERCH_EMAIL_AUTH: 1
PERCH_EMAIL_PORT: 2525
PERCH_EMAIL_USERNAME: XXXXXXXXXXXXX
PERCH_GMAPS_API_KEY: XXXXXXXXXXXXX
PERCH_PRODUCTION_MODE: 10
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_ASSET_VERSION: f704e7442d11292c99b5
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/stephen/Repositories/my-site/perch/templates
PERCH_TEMPLATE_FILTERS:
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_XHTML_MARKUP:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_DEFAULT_BUCKET: default
PERCH_TRANSLATION_ASSIST:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_PRIV_ASSIST:
PERCH_CUSTOM_EDITOR_CONFIGS:
PERCH_ENABLE_EXIF: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown

Hosting settings

PHP: 7.2.1
Zend: 3.2.0
OS: Darwin
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
MySQL server: 5.6.38
Free disk space: 28.98 GB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, readline, Reflection, mysqli, SimpleXML, soap, sockets, sodium, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, imap, gettext, pgsql, pdo_pgsql, igbinary, memcached
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
PHP_FCGI_CHILDREN: 4
PWD: /Applications/MAMP/fcgi-bin
PHP_FCGI_MAX_REQUESTS: 200
__CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x2
ORIG_SCRIPT_NAME: /fcgi-bin/php7.2.1.fcgi
ORIG_PATH_TRANSLATED: /Users/stephen/Repositories/my-site/perch/core/settings/diagnostics/index.php
ORIG_PATH_INFO: /perch/core/settings/diagnostics/index.php
ORIG_SCRIPT_FILENAME: /Applications/MAMP/fcgi-bin/php7.2.1.fcgi
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/?extended
QUERY_STRING: extended
REQUEST_METHOD: GET
SERVER_PROTOCOL: HTTP/1.1
GATEWAY_INTERFACE: CGI/1.1
REDIRECT_URL: /perch/core/settings/diagnostics/index.php
REDIRECT_QUERY_STRING: extended
REMOTE_PORT: 63565
SCRIPT_FILENAME: /Users/stephen/Repositories/my-site/perch/core/settings/diagnostics/index.php
SERVER_ADMIN: you@example.com
DOCUMENT_ROOT: /Users/stephen/Repositories/my-site
REMOTE_ADDR: ::1
SERVER_PORT: 80
SERVER_ADDR: ::1
SERVER_NAME: my-site.test
SERVER_SOFTWARE: Apache
PATH: /usr/bin:/bin:/usr/sbin:/sbin
HTTP_COOKIE: _ga=GA1.2.28092986.1521123071; _gid=GA1.2.545873990.1521123071; cmsa=1; PHPSESSID=3eonbs8191nl2cdms15357k2ie
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.9
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_REFERER: http://my-site.test/perch/core/settings/diagnostics/
HTTP_DNT: 1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_CONNECTION: keep-alive
HTTP_HOST: my-site.test
REDIRECT_STATUS: 200
REDIRECT_HANDLER: php-fastcgi
FCGI_ROLE: RESPONDER
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1521196003.8488
REQUEST_TIME: 1521196003
argc: 1
Stephen Meehan

Stephen Meehan 4 points

  • 11 months ago
Drew McLellan

Drew McLellan 2636 points
Perch Support

That'll be the MySQL query cache.

Ah, when I restart MAMP Pro and revisit a page I see gold and (a few) maroon performance indicators.

Pressing refresh hides all but one gold colour performance indicator.

During testing, is there a way to deactivate MySQL query cache?

I found this stackoverflow,

If you want to disable the Query cache set the 'query_cache_size' to 0 in your mysql configuration file . If its set 0 mysql wont use the query cache.

In MAMP Pro, go to File > MySQL, find query_cache_size mine was set to 16M, change it to 0. Restart MAMP.

It's not perfect, as all the performance warnings don't remain on page refresh, but the maroon ones do and for now, that's enough.

Drew McLellan

Drew McLellan 2636 points
Perch Support

Remember the warnings are on the deltas, so a highlighted item usually indicates that whatever proceeded that line was slower than expected.