Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Cache version string in versionstring.py #5672

Closed
michaelkaye opened this issue Jul 12, 2019 · 1 comment
Closed

Cache version string in versionstring.py #5672

michaelkaye opened this issue Jul 12, 2019 · 1 comment
Labels
A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label)

Comments

@michaelkaye
Copy link
Contributor

Description

https://github.com/matrix-org/synapse/blob/develop/synapse/federation/transport/server.py#L773

Synapse does not cache it's version string on startup, causing requests to that endpoint to cause 4 git processes to be spawned, even if the code is not deployed via git.

https://github.com/matrix-org/synapse/blob/develop/synapse/util/versionstring.py

While we're at it, we probably don't need to do that caching at each of the places get_version_string is called - perhaps that function saves the response forever (during the lifetime of the python process), this will save us checking git multiple times on startup - we just need to try it that 4 times and that's it.

We also tack on the "Synapse/" in lots of the places that we do this as well, maybe just do that in one place too.

Version information

  • Version: develop

  • Install method:
    git clone

  • Platform:
    linux

@neilisfragile neilisfragile added enhancement z-p2 (Deprecated Label) labels Jul 15, 2019
@richvdh richvdh added the A-Performance Performance, both client-facing and admin-facing label Jul 16, 2019
@richvdh
Copy link
Member

richvdh commented Jul 16, 2019

This is actually using a non-trivial amount of cpu time on the master. Given how easy it is to fix, we should do it asap

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

3 participants