Carl Youngblood
2005-Jun-24 14:36 UTC
How to reload classes on a production server when you can''t restart apache
Hi, I''m trying to get a rails app installed on DreamHost, running in production mode. Of course I don''t have root access, and I''m wondering what the best way of reloading the fcgi processes is, so that I can get it to see some modifications I''ve made to the source. Thanks, Carl
Tyler Kiley
2005-Jun-24 16:32 UTC
Re: How to reload classes on a production server when you can''t restart apache
> Hi, I''m trying to get a rails app installed on DreamHost, running in > production mode. Of course I don''t have root access, and I''m > wondering what the best way of reloading the fcgi processes is, so > that I can get it to see some modifications I''ve made to the source.If fastcgi is configured with suexec, you own your dispatch.fcgi process, which means you can kill it yourself, if you have shell access. (Apache will restart it for you) Tyler
Carl Youngblood
2005-Jun-24 17:33 UTC
Re: How to reload classes on a production server when you can''t restart apache
I think it is set up this way, because if I run top in the background and reload my site I see a bunch of ruby processes changing. I presume these are the fastcgi processes, right? On 6/24/05, Tyler Kiley <tyler.kiley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If fastcgi is configured with suexec, you own your dispatch.fcgi > process, which means you can kill it yourself, if you have shell > access. (Apache will restart it for you)
Robert M
2005-Jun-25 00:06 UTC
Re: How to reload classes on a production server when you can''t restart apache
I don''t know why and how, but Dreamhost told me their fcgi setup checks for updates in the scripts somehow. And it works for me. However it takes some time for the changes to "propagate" - half an hour or so I had some trouble installing fcgi. Just in case: - make sure the public dir (and possibly all the dirs above it) are chmod''ed 755 - make *sure* dispatch.fcgi has no windows newlines (I.e. only \n instead of \n\r or \r (mac) for that matter) Sometimes my first request to my site takes about 10 seconds (!) or so, but after that it''s pretty quick. I''ll have to drop a line to support, they''re super helpful. RMagick doesn''t work yet as they have to update their ImageMagick version. That sucks but they said they have that planned (to install it). More specifically: they want to install the new Debian version which has ImageMagick 6 included Cheers, Rob
Julian ''Julik'' Tarkhanov
2005-Jul-01 18:29 UTC
Re: How to reload classes on a production server when you can''t restart apache
On 25-jun-2005, at 2:06, Robert M wrote:> > Sometimes my first request to my site takes about 10 seconds (!) or > so, but after that it''s pretty quick. I''ll have to drop a line to > support, they''re super helpful.Which (translated) means "your FCGI processes (or even apache) are killed no matter what after some period of idling". As soon as the admins take this too far (have to deal with it now on my prod. box) your whole infrastructure is restarted every half an hour (until the site is bombarded with requests). Which, well, sucks big bigbig time (because the whole point of fcgi or mod_ruby is to NOT have to reload and restart everything). OTOH I don''t know what I would do in place of the admins if I had to deal with something so fragile and dangerous (in terms of system clogging) as Rails. I will be ultra-careful choosing my next host though, and judging from your report DreamHost is off my list. This is what I began to call "sort-of-supports-rails" type of hosting. -- Julian "Julik" Tarkhanov
Tom Wilcoxen
2005-Jul-01 22:07 UTC
Re: How to reload classes on a production server when you can''t restart apache
What Tyler mentions works great at DH. Just run top and kill any fastcgi processes you see. As you get the last one, you''ll see a new one spawn and you can quit and your changes will show up. I''ve just moved an app into production and it is really settling down and running pretty nicely. It''s been running all day and I haven''t had an entry in fastcgi.crash.log. (Of course it isn''t being heavily used, but some moderate access.) DreamHost certainly isn''t a rails specialist, but it seems to be working for me. I think that doing your main development there is probably not a good idea, but I doubt it would be at any provider. I was really mainly doing integration testing there. I already had an account at DH so I can''t say if I''d have chosen them otherwise. They don''t seem to be clamping down on processes as I ran top for a couple of hours today with many of the processes living the whole time. Perhaps that will change as they get more rails apps there. If anyone''s interested, here''s the app: http://clubrs.org -Tom -- Tom Wilcoxen http://convergentarts.com http://www.dreamhost.com/r.cgi?twilcoxen