Puma
Phusion Passenger


Puma | Phusion Passenger | |
---|---|---|
43 | 10 | |
7,722 | 5,016 | |
0.1% | 0.1% | |
9.3 | 9.5 | |
13 days ago | 8 days ago | |
Ruby | C++ | |
BSD 3-clause "New" or "Revised" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Puma
- Ruby, Rails, Multi-threading e Puma: Como tudo isso se conecta?
- Puma 6.6.0 Released – Return to Forever
-
It's Time to Replace TCP in the Datacenter
Unix sockets can use tcp, udp, or be a raw stream
https://en.wikipedia.org/wiki/Unix_domain_socket#:~:text=The....
Puma creates a `UnixServer` which is a ruby stdlib class, using the defaults, which is extending `UnixSocket` which is also using the defaults
https://github.com/puma/puma/blob/fba741b91780224a1db1c45664...
Those defaults are creating a socket of type `SOCK_STREAM`, which is a tcp socket
> SOCK_STREAM will create a stream socket. A stream socket provides a reliable, bidirectional, and connection-oriented communication channel between two processes. Data are carried using the Transmission Control Protocol (TCP).
https://github.com/ruby/ruby/blob/5124f9ac7513eb590c37717337...
You still have the tcp overhead when using a local unix socket with puma, but you do not have any network overhead.
-
Breaking the 300 barrier
As we use Puma as our webserver for our rails application, I quickly went to Puma's config file which typically resides in config/puma.rb. The config was set as
-
Would you consider Rails as stable nowadays ?
They do! It's in the first section of the readme on the repo:
-
Hosting Rails App on AWS
Start with service with systemd
- Recommended way to implement Puma plugin configuration
-
Could not detect rake tasks
# Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" # Build JSON APIs with ease [https://github.com/rails/jbuilder] # gem "jbuilder" gem 'rack-cors' gem "devise" gem "jsonapi-serializer" gem 'devise-jwt' gem 'active_model_serializers' gem 'followability' gem 'dotenv-rails', groups: [:development, :test, :production] gem 'sprockets' # Use Redis adapter to run Action Cable in production # gem "redis", "~> 4.0" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] # gem "bcrypt", "~> 3.1.7" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images] # gem "image_processing", "~> 1.2" # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible # gem "rack-cors" group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mingw x64_mingw ] end group :development do gem "sqlite3", "~> 1.4" # Speed up commands on slow machines / big apps [https://github.com/rails/spring] # gem "spring" end group :production do gem 'pg' end
-
Dusting off my rails knowledge, need some tips / guidance on rails 7 and production
source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.1.0" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.4", ">= 7.0.4.2" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" # Use sqlite3 as the database for Active Record gem "sqlite3", "~> 1.4" # Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] gem "importmap-rails" # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] gem "turbo-rails" # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] gem "stimulus-rails" # Build JSON APIs with ease [https://github.com/rails/jbuilder] gem "jbuilder" gem "mongoid" gem "mongoid-grid_fs" gem 'bootstrap', '~> 5.2.2' #sourced from https://github.com/twbs/bootstrap-rubygem gem 'rack-cors' # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", require: false
-
Write your own Domain Specific Language in Ruby
That doesn't mean one excludes the other. Gems like Puma use the instance_eval method for their configuration file.
Phusion Passenger
-
story of upgrading rails 5.x to 7.x
We split the staging server into two instances using Ubuntu 22.04 as the base image. The first instance is for a web server with nginx, passenger and MySQL. The second instance is for the support server and this is where we install redis, memcache, mongodb and resque.
-
Has something changed in Passenger with the new version?
Secondly, there is, of course, a bug with Passenger and /var/run/passenger-instreg (I can be found in that thread whining). My preferred fix for this is
-
Part 3 — Adding Git, Passenger and Nginx
While there is a debate on which ones are the best, we will be using Passenger and Nginx, since they are both fast and reliable. You may wish to do your own research and see which one works for you.
-
How To Deploy a Rails App With Passenger and Nginx On Digital Ocean Part 1 — Creating SSH
In this tutorial we will be deploying a Rails app with Passenger, as the application server, and Nginx, as the web server. Also, the Rails app will use Postgres, so we will be installing that as well.
- Passenger: Enterprise grade web app server for Ruby, Node.js, Python
-
I'm having trouble understanding what Rack does. Could you explain-like-I-am-a-beginner? with real examples if possible please.
Here's Puma's implementation, and Here's Passenger's implementation.
-
Rails 7 new production install: from zero to deploy (Ubuntu 20.04 edition)
server { listen 80; listen [::]:80; server_name YOUR_DOMAIN.ORG; # If you deploy without DNS and SSL, you could leave servername blank like below # server_name _; root /home/deploy/APPNAME/current/public; passenger_enabled on; passenger_app_env production; passenger_env_var RUBYOPT '-r bundler/setup'; # Cf issue: https://github.com/phusion/passenger/issues/2409 # Uncomment if you use ActionCable and/or Turbo Streams # location /cable { # passenger_app_group_name APPNAME_websocket; # passenger_force_max_concurrent_requests_per_process 0; # } # Allow uploads up to 100MB in size client_max_body_size 100m; location ~ ^/assets { expires max; gzip_static on; } }
-
Passenger 介紹
> passenger start =============== Phusion Passenger Standalone web server started =============== PID file: /home/leon/Git/MasoniteDemo1/passenger.3000.pid Log file: /home/leon/Git/MasoniteDemo1/passenger.3000.log Environment: development Accessible via: http://0.0.0.0:3000/ You can stop Phusion Passenger Standalone by pressing Ctrl-C. Problems? Check https://www.phusionpassenger.com/library/admin/standalone/troubleshooting/ ===============================================================================
-
5 Basic Things you need to know about managing a Linux server
PHP is great, but not for all of us. What about running Node.js or Python apps? You might be tempted to use proxy_pass but it won't handle the app startup and crashes for us. Luckily we have a better option: Phusion Passenger.
-
Guide on How to Deploy Rails API app
I have been following all day guides on https://www.phusionpassenger.com/ on how to deploy Rails apps with Apache and Passenger.
What are some alternatives?
falcon - A high-performance web server for Ruby, supporting HTTP/1, HTTP/2 and TLS.
PM2 - Node.js Production Process Manager with a built-in Load Balancer.
Thin - A very fast & simple Ruby web server
Iodine - iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Rack - A modular Ruby web server interface.
Goliath - Goliath is a non-blocking Ruby web server framework
forever - A simple CLI tool for ensuring that a given script runs continuously (i.e. forever)
Unicorn - Unofficial Unicorn Mirror.
Nodemon.io - Monitor for any changes in your node.js application and automatically restart the server - perfect for development

