Skip to content
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

Improving performances #148

Closed
dbeniamine opened this issue Oct 1, 2020 · 6 comments
Closed

Improving performances #148

dbeniamine opened this issue Oct 1, 2020 · 6 comments

Comments

@dbeniamine
Copy link

Hello,

Pico CMS for nextcloud is great but a bit slow (it takes more than 1 sec to load a page without images).

I saw in the config.yml that we can setup a cache, I guess that would improve the performances. However I am not sure how to configure it : should I put an absolute path are a relative one (relative to which directory). Where should the cache be /var/www/nextcloud/apps/cms_pico/ ??? or maybe in nextcloud data directory ?

Are there some other performance related settings ?

@PhrozenByte
Copy link
Collaborator

Pico works best with a rather small number of pages (per website). There are plans to significantly improve performance with Pico 3.0 (see picocms/Pico#317), but due to very limited time this probably isn't going to happen soon. Help is appreciated.

Nextcloud unfortunately isn't known for best performance either. It adds a lot of complexity on its own, making the situation for Pico CMS for Nextcloud worse - like requiring PHP to load otherwise static assets (e.g. images). At least we tried our best to enable browser caching. The performance issues related to Nextcloud will persist even with Pico 3.0 I'm afraid, that's the price of managing websites using Nextcloud.

The cache is for Twig only, so it indeed improves performance, but not significantly. Relative paths are interpreted relative to Pico's root directory, which is the website's path on the local filesystem. So you should use an absolute path. Some folder in Nextcloud's data directory is fine (e.g. /data/appdata_*/cms_pico/cache).

So, to cut a long story short: Unfortunately not, no. However, 1 second it way too long. Please make sure not to add a large number of pages (like >100) and otherwise check your webserver's performance in general. How long does it take to load Nextcloud's files app? If this takes too long either, you should probably upgrade to a larger server.

@dbeniamine
Copy link
Author

Hi,

thanks for the answer.

I setup the cache and it seems to be working but indeed it does not have a perceptible impact on the performances.

The website is only 4 pages, and Nextcloud performances seems correct but I think it is due to the different parts loading separatly : it takes 174ms to load /index.php/app/files but the full loading of the page (including ajax) is 4 seconds.

Having the "body" of the page loading fast and the assets slowly would be enough, but with cms_pico it is the initial request that is slow ...

Is there a way to trace what is taking so much time ?

@PhrozenByte
Copy link
Collaborator

You could use XDebug's profiling feature to track down the issue. On my setups both /index.php/app/files and Pico's sample index page render in about 500ms.

@stale
Copy link

stale bot commented Oct 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! 👍

@stale stale bot added the info: Stale label Oct 22, 2020
@GregorKopka
Copy link

Simple solution is to wget the whole thing to a local directory and serve from there using the http server of your choice, this approach massively speedy up delivery (as it acts as a kind-of caching proxy), allows to circumvent problems like with the CSP headers (#142) and also reduces issues with content that is currently being edited (autosave by the editor in NextCloud).

In case you can live with changes being delayed: put the wget into a cron and be done with it.
Else trigger by hand.

@stale stale bot removed the info: Stale label Oct 22, 2020
@stale
Copy link

stale bot commented Nov 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants