-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Explore running Synapse on PyPy #8888
Comments
Looks like we'd need to resolve #5054, which should be a trivial fix. |
There are at least a handful of resolved issues and pull requests from folks claiming to be happily running Synapse on PyPy. Presuming it works, the greatest value might come from actually measuring the CPU/RAM delta between PyPy and CPython for homeservers of various size. |
@callahad As someone interested in running an instance with PyPy, would you be willing to link these issues/PRs in the main PR body? |
Specifically, the person who submitted Pull Request #2760 noted:
That was two years ago, but it's nonetheless very encouraging. |
I modified the Dockerfile to make it successfully Synapse with Postgres and PyPy 3
|
Note: Should we really be using that package for this? |
It's had quite a few commits since its last release, but according to the author two months ago:
There is sliiiiightly more current fork at https://github.com/Omegapol/psycopg2cffi. But I wouldn't be especially concerned about it. It's not an especially huge module, and Plus, what alternative do we have? |
Yeah, i got that distinction when i started digging a little more, i'm just noting it because it might become a compatibility issue down the line 😅 |
I just gave the idea another try, now with a bit more time on hands than the last time. TL;DR (primarily for other pioneers):
With this done, it seems to work \o/... at least for now |
Something interesting, Though some (read: a lot of) testing needs to be done to assure that |
Nothing interesting, completely expected :) I asked the acting maintainer to do a release after contributing an update to synchronise API with upstream psycopg2. Synapse 1.26.0 should be compatible with psycopg2cffi 2.9. Still need to apply a few fixes to Synapse proper; sadly I did not submit them in time for 1.26.0. |
@intelfx do you have a PR which references those fixes somewhere? |
No. Actually let me just do it right now. |
pallets/markupsafe#176 is an issue for this, affecting |
I summarised the difficulties i encountered with adding a database adapter for pypy-powered synapse in this issue; #11756 |
That issue has been closed; psycopg3 has a pure-python option, this could work great for pypy deployments, as that pure python will run (almost) as fast as a native-code option, being able to take advantage of the JIT. In other words, using psycopg3 will mean pypy is then a viable option. |
Really curious if PyPy might give us greater scaling headroom.
EMS is willing to roll out staging instances based on PyPy for our testing if we supply them with a suitable Docker image. (cc: @jaywink)
The text was updated successfully, but these errors were encountered: