Matomo.php always > 1second
-
Hi, I have been playing around with Matomo for a few weeks and have now used GTMetrix to analyse my site’s performance (for a different reason).
I have noticed, that a request to …matomo.php?… consistently takes more than 1 second to execute, effectively extending the load time of my site by 25%.
See an example request here (took over 2 seconds):
https://dev.peoplesfactory.com/wp-content/plugins/matomo/app/matomo.php?action_name=People%27s%20Factory%20-%20Making%20is%20a%20Lifestyle!&idsite=1&rec=1&r=455984&h=2&m=46&s=25&url=https%3A%2F%2Fdev.peoplesfactory.com%2F&_id=b79923e9653c4880&_idts=1591782386&_idvc=1&_idn=0&_refts=0&_viewts=1591782386&send_image=1&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=0&java=0&gears=0&ag=0&cookie=1&res=1367×863>_ms=300&pv_id=rm7Uw8Is there any setting I can look at to bring this down?
AndreasThe page I need help with: [log in to see the link]
-
Typically these kinda requests should take anything between 30ms and 300ms. 1s is not quite normal @awilmsmeier
Is there a chance you could send us a system report see https://matomo.org/faq/wordpress/how-do-i-find-and-copy-the-system-report-in-matomo-for-wordpress/ ? Either as a comment here or by email to wordpress at matomo.org ?
By any chance: Do you know how much CPU your server has and if it has an SSD disk?
BTW just wanted to let you know that in next version we also updated the tracking code so it won’t delay the load event or slow down your site. We’ve made this change in https://github.com/matomo-org/wp-matomo/pull/307/files
Hi, See the system report below, hope this help
I’m OK to wait for the next release and re-test – let me know when this will be out…—-
# Matomo* Matomo Plugin Version: 1.1.2
* Config exists and is writable.: Yes (“$ABSPATH/wp-content/uploads/matomo/config/config.ini.php” )
* JS Tracker exists and is writable.: Yes (“$ABSPATH/wp-content/uploads/matomo/matomo.js” )
* Plugin directories: Yes ([{“pluginsPathAbsolute”:”$ABSPATH\/wp-content\/plugins\/matomo\/plugins”,”webrootDirRelativeToMatomo”:”..\/”}])
* Tmp directory writable: Yes ($ABSPATH/wp-content/cache/matomo)
* Matomo Version: 3.13.6
* Matomo Blog idSite: 1
* Matomo Install Version: No## Endpoints
* Matomo JavaScript Tracker URL: ($site_url/wp-content/uploads/matomo/matomo.js)
* Matomo JavaScript Tracker – WP Rest API: ($site_url/wp-json/matomo/v1/hit/)
* Matomo HTTP Tracking API: ($site_url/wp-content/plugins/matomo/app/matomo.php)
* Matomo HTTP Tracking API – WP Rest API: ($site_url/wp-json/matomo/v1/hit/)## Crons
* Server time: 2020-06-12 06:35:10
* Blog time: 2020-06-12 08:35:10 (Below dates are shown in blog timezone)
* Sync users & sites: Next run: 2020-06-12 13:29:46 (4?hours?54?min) ( Last started: 2020-06-11 13:30:58 (-19?hours?4?min). Last ended: 2020-06-11 13:30:58 (-19?hours?4?min). Interval: daily)
* Archive: Next run: 2020-06-12 09:29:46 (54?min?36s) ( Last started: 2020-06-12 08:31:37 (-3?min?33s). Last ended: 2020-06-12 08:31:40 (-3?min?30s). Interval: hourly)
* Update GeoIP DB: Next run: 2020-07-10 13:29:46 (28?days?4?hours) ( Last started: 2020-06-10 13:32:20 (-1?days?19?hours). Last ended: 2020-06-10 13:32:23 (-1?days?19?hours). Interval: matomo_monthly)## Mandatory checks
* PHP version >= : ok
* PDO extension: ok
* PDO\MYSQL extension: ok
* MYSQLI extension: ok
* Other required extensions: ok
* Required functions: ok
* Required PHP configuration (php.ini): ok
* Directories with write access: ok
* Directories with write access for Tag Manager: ok## Optional checks
* Tracker status: ok
* Memory limit: ok
* Time zone: ok
* Open URL: ok
* PageSpeed disabled: ok
* GD > 2.x + Freetype (graphics): ok
* Other extensions: ok
* Other functions: ok
* Warning Filesystem: warning (Your server is using an NFS filesystem. This means Matomo will be extremely slow when using file based sessions. )
* Archive Cron: ok
* Last Successful Archiving Completion: ok
* Warning Max Packet Size: warning (It is recommended to configure a ‘max_allowed_packet’ size in your MySQL database of at least 64MB. Configured is currently 16MB. )
* Geolocation: ok
* Update over HTTPS: ok
* Writable JavaScript Tracker (“/matomo.js”): ok
* Supports Async Archiving: No
* Location provider ID: geoip2php
* Location provider available: Yes
* Location provider working: Yes
* Had visit in last 5 days: Yes## Matomo Settings
* Track mode: default
* Track codeposition: footer
* Track api endpoint: default
* Track js endpoint: default
* Version history: 1.1.2, 1.1.1, 1.1.0, 1.0.6
* Core version: 3.13.6
* Last tracking settings update: 1591781437
* Last settings update: 1591781437
* Show get started page: 0
* Track search: Yes
* Track 404: Yes
* Track admin: Yes## Logs
* None:
# WordPress
* Home URL: $site_url
* Site URL: $site_url
* WordPress Version: 5.4.2
* Number of blogs: 1
* Multisite Enabled: No
* Network Enabled: No
* WP_DEBUG: Yes
* WP_DEBUG_DISPLAY: No
* WP_DEBUG_LOG: Yes
* DISABLE_WP_CRON: –
* FORCE_SSL_ADMIN: Yes
* WP_CACHE: Yes
* CONCATENATE_SCRIPTS: –
* COMPRESS_SCRIPTS: –
* COMPRESS_CSS: –
* ENFORCE_GZIP: –
* WP_LOCAL_DEV: –
* DIEONDBERROR: –
* WPLANG: –
* ALTERNATE_WP_CRON: –
* WP_CRON_LOCK_TIMEOUT: 60
* WP_DISABLE_FATAL_ERROR_HANDLER: –
* Permalink Structure: /%postname%/
* Possibly uses symlink: No
* Compatible content directory: Yes# WordPress Plugins
## MU Plugins
* aaa-wp-cerber.php: 1.0
## Plugins
* Add-on WooCommerce MailPoet 3: 1.1.7
* Advanced Order Export For WooCommerce: 3.1.4
* Ajax Search Lite: 4.8.1
* Async JavaScript: 2.20.03.01
* Autoptimize: 2.7.3
* Breeze: 1.1.6 (Network enabled)
* Broken Link Checker: 1.11.13
* Cache Enabler: 1.3.5
* Duplicate Post: 3.2.4
* Duplicator: 1.3.34
* Easy HTTPS (SSL) Redirection: 1.9.1
* Email Address Encoder: 1.0.21
* Enable Media Replace: 3.4.0
* EventON: 2.8.5
* EventON – Event Lists Ext: 0.15
* EventON – Event Reviewer: 1.0.2
* EventON – Event Tickets: 1.7.10
* Event Tickets: 4.12.1.2
* Hummingbird: 2.4.2 (Network enabled)
* Image Cleanup: 1.9.2
* Juicer: 1.9.1
* Kadence Blocks – Gutenberg Page Builder Toolkit: 1.8.5
* Kadence Blocks Pro: 1.4.9
* Kadence Custom Fonts: 1.0.3
* Kadence WooCommerce Email Designer: 1.4.1
* Kadence WooCommerce Extras: 1.6.9
* MailPoet 3 (New): 3.47.4
* Maps Block for Gutenberg: 1.30
* Matomo Analytics – Ethical Stats. Powerful Insights.: 1.1.2
* Media Cleaner: 5.6.3
* Modern Events Calendar Lite: 5.6.0
* Rate my Post – WP Rating System: 3.2.1
* Search Regex: 2.1
* ShortPixel Image Optimizer: 4.19.2
* Site Reviews: 4.6.3
* Slimstat Analytics: 4.8.8.1
* SmartCrawl: 2.6.1 (Network enabled)
* Swift Performance Lite: 2.1.3
* The Events Calendar: 5.1.2.1
* The SEO Framework: 4.0.7
* Ultimate Addons for Gutenberg: 1.15.2
* UpdraftPlus – Backup/Restore: 1.16.25
* W3 Total Cache: 0.14.1 (Network enabled)
* WooCommerce: 4.2.0
* WooCommerce Multilingual: 4.9.0
* WooCommerce PDF Invoices & Packing Slips: 2.5.1
* WooCommerce Stripe Gateway: 4.4.0
* WOOF – WooCommerce Products Filter: 1.2.4
* WP-DBManager: 2.80.3
* WP-PostRatings: 1.88
* WP All Import: 3.5.3
* WP Cerber Security, Antispam & Malware Scan: 8.6.5 (Network enabled)
* WPML All Import: 2.1.1
* WPML Media: 2.5.5
* WPML Multilingual CMS: 4.3.15
* WPML String Translation: 3.0.11
* WPML Support Toolbox: 1.0.5
* WPML Translation Management: 2.9.8
* WP Statistics: 12.6.13
* WP Super Cache: 1.7.1
* WP User Avatar: 2.2.6
* XCloner – Site Backup and Restore: 4.2.0
* Active Plugins: 39 (sitepress-multilingual-cms add-on-woocommerce-mailpoet ajax-search-lite async-javascript autodescription autoptimize broken-link-checker cache-enabler duplicate-post duplicator email-address-encoder enable-media-replace event-tickets https-redirection kadence-blocks-pro kadence-blocks kadence-woocommerce-email-designer mailpoet map-block-gutenberg matomo search-regex the-events-calendar ultimate-addons-for-gutenberg updraftplus woo-order-export-lite woocommerce-gateway-stripe woocommerce-multilingual woocommerce-pdf-invoices-packing-slips woocommerce-products-filter woocommerce wp-all-import wp-cerber wp-user-avatar wpml-all-import wpml-media-translation wpml-string-translation wpml-support-toolbox wpml-translation-management xcloner-backup-and-restore)# Server
* Server Info: Apache
* PHP OS: FreeBSD
* PHP Version: 7.3.18
* PHP SAPI: cgi-fcgi
* PHP Binary Name: php-cgi
* PHP Found Binary: php -q
* Timezone: UTC
* WP timezone: Europe/Zurich
* Locale: en_US
* User Locale: en_US
* Memory Limit: 256M (At least 128MB recommended. Depending on your traffic 256MB or more may be needed.)
* WP Memory Limit: 256M
* WP Max Memory Limit: 256M
* Time: 1591943711
* Max Execution Time: 30
* Max Post Size: 16M
* Max Upload Size: 16777216
* Max Input Vars: 1000
* Disabled PHP functions: No
* zlib.output_compression is off: Yes
* Curl Version: 7.70.0, OpenSSL/1.1.1g
* Suhosin installed: No# Database
* MySQL Version: 5.5.5
* Mysqli Connect: Yes
* Force MySQL over Mysqli: No
* DB Prefix: wp_
* DB CHARSET: utf8mb4
* DB COLLATE:
* SHOW ERRORS: No
* SUPPRESS ERRORS: No
* Uses Socket: No
* Uses IPv6: No
* Matomo tables found: 281
* Matomo users found: 3
* Matomo sites found: 1
* Required permissions: OK# Browser
* Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15
* Language: de-chThanks for this. BTW do you know with what hoster you are with? And what package you have there?
Yes, of course.
We are hosting at https://www.hostpoint.ch, the package is “Smart Webhosting (inkl. SITES Limited)”
So far, performance has been reasonable and sufficient for our purposes.@awilmsmeier I just checked the link you sent again. It looks like the first request took 1s but then the next following request took only about 400-500ms for me. It’s possible on the first request that Matomo’s caches were empty and Matomo had to warm up all caches on the first request.
As mentioned we’ve already made some tweak for the next release so it won’t delay the page load time anymore. We’ve just now also improved our caches so they aren’t regenerated as often.
We also measured the performance to check what code exactly takes how much time. Out of 500ms, 65% of the time was actually spent loading WordPress itself. Depending on which plugins you use and how many plugins you use this may slow it down further.
If you were using a [standalone Matomo On-Premise](https://matomo.org/docs/installation/) (which is also free), then you could expect the request time to be 50-150ms depending on your server.
Generally, we recommend using Matomo On-Premise if you track a lot of page views (or visits) as it can make quite a difference in terms of having faster tracking requests and therefore also less CPU usage on your server. If you’re maybe having say 50000 page views a month or less then it likely wouldn’t be worth the effort of installing Matomo On-Premise though.
Does this maybe help?
Thanks for following up. I will try the update once it is available. Installing Matomo separately does not seem to make sense for me right now, given the number of visits and that we are re-launching our web site in a few weeks from now. But good to know that this is a better option with higher traffic volumes.
It’s a bit of a surprise that WordPress should take up so much time – shouldn’t that be the same for all requests to our site? Not just for requests to Matomo components? Haven’t seen that in GTMETRIX…
Thanks again …
> It’s a bit of a surprise that WordPress should take up so much time – shouldn’t that be the same for all requests to our site? Not just for requests to Matomo components? Haven’t seen that in GTMETRIX…
Really depends on the server but yes unfortunately it is that.
In my case
load_default_textdomain
took alone approx 110ms (see eg https://paste.pics/f2e2a87e5723f954f28bc67efa31d7f6)
wp_widgets_init
took 30ms
create_initial_post_types
took 30ms
translating some strings took 30ms (see eg https://paste.pics/4ddbf670af81ef6f1b4727dba2376b39 )etc it all sums up. In reality the numbers might be slightly less since the so called profiler that measures this time itself would add a bit time on top.
- The topic ‘Matomo.php always > 1second’ is closed to new replies.