TYPO3/Optimize performance

From Aimeos documentation

TYPO3
Other languages:
English 100% • ‎русский 74%

MySQL

Don't flush disc cache on every commit

When you are using the InnoDB storage engine for your TYPO3 tables, the default setting for innodb_flush_log_at_trx_commit can lead to a massive performance loss. This can happen because TYPO writes a lot of information to the cache tables and each INSERT/DELETE/UPDATE is followed by a fsync() which flushes the dirty pages to the hard disk and this is very slow.

If you set the value for innodb_flush_log_at_trx_commit to something else than the default value (which is "1"), then fsync() is called only every second.

innodb_flush_log_at_trx_commit = 2

The downside is that the system isn't ACID compliant any more and you will loose all writes of the last second when the server crashes. A value of "2" is a little bit safer than "0" because then you will only loose the last writes if the hardware or the operating system crashes and not if only the MySQL daemon dies.

Content

Use a different domain for static files

Browsers don't load all required files at once referenced inside a HTML document. Instead, they limit the number of concurrent requests for a single domain. To get around this, a common way is to make the files also available via a different domain, so the browsers will download more files in parallel. Thus, rendering the page is much faster for the user.

  • One way is to create a second virtual host configuration in your web server which uses a sub-domain like "static.example.com". The document root should point to the same directory as your main virtual host (e.g. example.com) in the file system to ease maintenance. Otherwise you would have to make sure that the files are in sync in both directories. If the internet connection to your customers is short and fast and your server is able to handle the load, this way is the preferred one - especially, if you are able to serve the files from a memory-based cache like Squid or Varnish.
  • Another option is to use a domain from a content delivery network (CDN) like Amazon Cloudfront. Usually, you can configure these services to retrieve the static files on the first request from your host and deliver them from their caches afterwards. The advantage of a CDN over a sub-domain on your own server is the load-balancing across many servers and the distribution from a server near to the visitors of your web site. Both can improve the speed of your web site a lot.

In both cases, you need to configure the Aimeos TYPO3 extension to create links to the product pictures with a different domain. This can be done via TypoScript like this:

  1. plugin.tx_aimeos.settings.client.html.common.content.baseurl = https://static.example.com/uploads/tx_aimeos/

You can also add some configuration to deliver the CSS and Javascript files from the second domain:

  1. page.includeCSS.tx_aimeos = https://static.example.com/typo3conf/ext/aimeos/Resources/Public/html/css/arcavias.css
  2. page.includeJSlibs.jquery = https://static.example.com/typo3conf/ext/aimeos/Resources/Public/html/js/jquery.min.js
  3. page.includeJSlibs.jquery-migrate = https://static.example.com/typo3conf/ext/aimeos/Resources/Public/html/js/jquery-migrate.js
  4. page.includeJSlibs.jquery-ui = https://static.example.com/typo3conf/ext/aimeos/Resources/Public/html/js/jquery-ui.custom.min.js
  5. page.includeJS.tx_aimeos = https://static.example.com/typo3conf/ext/aimeos/Resources/Public/html/js/arcavias.js
  6.  
  7. page.includeCSS.tx_aimeos.external = 1
  8. page.includeJSlibs.jquery.external = 1
  9. page.includeJSlibs.jquery-migrate.external = 1
  10. page.includeJSlibs.jquery-ui.external = 1
  11. page.includeJS.tx_aimeos.external = 1

See also