High RAM usage

lplpqq
HOBBY

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

lplpqq
HOBBY

a year ago

2631a2ad-3db9-4b00-98ab-c6d47023680d


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


lplpqq
HOBBY

a year ago

they are all in python


lplpqq
HOBBY

a year ago

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


lplpqq
HOBBY

a year ago

1266032565425537000


lplpqq
HOBBY

a year ago

look, first bot uses as much as two others together


lplpqq
HOBBY

a year ago

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?


lplpqq
HOBBY

a year ago

yes, those services are within single project


lplpqq
HOBBY

a year ago

do you have any ideas why this can happen?


lplpqq
HOBBY

a year ago

🆙


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


kevmok
HOBBY

a year ago

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


lplpqq
HOBBY

a year ago

i already integrated private networking (recently)


lplpqq
HOBBY

a year ago

recently


lplpqq
HOBBY

a year ago

i hope it will lower usage


a year ago

it will remove the database to service egress fees, but it's not going to lower memory usage