ecamp3 icon indicating copy to clipboard operation
ecamp3 copied to clipboard

Improve Performance

Open BacLuc opened this issue 1 year ago • 3 comments

Start improving the performance

  • expand caching
  • improve queries and other things (worker mode)

BacLuc avatar Dec 03 '24 19:12 BacLuc

Configuration of the PHP Runtime

from: https://frankenphp.dev/docs/performance/

Number of Threads and Workers

  • https://github.com/ecamp/ecamp3/pull/6612

Worker mode

(with other things, else it gets even worse)

  • https://github.com/ecamp/ecamp3/pull/6598

Don't use musl

:heavy_check_mark: We already use the Debian Docker image

Go Runtime Configuration

  • https://github.com/ecamp/ecamp3/pull/6606

Does not seem to have much of an effect with the value set now. But it seems to improve the worker mode.

file_server

Placeholders

resolve_root_symlink

Removing unnecessary Requests from the frontend

  • https://github.com/ecamp/ecamp3/pull/6535
  • https://github.com/ecamp/ecamp3/pull/7194

Optimize PHP Code

  • https://github.com/ecamp/ecamp3/pull/6536

Query optimization

  • https://github.com/ecamp/ecamp3/pull/7051
  • https://github.com/ecamp/ecamp3/pull/7114
  • https://github.com/ecamp/ecamp3/pull/7115
  • https://github.com/ecamp/ecamp3/pull/7135
  • https://github.com/ecamp/ecamp3/pull/7193

Caching

BacLuc avatar Jan 02 '25 18:01 BacLuc

I looked quickly if maybe the problem is outside of the query or serialization, and it seems ingress-nginx and the api container have the same request duration. its not that the ingress-nginx is waiting for the api to pick up the request. image

BacLuc avatar Jan 12 '25 17:01 BacLuc

Core Meeting Decision

Open

  • app.ecamp3.ch/api/activities?camp=%2Fapi%2Fcamps%2F{id}%2F p90: 2.045 med: 0.981 count: 25'841 prevent embedding of content nodes of collection requests (subresources 👍 & cache & query optimization)

  • app.ecamp3.ch/api/schedule_entries/{id}/ p90: 1.908 med: 0.162 count: 17'118 (investigate) 2025-07-12 Does not seem to be a problem anymore: p90: 0.3 med: 0.163 count: 23.230 -> subresource + caching seems to help ✔️

  • app.ecamp3.ch/api/content_types?categories=%2Fapi%2Fcategories%2F{id}%2F p90: 3.311 med: 0.891 count: 2'231 (remove query) ✔️ query removed

  • app.ecamp3.ch/api/ p90: 1.809 med: 0.076 count: 60'740 (investigate) ✔️ (seems to be better)

  • app.ecamp3.ch/api/camps/{id}/ p90: 1.762 med: 0.188 count: 35'527 (investigate)

    2025-07-12 Does not seem to be a problem anymore: p90: 0.419 med: 0.254 count 21'096

✔️ (now with 0.3)

  • app.ecamp3.ch/api/content_node/material_nodes/{id}/ p90: 1.523 med: 0.544 count: 15'277

Got even worse, but is maybe called less.

  • app.ecamp3.ch/api/camp_collaborations?camp=%2Fapi%2Fcamps%2F{id}%2F p90: 0.791 med: 0.365 count: 11'134 (subresources/cache/query opt.) Subresource is here, but not used.

  • app.ecamp3.ch/api/days/{id}/day_responsibles p90: 0.505 med: 0.218 count: 84'226 (investigate)

done

  • app.ecamp3.ch/api/camp_collaborations/{id}/ p90: 2.159 med: 0.879 count: 1'948 (remove camp embedding) #7135
  • app.ecamp3.ch/api/activities/{id}/ p90: 0.491 med: 0.222 count: 105'506 (improve/investigate) #7193

manuelmeister avatar Feb 25 '25 21:02 manuelmeister