# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
# Use at least one worker per core if you're on a dedicated server,
# more will usually help for _short_ waits on databases/caches.
rails_env = ENV['RAILS_ENV'] || 'production'
# 10 workers and 1 master
worker_processes (rails_env == 'production' ? 10 : 2)
#worker_processes 4
# Since Unicorn is never exposed to outside clients, it does not need to
# run on the standard HTTP port (80), there is no reason to start Unicorn
# as root unless it's from system init scripts.
# If running the master process as root and the workers as an unprivileged
# user, do this to switch euid/egid in the workers (also chowns logs):
# user "unprivileged_user", "unprivileged_group"
# Help ensure your application will always spawn in the symlinked
# "current" directory that Capistrano sets up.
# run unicorn_rails -c /wwwroot/yourapp/config/unicorn.rb -E production -D
#APP_PATH = File.expand_path(File.dirname(File.dirname(__FILE__)))
APP_PATH ="/home/dong/workspace/blog"
working_directory APP_PATH # available in 0.94.0+
# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
#listen "/tmp/nginx/sockets/unicorn.sock", :backlog => 64
#listen "/tmp/.sock", :backlog => 64
listen APP_PATH+"/tmp/nginx/sockets/unicorn.sock", :backlog => 64
listen 8080, :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default)
timeout 30
# feel free to point this anywhere accessible on the filesystem
#pid "/path/to/app/shared/pids/unicorn.pid"
pid APP_PATH + "/tmp/pid/unicorn.pid"
# By default, the Unicorn logger will write to stderr.
# Additionally, ome applications/frameworks log to stderr or stdout,
# so prevent them from going to /dev/null when daemonized here:
#stderr_path "/path/to/app/shared/log/unicorn.stderr.log"
#stdout_path "/path/to/app/shared/log/unicorn.stdout.log"
stderr_path APP_PATH + "/log/unicorn.stderr.log"
stdout_path APP_PATH + "/log/unicorn.stdout.log"
# combine REE with "preload_app true" for memory savings
# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
preload_app true
GC.respond_to?(:copy_on_write_friendly=) and
GC.copy_on_write_friendly = true
before_fork do |server, worker|
# the following is highly recomended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
# The following is only recommended for memory/DB-constrained
# installations. It is not needed if your system can house
# twice as many worker_processes as you have configured.
#
# # This allows a new master process to incrementally
# # phase out the old master process with SIGTTOU to avoid a
# # thundering herd (especially in the "preload_app false" case)
# # when doing a transparent upgrade. The last worker spawned
# # will then kill off the old master process with a SIGQUIT.
# old_pid = "#{server.config[:pid]}.oldbin"
# if old_pid != server.pid
# begin
# sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
# Process.kill(sig, File.read(old_pid).to_i)
# rescue Errno::ENOENT, Errno::ESRCH
# end
# end
#
# Throttle the master from forking too quickly by sleeping. Due
# to the implementation of standard Unix signal handlers, this
# helps (but does not completely) prevent identical, repeated signals
# from being lost when the receiving process is busy.
# sleep 1
end
after_fork do |server, worker|
# per-process listener ports for debugging/admin/migrations
# addr = "127.0.0.1:#{9293 + worker.nr}"
# server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
# the following is *required* for Rails + "preload_app true",
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
# if preload_app is true, then you may also want to check and
# restart any other shared sockets/descriptors such as Memcached,
# and Redis. TokyoCabinet file handles are safe to reuse
# between any number of forked children (assuming your kernel
# correctly implements pread()/pwrite() system calls)
end
分享到:
相关推荐
nginx 1.17.9.1 Unicorn.zip
前端项目-unicorn.js,Unicorn CPU emulator framework port for JavaScript
nginx 服务器,支持windows服务器搭建,稳定,分布式,流媒体.
Unicorn.js 用于JavaScript的 CPU仿真器框架的端口。 由提供技术支持。 注意: Unicorn是最初由Nguyen Anh Quynh,Dang Hoang Vu等人开发的轻量级多体系结构CPU仿真器框架。 并根据GPLv2许可发布。 有关贡献者和...
fugue, 用于 node.js的Unicorn 不再支持 ! 多节点服务器实例管理器,带有unicorn功能深受 Spark 和 Unicorn启发。为什么存在赋格曲? 赋格曲v0.1.0需要 node.js v0.3.2或者更高版本。Fugue v0.0.38和下面要求 nod
您将需要在/var/www/app/unicorn.rb编辑Unicorn配置文件 样本配置文件包含在此存储库中。 ##运行此脚本 登录到您的Droplet。 在文本编辑器中打开一个新文件,然后将的内容复制到其中。 示例: nano s
使用unicorn.js:8:14这样的行和列来解析和字符串化文件路径 安装 $ npm install line-column-path 用法 const lineColumnPath = require ( 'line-column-path' ) ; const parsed = lineColumnPath . parse ( '...
包含模块nginx, nginx doc, Lua, Naxsi, Rtmp, HttpSubsModule,echo-nginx, lower_upper_case, headers-more,auth_ldap, set-misc, lua-upstream, encrypted-session,limit-traffic, AJP, form-input, upstream_...
考虑到依赖性的静态资产修订,将内容哈希附加到每个文件名(例如unicorn.css => unicorn.098f6bcd.css),重新编写引用。 目的 通过使用HTTP服务器响应标头expires并结合文件名修订,可以使静态资产可长时间缓存。 ...
unicorn_rails –配置文件config / unicorn.rb #서버에서는이렇게실행함。 unicorn_rails -c /var/www/trackvue/config/unicorn.server.rb -D #production모드에가제가있음.. unicorn_rails -c /var/...
Udp flooder tester very good for mass network stress testing
修改config目录下的unicorn.rb后手动unicorn -D -c application_location_path/config/unicorn.rb -E production启动,或者可以通过修改unicorn_init.sh后,建立软链到/etc/init.d/unicorn,通过service unicorn ...
unicorn_status.rb 每隔几秒钟(在命令行上指定)输出有关给定Unicorn套接字中内容的信息。 用法: ruby unicorn_status.rb /path/to/your/unicorn/socket.sock 10 建立: gem install unicorn --no-ri --no-...
unicorn.cr:Unicorn Engine的水晶绑定
django-unicorn.com:django-unicorn的网站
gulp-rev 通过将内容哈希附加到文件名unicorn.css → unicorn-d41d8cd98f.css来进行静态资产修订该项目功能齐全。 添加新功能的PR将不被接受。 确保将文件设置为,这样才能生效。安装$ npm install --save-dev gulp-...
capistrano-nginx-unicorn, 从 Capistrano 创建和管理nginx unicorn配置 Capistrano-Nginx-Unicorn用于配置和管理nginx unicorn的Capistrano 任务 Rails 应用程序的零停机部署的组合。将 Capistrano 任务提供给:...
将文件路径转换为文件URL: unicorn.jpg → file:///Users/sindresorhus/unicorn.jpg 安装 $ npm install file-url 用法 import fileUrl from 'file-url' ; fileUrl ( 'unicorn.jpg' ) ; //=> 'file:///Users/...
riak 倒排索引演示###先决条件安装捆绑器 gem install bundler... $ $RIAK_APP/bin/riak pingpong####加载一些僵尸数据 ruby load_data.rb data.csv####启动服务器 bundle exec unicorn -c unicorn.rb -l 0.0.0.0:8080