phusion

Rails: How should Phusion Passenger and I18n.locale behave?

只谈情不闲聊 提交于 2020-01-24 09:33:21
问题 I have a Rails 2.2 web app running on Passenger / REE I set the default locale in config/environment.rb config.i18n.default_locale = 'en-GB' The first request seems to have no locale set in I18n.locale If I the visit a page with a before_filter that sets I18n.locale every subsequent visit to any controller even if it doesn't have that same before_filter setting the I18n.locale get an I18n.locale of whatever was set, say, en-US . On Mongrel with the same code each request gets a locale of en

Gracefully stop Phusion Passenger running on apache

拈花ヽ惹草 提交于 2020-01-05 04:20:13
问题 I have a docker container with apache running in foreground . On stopping the docker container , a SIGTERM is sent to all the child processes , which is apache in our case. Now, the problem i am facing is to gracefully shutdown apache on receiving SIGTERM signal. Apache normally terminates on the current requests immediately which is the main cause of the problem . Somehow, i need to translate the SIGTERM signal to SIGWINCH , which would eventually gracefully shutdown the server. I was

How to limit Phusion Passenger memory usage?

送分小仙女□ 提交于 2019-12-12 08:25:48
问题 Is there a way to limit the amount of memory Phusion Passenger uses when serving up your app? My host comes by and kills the process after I get a bunch of traffic and so I end up serving up blank pages. Is there anything I can do to say "hey don't use any more than 100Mb and only spawn 3 processes no matter how overloaded the site is" 回答1: There is no way to limit the memory usage explicitly (say use <= 100MiB). But what you can do is limit the number of processes by setting

How do I clear the cache of Ruby Phusion Passenger in Ubuntu?

别等时光非礼了梦想. 提交于 2019-12-07 05:31:54
问题 I've tried restarting apache and the cached pages still appear, so there must be a folder someplace. I don't have a 'public/cache', so what other places should I look? Is there a URL flag that could trigger this effect as well? 回答1: You need to touch a file to have phusion clear out, like: touch /webapps/mycook/tmp/restart.txt See the docs 回答2: I'm in development mode. I discovered I had to restart the apache service and clear the browser cache to get my changes to appear 100% of the time.

Do apps running in Phusion Passenger need to reconnect ActiveRecord on fork?

家住魔仙堡 提交于 2019-12-06 14:48:31
问题 Per this documentation: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_smart_spawning_gotcha_1_unintentional_file_descriptor_sharing Socket connections continue to be shared after a Smart spawn operation. The example listed is for Memcached. Does one have to similarly reconnect ActiveRecord in this case as well? Something like: PhusionPassenger.on_event(:starting_worker_process) do |forked| if forked # We're in smart spawning mode. ActiveRecord.establish_connection(...)

How do I clear the cache of Ruby Phusion Passenger in Ubuntu?

情到浓时终转凉″ 提交于 2019-12-05 10:24:41
I've tried restarting apache and the cached pages still appear, so there must be a folder someplace. I don't have a 'public/cache', so what other places should I look? Is there a URL flag that could trigger this effect as well? You need to touch a file to have phusion clear out, like: touch /webapps/mycook/tmp/restart.txt See the docs I'm in development mode. I discovered I had to restart the apache service and clear the browser cache to get my changes to appear 100% of the time. First, have you cleared your browsers cache? You can do this through the browser menus, in options somewhere. The

Do apps running in Phusion Passenger need to reconnect ActiveRecord on fork?

冷暖自知 提交于 2019-12-04 19:02:31
Per this documentation: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_smart_spawning_gotcha_1_unintentional_file_descriptor_sharing Socket connections continue to be shared after a Smart spawn operation. The example listed is for Memcached. Does one have to similarly reconnect ActiveRecord in this case as well? Something like: PhusionPassenger.on_event(:starting_worker_process) do |forked| if forked # We're in smart spawning mode. ActiveRecord.establish_connection(...) else # We're in conservative spawning mode. We don't need to do anything. end end passenger automatically

Errno::ECONNRESET: Connection reset by peer in Rails using rest-client

倾然丶 夕夏残阳落幕 提交于 2019-11-29 15:21:10
We have a Ruby on Rails application and this has a "search" functionality (search for some company). From browser user key-in some name and hit search and this search make an rest api call to outside system and get us some search results. We are using " rest-client " (for Ruby on Rails). I noticed this seems to work for few hours and suddenly my search seems to be broken all of a sudden and I can see in my log I get: Errno::ECONNRESET: Connection reset by peer We tried to investigate this issue by looking in to logs and we dont see any logs. If we need to make this search work again we need to

Errno::ECONNRESET: Connection reset by peer in Rails using rest-client

一个人想着一个人 提交于 2019-11-28 08:48:20
问题 We have a Ruby on Rails application and this has a "search" functionality (search for some company). From browser user key-in some name and hit search and this search make an rest api call to outside system and get us some search results. We are using " rest-client " (for Ruby on Rails). I noticed this seems to work for few hours and suddenly my search seems to be broken all of a sudden and I can see in my log I get: Errno::ECONNRESET: Connection reset by peer We tried to investigate this

Slow initial server startup when using Phusion Passenger and Rails

人走茶凉 提交于 2019-11-26 10:05:36
问题 To jump on the band-wagon of Phusion Passenger we\'ve setup a staging server for a small rails app to test things out. So far it has been very nice to use, it makes installing/configuring and deploying apps a breeze. The problem is the site we\'re using doesn\'t get hit very often and it seems to shut down the servers in the background. Meaning when someone goes to the site they have a really long wait until it starts up a new server to handle the request. We\'ve read through the