-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SS4 loadtimes significantly slower than SS3 version of exact same site #9937
Comments
Hi @micschk - thanks for taking the time to write up some thorough findings. Whilst it's clear that there has been a degredation in performance for your instance I will say that my experience of SS4 has been that it can be quite performant but this can depend on server set-up (for example php with opcache enabled, etc). The other thing to look at would be the number of DB requests that are being made per page-load and to see if there's a way to reduce those (template caching, will help here). Have you done any profiling to see where the processing time is happening? I'm also quite surprised at how big a difference there is between |
@dhensby Good points, thx for looking into this! The results initially appear similar:
Regarding your other remarks:
|
I'd also say this is probably related: #8603 |
Quick initial showqueries (as logged in user to put the sites in dev mode -> results in additional 'Member' queries and probably also in deactivating any partial caching):
|
This is interesting because it appears to show that the problem is not caused by the database layer and so coming from a different bottleneck. SS4 on vanilla looks like it should be faster when looking at the DB layer, but we are seeing double the TTFB and finish events... |
hi @micschk ! i highly recommend using https://github.com/lekoala/silverstripe-debugbar to troubleshoot these kind of issues. I recently added a couple of things like template rendering times that should allow you to see what's taking so long. Actually you could install it on your ss3 and ss4 version and see if you can pinpoint where the extra load comes from. |
Thomas (@lekoala), thanks for the suggestion. Your module is on my radar and todo list. And while it's probably the tool to dig deeper into this issue, I'd like to stress that the issue doesn't seem to be isolated to this specific custom system as the 'vanilla' installs show similar behaviour. |
A few diagnostic steps:
One change that might be relevant is SilverStripe's caching: in Silverstripe 4 it makes use of Symfony's cache system and there are a number of cache backends that it can use - its possible that proper optimisation of these is more important for getting good performance. |
In particular you probably want APC-based caching enabled. The code that configures this is in https://github.com/silverstripe/silverstripe-framework/tree/4/src/Core/Cache |
Basic performance testingSiege running against vanilla Silverstripe installations comparing latest Silverstripe 4 vs latest Silverstripe 3. NOTE: These tests were performed without OPCache on either configuration
ResultsSilverstripe 3 vanilla installation on average was approximately %20 faster than a Silverstripe 4 vanilla installation when comparing the average "Response time" from a basic siege test. Replicating TestsThis test used a vanilla installation of Silverstripe using Installing SilverstripeSilverstripe 4 $ composer create-project silverstripe/installer TestWebsitev4 Silverstripe 3 $ composer create-project silverstripe/installer TestWebsite ^3 Docker environmentBoth Silverstripe 4 and Silverstripe 3 use the same configuration with the only difference being
version: "3.8"
services:
silverstripe:
image: brettt89/silverstripe-web:7.4-apache
ports:
- "8080:80"
volumes:
- .:/var/www/html
depends_on:
- database
#
# For Silverstripe 4 installations use /var/www/html/public for DOCUMENT_ROOT
#
environment:
- DOCUMENT_ROOT=/var/www/html
- SS_TRUSTED_PROXY_IPS=*
- SS_ENVIRONMENT_TYPE=dev
- SS_DATABASE_SERVER=database
- SS_DATABASE_NAME=SS_mysite
- SS_DATABASE_USERNAME=root
- SS_DATABASE_PASSWORD=
- SS_DEFAULT_ADMIN_USERNAME=admin
- SS_DEFAULT_ADMIN_PASSWORD=password
database:
image: mysql:5.7
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
volumes:
- db-data:/var/lib/mysql
volumes:
db-data: NOTE: For Silverstripe 4 installations use Prepping EnvironmentDocker Compose is used to manage the environment for testing. Execute the following command at the project root to start the environment in the background.
Getting the environments ready requires a couple of extra steps to ensure the database is accessible and can be built, and the cache is pre-warmed. Silverstripe 3 Installations onlySilverstripe 3 installations require the usage of
All Installations from hereLoad the environment using your browser via the remote port defined in
Once Database building has completed successfully, reload the homepage to pre-warm the cache. (E.g. http://localhost:8080/). This should set your environment up ready for testing. Executing TestsSiege 4.0.9 was used to execute the tests against the environment. You can replicate the same tests results using the following execution command.
Test will be executed against the environment and the results will be output shortly. CleanupUse the following docker command from your project root to destroy the environment created for testing. This may be required between testing Silverstripe installations, or you can use different ports (as with results) for each installation to run them in parallel.
|
We have gone through some extensive performance testing and optimization as we encountered similar problems. Due to lots of involved DataObjects we do heavily use caching (using a self written cache module), this improves the performance considerably. I just add some of our findings along the way (note that this may differ and may depend on our specific setup):
The debugbar is definitely a great tool for (performance) debugging :-) Do you have data whether there is a high load or iowait? edit: Just seen that this was posted 2021, so I am one year late to the party ;) Would be interested to hear if you @micschk have made any progress? |
Small update regarding SS4 performance, you might be interested in these: |
Affected Version
Silverstripe 4 (on Apache/PHP 7.3.5 with Nginx proxy)
Silverstripe 3 (on Apache/PHP 7.1.x with Nginx proxy)
Description
We've just finished the SS4 update of a quite large website of one of our clients.
The update process has been resource intensive and the result... well, frankly quite disappointing honestly.
Upon switching the site to the new version, even the non-technical client immediately noticed it 'felt' a bit slower.
After a few hours/days, this was confirmed by our monitoring (and turned out to be a lot worse than 'a bit').
Switched to SS4 version around 10:40...
Figured maybe it was due to lots of images being resampled on new pageloads or so but still after a few days:
Comparing the exact same (simple) page on both versions:
(SSv3 website runs on a subdomain on the same server as SSv4).
Steps to Reproduce
Well, basically update an existing site to SS4 and check the loadtimes.
Curious to hear from others about their experience.
The text was updated successfully, but these errors were encountered: