a year ago
Hello. So i have a project where 3 similar bots are deployed. First two use acceptable amount of resources. But the last uses as much resources as those first 2. Im talking about ram + cpu. Is there anyway i can lower consumption of these resources. If so, how? Actually i would like to lower resources usage for all bots, since my billing is too high for me. I heard something about development server and that it uses more resources. Could you please share some information related to this. Thanks!
0 Replies
a year ago
first, please explain more about these bots, what they do and what language they are written in, and perhaps most importantly, how much they actually use since no one here is going to be able to look at your metrics
telegram bots, each of them have scheduled tasks (~50) and each sends requests every 7 seconds to specific page and searches for something. thats it
the reason which causes this i can think of is that first bot uses proxies and others two dont, but i dont know if this is right reason
a year ago
are those all the services within the project?
a year ago
Tbh I don't think this is a railway issue, search for ways to optimize python reousrce usage in prod.
a year ago
Also python is know for high memory usage
Just piggybacking - It's not a railway issue, it's Python. For example, an idle nodejs server can take 150-500mb of RAM. While a Go idle server just consumes 10mb of RAM.
Same with Python many tools add up on RAM consumption 30mb here, 100mb there, so it makes sense why your RAM usage is high
a year ago
you also have egress on redis, meaning you are not connecting to it via the private network, do that and you will stop paying for egress on the redis database
a year ago
it will remove the database to service egress fees, but it's not going to lower memory usage