How to measure the memory usage of a Rack or Sinatra application?

How do you measure the memory usage of a Rack or Sinatra app?

I understand that probably a lot depends on how it is deployed. But how do you get a general idea of ​​how much memory it uses?

+5
source share
2 answers

If you use a passenger, you can try the passive memory statistics, which gives you a good overview, shared by the site, otherwise you can get some idea about the memory usage using top, shift-M and look for ruby ​​processes.

+2
source

, derailed_benchmarks gem Padrino ( Sinatra). docs , Rails Rack - DERAILED_APP Rake, , .

( Unicorn) (define DATABASE_URL). , . ( ) / ( ).

bundle exec derailed exec perf:mem ( < 3 MiB). 70 , Heroku . "padfoot" btw.

TOP: 71.75 MiB mechanize: 19.0898 MiB (Also required by: /Users/me/dev/padfoot/lib/parsers/transaction_table_parser.rb, /Users/me/dev/padfoot/lib/scrapers/app_details_scraper.rb, and 4 others) mechanize/pluggable_parsers: 11.1055 MiB mime/types: 10.9766 MiB (Also required by: /Users/me/.rvm/gems/ruby-2.3.1/gems/rest-client-1.8.0/lib/restclient/request, /Users/me/.rvm/gems/ruby-2.3.1/gems/rest-client-1.8.0/lib/restclient/payload) padrino: 13.1016 MiB padrino-core: 8.0273 MiB (Also required by: padrino-cache, padrino-admin) padrino-core/application: 3.3555 MiB sinatra/base: 3.1406 MiB (Also required by: padrino-core/ext/sinatra, sinatra/main) padrino-helpers: 3.707 MiB (Also required by: padrino-cache, padrino-admin) padrino/rendering: 3.3203 MiB (Also required by: /Users/me/dev/padfoot/app/app.rb) /Users/me/dev/padfoot/config/apps.rb: 6.9805 MiB /Users/me/dev/padfoot/app/app.rb: 6.8906 MiB aws-sdk-core/s3: 6.3711 MiB /Users/me/dev/padfoot/lib/scrapers/gps/gps_scraper.rb: 4.25 MiB linguistics/en: 4.1523 MiB /Users/me/dev/padfoot/lib/scrapers/digimap/digimap_scraper.rb: 3.0547 MiB

0

All Articles