dchun / QuoteManager

Saas App for Managing Quotes and getting paid
https://quotemanager.boopis.com
0 stars 0 forks source link

How can we monitor users to observe resource usage? #114

Closed dchun closed 9 years ago

dchun commented 9 years ago

One option would be to use New Relic

phuong3030 commented 9 years ago

I found it on stackoverflow: http://stackoverflow.com/questions/9170687/how-to-use-disk-quota-in-rails-app

It's better to limit user's disk space usage on application level, without the use of OS-level tools.

As a simple example, add disk_quota and current_disk_usage fields to user model, update current_disk_usage after each successful file upload. Before each file upload, throw an exception if uploaded file size + current_disk_usage > disk_quota.

This is much more versatile and cross-platform approach. This way you are not limiting yourself to using Linux OS, can store your files and your application server(s) on different machines, can store your files on Amazon S3, etc. Plus, it's much more maintainable.

dchun commented 9 years ago

I meant more in terms of making sure that we are properly allocating enough resources to our vps so our application doesn't crash from a lack of resources. And also certain things like bandwidth, which we aren't currently restricting. It would be nice to have an alert system that would notify us if certain thresholds are being crossed so we can act before anything bad happens.

phuong3030 commented 9 years ago

Ah, I see. We have many gems to monitor system:

Create reports based on your log files

I will examine and choose one.

phuong3030 commented 9 years ago

I will apply the New Relic to the project.

phuong3030 commented 9 years ago

new relic new relic2

https://github.com/boopis/QuoteManager/pull/215

I tested with my relic account. For production server, can you create your new relic account, get the key? We can configure it by add the and add NEW_RELIC_KEY constant to application.yml file.