search for: preload_app

Displaying 20 results from an estimated 21 matches for "preload_app".

2013 Sep 20
3
[PATCH] preload_app can take an optional block for warmup
...ons(-) diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb index 0d0eac7..a0ae576 100644 --- a/lib/unicorn/configurator.rb +++ b/lib/unicorn/configurator.rb @@ -441,9 +441,22 @@ class Unicorn::Configurator # by properly deploying all required code and dependencies. # Using preload_app=true means any application load error will # cause the master process to exit with an error. - - def preload_app(bool) - set_bool(:preload_app, bool) + # + # preload_app can also take an optional block. This block will be invoked + # with the rack application and can be used to "warm...
2013 Jan 20
6
preload_app = true causing - ActiveModel::MissingAttributeError: missing attribute: some_attr
...this - ActiveModel::MissingAttributeError: missing attribute: some_attr - on a random basis under a unicorn server, running rails 3.2 and ruby 1.9.3 As the case of the last poster in the following thread - https://github.com/rails/rails/issues/1906 - I too am able to resolve this issue by settingpreload_app to false. However, this is not the behaviour I want to have. Any inputs on that, or data I can provide around this issue? Best Regards, Avner Cohen
2011 May 19
2
Unicorn preload_app and upstart
?Hi, I was wondering if anyone has managed to get the preload_app and SIGUSR2 combination working well with upstart? My issue currently is that when I perform a SIGUSR2 against the master, check everything''s working and close off the old master, upstart then attempts to restart it because the original PID/binary are no longer running. What is the corre...
2010 Sep 09
4
Unicorn fails to restart gracefully on capistrano deploy
...n sorting out the issue would be greatly appreciated. We are following EngineYard''s instructions for loading unicorn via bundle exec: http://docs.engineyard.com/appcloud/howtos/cutomization/customize-unicorn So far we''ve tried deploying with the unicorn config set to both "preload_app true" and "preload_app false". (unicorn.rb being used: https://gist.github.com/9a208e3d1d1e44161018) When "preload_app true" is used the "uninitialized constant Prefix::OurCustomApi (NameError)" log entry/stacktrace appears once. And the workers never load the in...
2009 Nov 07
1
Fwd: [PATCH (geoip)] use IO.pread from the io-extra lib if possible
...be on vacation or busy, somebody may also hit this problem in the mean time, I figured I''d post the patch + git repo I sent him here. Unicorn users: The pread(2)/pwrite(2) syscalls are very useful for making libraries like this one (that rely on an on-disk database) compatible with preload_app. TokyoCabinet is a great example of a library that''s already compatible with Unicorn+preload_app out-of-the-box. ----- Forwarded message from Eric Wong <normalperson at yhbt.net> ----- From: Eric Wong <normalperson at yhbt.net> To: Clifford Heath <clifford.heath at gmai...
2012 Aug 31
1
after_fork - ActiveRecord::AdapterNotSpecified
Hi all, I''m fighting with the after_fork hook and my sinatra application. The Sinatra app is using active_record, In my unciron.rb file I''m using preload_app true after_fork do |server, worker| ? defined?(ActiveRecord::Base) and ??? ActiveRecord::Base.establish_connection End but I always get the error: ERROR -- : ActiveRecord::AdapterNotSpecified (ActiveRecord::AdapterNotSpecified) I''m using unicorn (4.3.1), sinatra (1.3.2), activerecord (3....
2009 Oct 02
0
[PATCH] configurator: update some migration examples
We now give an example of how a before_fork hook can be used to incrementally migrate off the old code base without hitting a thundering herd (especially in the "preload_app false") case. Also comment on the per-worker listen usage in the RDoc, not just a hidden comment. --- I just pushed this out earlier, this example was inspired by Chris Wanstrath''s before_fork hook but modified to use SIGTTOU instead of SIGQUIT for all but the last worker to mini...
2010 Oct 02
2
Unicorn doesn't reload the app after the HUP signal
...;'t reflected in the living site, so I''ve to stop and start again unicorn in order to see the new changes, here is my unicorn config: rails_env = ENV[''RAILS_ENV''] || ''production'' worker_processes (rails_env == ''production'' ? 3 : 1) preload_app true timeout 30 listen File.expand_path(File.join(__FILE__, "../../tmp/sockets/unicorn.sock")), :backlog => 2048 if GC.respond_to?(:copy_on_write_friendly=) GC.copy_on_write_friendly = true end before_fork do |server, worker| old_pid = RAILS_ROOT + ''/tmp/pids/unicorn.pid...
2012 Dec 04
2
403 Forbidden from nginx when unicorn started in debug mode
...me. Using ruby 1.9.3p194 with rails 3.2.9, development mode with ssl enabled, I start unicorn with -d ...and it does not get served up by nginx. Any ideas, or more information needed? Thanks! Jet Below is my unicorn.rb for developent: # config/unicorn.rb env = "development" preload_app true timeout 30 listen "/tmp/unicorn.sock", :backlog => 64 if env == ''development'' pid "/home/jet/RailsApps/spree/aceleathergoods/tmp/pids/unicorn.aceleathergoods.pid" stderr_path "/var/www/aceleathergoods/shared/log/unicorn.stderr.log"...
2010 Nov 09
2
AMQP and Unicorn (mq gem)
Hi all, I''m having issues with Unicorn and connecting to RabbitMQ using the tmm1-amqp gem. I''ve tried lots of approaches. The classic initializer with Thread.new { EM.run } for the Rails app and even tried using the Qusion library. (https://github.com/danielsdeleo/qusion) I''ve made a simple mod to Qusion for it to monkey patch unicorn too. The code looks
2010 Feb 14
6
Nginx Sock And Rails Envinroment Error
...port, the errors are rendered as normal with a 500 page, the same port, throught nginx, shows errors like you do in development. The app is rails latest (not 3), i run it with unicorn_rails -E production -c /root/pbr/current/config/unicorn.rb -D and unicorn.rb looks like.. worker_processes (20) preload_app(true) Im thinking it could be a permissions problem, the rails directory is in under root, nginx runs as user nginx, but i have given chown permission the the directory? Cheers, Alex Please CC alexbarlowis at me.com
2013 Dec 09
2
[PATCH] rework master-to-worker signaling to use a pipe
...n) for rb_thread_call_without_gvl (and similar) functions extensions. Most notably, this fixes compatibility with newer versions of the ''pg'' gem which will cancel a running DB query if signaled[1]. This also has the nice side-effect of allowing a premature master death (assuming preload_app didn''t cause the master to spawn off rogue child daemons). Note: users should also refrain from using "killall" if using the ''pg'' gem or something like it. Unfortunately, this increases FD usage in the master as the writable end of the pipe is preserved in the...
2011 May 19
2
unicorn doesn't restart properly after cap deploy (not using Bundler)
...corn::HttpServer::START_CTX[0] = "/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails" pid "/var/www/lookbook/shared/pids/unicorn.pid" stderr_path "/var/www/lookbook/shared/log/unicorn.stderr.log" stdout_path "/var/www/lookbook/shared/log/unicorn.stdout.log" preload_app true if GC.respond_to?(:copy_on_write_friendly=) ? GC.copy_on_write_friendly = true end before_fork do |server, worker| ? STDERR.puts "BEFORE FORK:" ? STDERR.puts ENV.inspect ? defined?(ActiveRecord::Base) and ? ? ActiveRecord::Base.connection.disconnect! ? if old_pid != server.pid ? ? be...
2017 Nov 07
2
Problem with getting restapi up&running
...og: /var/log/glusterrest/errors.log enable_stdio_inheritance: False worker_class: sync ssl_version: 2 suppress_ragged_eofs: True syslog: False syslog_facility: user when_ready: <function when_ready at 0x2842d70> pre_fork: <function pre_fork at 0x2842ed8> cert_reqs: 0 preload_app: False keepalive: 2 accesslog: /var/log/glusterrest/access.log group: 0 graceful_timeout: 30 do_handshake_on_connect: False spew: False workers: 2 proc_name: None sendfile: None pidfile: /var/run/glusterrest.pid umask: 0 on_reload: <function on_reload at 0x2842c08> p...
2011 Sep 30
3
Multiple rack applications on the same server with unicorn
If I''m running two rails apps on the same server using Unicorn, I have to run two instances of Unicorn, right? If so, then here''s a place where passenger might win in terms of memory use, as the rails code will be loaded into memory twice, right? I''m still probably going with Unicorn, but just exploring this first. Thanks, John
2013 May 25
1
Silent Failure when starting Unicorn on Heroku
...>'' Process exited with status 1 State changed from starting to crashed Procfile: web: bundle exec unicorn start -p $PORT -c ./config/unicorn.rb sidekiq: bundle exec sidekiq -c 10 unicorn.rb: worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true before_fork do |server, worker| Signal.trap ''TERM'' do puts ''Unicorn master intercepting TERM and sending myself QUIT instead'' Process.kill ''QUIT'', Process.pid end defined?(ActiveRecord::Base) and...
2010 Jun 04
8
unicorn_rails cleanup (possible fix for Rails3) pushed
...: nil) -if ru && ru =~ /\.ru\z/ - # parse embedded command-line options in config.ru comments - /^#\\(.*)/ =~ File.read(ru) and opts.parse!($1.split(/\s+/)) -end - -def rails_builder(ru, daemonize) +def rails_builder(daemonize) # this lambda won''t run until after forking if preload_app is false lambda do || # Load Rails and (possibly) the private version of Rack it bundles. begin require ''config/boot'' + require ''config/environment'' rescue LoadError => err abort "#$0 must be run inside RAILS_ROOT: #{e...
2012 Apr 27
14
app error: Socket is not connected (Errno::ENOTCONN)
I''m getting the following errors multiple times per request when using 4.3.0. I do not receive any errors when using 4.2.1. Please CC me on replies, I''m not subscribed to the mailing list. 16:48:42 web.1 | E, [2012-04-26T16:48:42.733954 #87940] ERROR -- : app error: Socket is not connected (Errno::ENOTCONN) 16:48:42 web.1 | E, [2012-04-26T16:48:42.734193 #87940] ERROR
2013 May 20
2
Unicorn + RUnit Rails Not Killing Old Master
...kets to listen on, and what options for them. listen "8080", :tcp_nodelay => true, :backlog => 100 working_directory ''/opt/myzippykid/deployment/current'' # What the timeout for killing busy workers is, in seconds timeout 60 # Whether the app should be pre-loaded preload_app false # How many worker processes worker_processes 1 # What to do before we fork a worker before_fork do |server, worker| sleep 1 end https://gist.github.com/grahamc/7ca7e3942d19f60d339a: #!/bin/bash cd /opt/myzippykid/deployment/current exec 2>&1 exec /usr/bin/chpst \ -u myzippy...
2012 Jan 31
12
FreeBSD jail and unicorn
...quot; the process. I haven''t found anything that gives some indication. I''ve tried unicorn version 4.1.1 and 4.2.0. The FreeBSD version is 8.2-STABLE amd64. That my config: --- listen "/home/deploy/staging/unicorn.sock" pid "/home/deploy/staging/unicorn.pid" preload_app true stderr_path "/home/deploy/staging/unicorn.stderr.log" stdout_path "/home/deploy/staging/unicorn.stdout.log" before_fork do |server, worker| old_pid = "#{server.config[:pid]}.oldbin" if old_pid != server.pid begin process_id = File.read(old_pid).t...