R
Railway•5mo ago
lplpqq

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
Percy
Percy•5mo ago
Project ID: 2631a2ad-3db9-4b00-98ab-c6d47023680d
lplpqq
lplpqqOP•5mo ago
2631a2ad-3db9-4b00-98ab-c6d47023680d
Brody
Brody•4mo 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
lplpqqOP•4mo ago
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
lplpqq
lplpqqOP•4mo ago
No description
lplpqq
lplpqqOP•4mo ago
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
Brody
Brody•4mo ago
are those all the services within the project?
lplpqq
lplpqqOP•4mo ago
yes, those services are within single project do you have any ideas why this can happen? 🆙
Medim
Medim•4mo ago
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
Boxer
Boxer•4mo 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
Brody
Brody•4mo 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
lplpqqOP•4mo ago
i already integrated private networking (recently) i hope it will lower usage
Brody
Brody•4mo ago
it will remove the database to service egress fees, but it's not going to lower memory usage
Want results from more Discord servers?
Add your server