-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Servers #1727
Comments
Is there some overview about the currently used tools/services/setup that are required to operate liberapay (potentially to share offline if this information is sensitive? If necessary please contact us directly to discuss ideas: codeberg at codeberg.org, please see https://codeberg.org and https://pages.codeberg.org for an overview of what we already do). |
@Codeberg-org Liberapay is quite simple, it's a Python web app connected to a PostgreSQL database. Does that answer your question? |
Getting the Liberapay web app to run isn't hard, but if we're going to migrate away from AWS, then I want the new stack to be at least as good as the current one, and better in at least one way, otherwise it's not worth it. Here are some things that come to mind:
As mentioned in my first message, we would have to decide whether to rely on Cloudflare, in which case our servers wouldn't need to listen for HTTP traffic from the Internet at all (#1093), or to keep our infrastructure more independent from Cloudflare.
A traditional SMTP daemon is of no use. The software we need for #1728 doesn't exist yet, so at first we would probably send emails directly from the Liberapay web app, which is something that we can't do now because the AWS EC2 instances don't have stable IP addresses. |
Today Liberapay is based on t2 instances and Postgres rds? It's not worth migrate to EKS or t3 instance (is more cheap)? |
@Urahara You're right, it looks like t3.micro instances are 9.5% cheaper than the t2.micro instances we're currently using, even though t3.micro has 2 vCPUs whereas t2.micro has only one, according to https://aws.amazon.com/ec2/pricing/on-demand/ (Ireland region). |
The t3a.micro instances (variants based on AMD EPYC processors) are even cheaper, so apparently we can save 19% simply by switching from t2.micro to t3a.micro. |
I've switched to t3a.micro, however most of our EC2 bill is for the Application Load Balancer, not the instances that actually run the Liberapay web app, so the savings will be small. |
(AWS' annoyingly complex pricing is one of the reasons why I would like to migrate away from it.) |
We could probably change that by allocating an Elastic IP address, however it currently only works for IPv4. |
If you only use ALB for healthchecks/failover and use static listening ports on application servers (i.e. port 80/443), you may be able replace it with AWS Route53 weighted records and failover. That would bring the monthly cost of failover from ~20$ to 2.5$ :
I may see why 😅 |
Any update? |
So far I've only looked into which hosting provider would be best for Liberapay. There are a lot of candidates… One way to eliminate many of them is to keep only the ones that host servers in several countries, since most providers are small and local. We could technically use multiple providers if we were ready to have servers around the world, but it's simpler to use a single provider. The list of “global” providers includes Vultr, Linode, and DigitalOcean. Ideally Liberapay would have servers in at least France and either South Korea or Japan. France is an obvious choice since it's the legal home of Liberapay and has one of the cleanest electricity supply in the world. South Korea and Japan have good trade relationships with the EU, and having servers there could reduce latency for Liberapay users in that part of the world. |
@gileri Thanks for the suggestion, but the load balancer is automatically provisioned by Elastic Beanstalk, not by us, and I don't think we can tell EB not to use load balancers. |
@Urahara I didn't mention Scaleway because it's not a global provider, it only hosts server in France and the Netherlands. |
@Changaco I've heard about OpenStack, which is FOSS: https://www.openstack.org/ |
Are CDNs (and their dedicated/optimized links) not sufficient to obtain a reasonable latency in Liberapay ? Even if application servers are hosted near users, the database would surely remain centralized. Meaning that round-trips across the world would still be required for distant users. |
I don't know, we would have to ask our users in Asia if they perceive the network latency when browsing Liberapay.
Each web server would need its own copy of the database, otherwise latency would be increased instead of lowered. However, the replicas could be read-only and send write queries to a primary. To clarify: having servers around the world isn't a priority and isn't a requirement to close this issue, it's just a possibility that should be kept in mind in order to avoid making choices that would complicate spreading servers geographically in the future. |
@TheEvilSkeleton I'm aware of OpenStack, but I've never used it. |
That might be a great place to do it, since OpenStack is FOSS, and LiberaPay is FOSS as well. |
At least I am being routed to According to Firefox, it takes about 4.5 seconds to load |
Thank you for the datapoint @revi. |
Measuring the total load time of an Measuring the load time of https://liberapay.com/about is more relevant. In a Firefox that already has the static assets in cache, I get: 9 requests | 221.45 KB / 4.50 KB transferred | Finish: 436 ms | DOMContentLoaded: 336 ms | load: 366 ms. |
FYI: Additionally my profile and liberapay team profile because that's where people most likely interact.
|
|
Hi there, Liberapay being the only ethical and libre support/donation platform out there (thank you <3), it is important for this community, (and also under the lens of security and surveillance issues) to go away from AWS. There are alternatives nowadays. Here are some experienced suggestions :
|
Privacytools.io maintains a list of secure and open source email providers here : https://www.privacytools.io/providers/email/ |
Keep in mind that while Tutanota's clients are open source, the server side is proprietary. |
Yes indeed, ans same for ProtonMail by the way (first in the list of privacytools.io). Thanks for reminding this. |
This branch upgrades the Liberapay webapp in several ways. The production servers will now run Amazon Linux v2 instead of the old v1, Python 3.8 instead of 3.6 (closes #1703), `gunicorn` instead of Apache's `httpd` with `mod_wsgi`, and `cloudflared` instead of an Amazon load balancer. This last point fixes #1093 and will zero out a part of our AWS bill, but those savings won't lower the overall bill because on the other hand I've increased the resources allocated to the database and webapp. Although it wasn't part of the plan, this branch can be considered a step towards #1727.
Lesson from #2039:
|
Liberapay was down for 7 hours because |
If you decide to build your own hosting stack without any of the "big" providers, I can recommend Hetzner. They offer VPS instances with good price/value based in Germany, Finland and the US. I think it would meet most of the requirements discussed above. I have only used Hetzner for smaller setups/projects so far, but I know that other FOSS-, privacy-minded businesses/orgs use it successfully (e. g. Plausible). |
I'd like to see LiberaPay move away from cloudflare personally, since it's a privacy nightmare. Hetzner is a solid alternative to AWS too. |
It's time to reconsider the technical infrastructure that the liberapay.com website runs on.
So far Liberapay has always been hosted on AWS, first indirectly through OpenShift Online (#1), then directly (#177). However, it's becoming more difficult to use AWS without getting a somewhat large bill. Moreover, some flaws of AWS have become apparent in the last two years, for example the Apache failures which regularly result in downtime. Technically, we could switch to nginx or gunicorn without leaving AWS, but if we have to build the stack ourselves then we might be better off doing it completely and on cheaper servers.
Liberapay has also always been served through Cloudflare, because we've always needed CNAME flattening (#1 (comment)). I'm not in any hurry to stop using Cloudflare, it's a pretty good service, but it's part of our infrastructure so it's relevant to this issue. If we migrate away from AWS, then we have to decide whether we want to pay Cloudflare and use its load balancer, or build our own.
The overall dilemma is mostly the same it was 3 years ago: doing things ourselves gives us more control and can reduce monetary costs, but it requires more work and can therefore slow down the progress on improving other aspects of Liberapay. However, considering the time I've spent trying to understand AWS and configure it, I'm not sure how much time it really saves me compared to building and maintaining our own stack. Moreover, Liberapay has changed a lot in the last 3 years, so perhaps it now needs better infrastructure as much as it needs improvements in other areas.
The text was updated successfully, but these errors were encountered: