Torom / BotLi

Lichess Bot
GNU Affero General Public License v3.0
46 stars 82 forks source link

Add support for Cloud Servers (Back4app) #145

Closed FatFritz2 closed 1 year ago

FatFritz2 commented 1 year ago

Hey @Torom . I find Back4app.com is an ideal place to run our bots onlince since the end of heroku It offers 600hrs/month for free plan, however it's resource kinda limited (0,25vcpu + 256mb ram) I suggest you to debloat your botli and use debian instead of ubuntu in Dockerfile At the present, I tried to deploy your botli to this website and it requires to config the dockerfile port as well. image Take a closer look at this pricing. In conclusion, I really hope I can find this earlier in #47
Hope more 24/7 bots will come back one day :> Thanks

Torom commented 1 year ago

however it's resource kinda limited (0,25vcpu + 256mb ram)

This is very limited and probably even less than the free tier on AWS.

I suggest you to debloat your botli

What exactly do you mean by debloat?

use debian instead of ubuntu in Dockerfile

I assume you have done experiments on how much less RAM Debian would need compared to Ubuntu?

FatFritz2 commented 1 year ago
  1. I think it is understandable. Other cloud providers like northflank render.com also provide very limited vCPU (0.1 - 0.2) and 128mb ram
  2. I mean you should remove some not useful codes that makes the repository heavier. If you dont think there is heavy codes, then skip
  3. In fact simply put, on fresh OS installs, Debian uses less system memory. On larger systems the difference is small enough to not matter much. However, when it comes to small cloud servers, virtual machines, and containers the difference can be substantial. now image htop on Ubuntu Without Snaps image htop on Fresh Debian Install You can see a big diffrence right ? ubuntu uses twice as much ram consumption that debian uses
IbaiBuR commented 1 year ago

Regarding free cloud computing services, I dont recommend using Oracle to run Lichess BOTs.

I tried this with https://lichess.org/@/ReinforcementTrial for some time, and, apart from the fact that the performance is quite bad (50-75K NPS) they also closed my account and deleted the servers I had with no previous warning.

AWS free tier and Azure also had poor peformance (same NPS), but I guess it is normal, they are giving to you resources for free. So yes, you would be able to run your bot 24/7 but dont expect a good performance, probably a RaspBerry PI is faster.

So, even if the Dockerfile is changed and you manage to deploy the bot there, dont expect much either, even as @Torom said, it may be too limited.

EmptikBest commented 1 year ago

Yes, a raspberry pi 4 gives 250k NPS on average..

But if you really need free hosting, use AWS.. I don't see the need to implement a 0.25 cpu hosting... AWS is 1

Torom commented 1 year ago

2. I mean you should remove some not useful codes that makes the repository heavier. If you dont think there is heavy codes, then skip

I will not remove any functions from BotLi just to run on such an extremely low-memory system

3. ubuntu uses twice as much ram consumption that debian uses

You're right, there is a clear difference. But switching to Debian should be extremely easy. Debian bookworm also comes with Python 3.11, so that's not a problem either. Then at most you have to change the apt install line.

AWS free tier and Azure also had poor peformance

I briefly tried with AWS, I had quite decent results with disabled pondering. These low tiers throttle extremely with constant CPU usage, so disabling pondering and quite a large delay in matchmaking might help.

Torom commented 1 year ago

Since df330a0, python:3.12 is used in the Dockerfile. Which is debian:bookworm with Python 3.12 preinstalled.

RaviharaV-bot commented 1 year ago

google cloud console giving 8GB ram and 2GHz Xeon processor for free. It iis better if we can run it on google cloud

Torom commented 1 year ago

I made the change in the Dockerfile, I don't see what else would be needed to support an arbitrary cloud provider.