High RAM usage
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!
13 Replies
Project ID:
2631a2ad-3db9-4b00-98ab-c6d47023680d
2631a2ad-3db9-4b00-98ab-c6d47023680d
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
they are all in python
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
look, first bot uses as much as two others together
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
are those all the services within the project?
yes, those services are within single project
do you have any ideas why this can happen?
🆙
Tbh I don't think this is a railway issue, search for ways to optimize python reousrce usage in prod.
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
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
i already integrated private networking (recently)
i hope it will lower usage
it will remove the database to service egress fees, but it's not going to lower memory usage