Closed dchun closed 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.
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.
Ah, I see. We have many gems to monitor system:
Create reports based on your log files
I will examine and choose one.
I will apply the New Relic to the project.
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.
One option would be to use New Relic