Search

The Joyent Community

A place where the Joyent community can gather, help each other out, and stay informed.

You are not logged in.

#1 2006-06-30 18:22:23

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Rails on TextDrive and the Samurai

Hey everybody,
I'm in the process of deploying my first Rails app to TextDrive on a basic shared hosting account. Over the past 2 weeks, I've been getting the "500 Internal Server Error" several times a day. We've been killed by "the Samurai" process watchdog a few times for having "used more than 30 cpu seconds over 90 real seconds" and a few times it's gone down without any such error message appearing.

Has anyone had success deploying a rails app on a shared hosting environment at TextDrive with at least a few thousand page views a day?

I'm at the point where I'm seriously considering switching to another host.

Thanks,
Rick

Offline

 

#2 2006-06-30 18:35:42

ubernostrum
My internets, let me show you them
From: Lawrence, KS
Registered: 2005-02-23
Posts: 2174
Website  Expertise

Re: Rails on TextDrive and the Samurai

My Django-powered blog has had its FastCGI listeners killed off more than a couple times, but never the "master" process that spawns them, so the site stays up. I wasn't astute enough to take notes, but it always seemed to happen at a time when MySQL was getting hammered from somewhere else (e.g., I was also getting lots of error emails saying Django couldn't serve a page because MySQL spat back "too many connections").

Dunno about what would happen with Rails; is it just killing off individual listeners, or is it actually taking down your whole app?


When they lay you on the table, better keep your business clean.

Offline

 

#3 2006-06-30 18:47:54

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

It's been taking down the whole app, unfortunately.

How much traffic have you been able to handle with your Django app?

Offline

 

#4 2006-06-30 19:04:08

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8774
Website  Expertise

Re: Rails on TextDrive and the Samurai

rickreilly wrote:

Hey everybody,
I'm in the process of deploying my first Rails app to TextDrive on a basic shared hosting account. Over the past 2 weeks, I've been getting the "500 Internal Server Error" several times a day. We've been killed by "the Samurai" process watchdog a few times for having "used more than 30 cpu seconds over 90 real seconds" and a few times it's gone down without any such error message appearing.

Has anyone had success deploying a rails app on a shared hosting environment at TextDrive with at least a few thousand page views a day?

I'm at the point where I'm seriously considering switching to another host.


It's not the number of page views, because there are rails sites that do 500,000 page views a day and they aren't killed off even once. There's something else going on.

Offline

 

#5 2006-06-30 19:07:58

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

I would love it if we could get half a million page views a day without going down. Are the rails sites that get that many page views daily on shared hosting or one of the other plans?

Offline

 

#6 2006-07-01 00:57:21

ubernostrum
My internets, let me show you them
From: Lawrence, KS
Registered: 2005-02-23
Posts: 2174
Website  Expertise

Re: Rails on TextDrive and the Samurai

rickreilly wrote:

It's been taking down the whole app, unfortunately.

How much traffic have you been able to handle with your Django app?


I'm not honestly sure; it's just my personal blog, doing a little over 10k hits/month. I have a feeling that if I cranked up Django's caching settings it could do a whole lot more than that.


When they lay you on the table, better keep your business clean.

Offline

 

#7 2006-07-01 13:50:17

ichigo
panem et circenses 2.0
From: Vienna, Austria, Europe
Registered: 2005-02-25
Posts: 591
Website  Expertise

Re: Rails on TextDrive and the Samurai

i have had problems with the samurai too...

i currently have 2 rails apps "live". they got killed more or less regularly since the samurai is protecting the txd shared hosting plans.

the first app is feedication which gets not that much traffic. i guess it was about 30 pageviews a day when the site was up and running 24 hours a day. though the app got killed by the samurai more than just occasionally so i let it down for now.

my reasons: the code is about one year old. ive made no updates to the code and the service is pretty much an rss-feed aggregator that stores feeds in the db, displays them and updates the feeds regularly. and my take on it was: i wrote that app back when i was somehow familiar with rails but i would consider the code pretty ugly now. and i am no expert in telling how resource intensive the app is. so im not really sure right now what to do with the app but unless i dont get the time to get into the code i think its more wise to let the app off of txd shared hosting as i dont consider it as nice neighbour behaviour to deploy an rss-feed aggregator (i guess feed aggregators caused enough trouble on rails already) with code that i wrote 1 year ago and i consider bad code.

the other app is my typo blog over at geek.textdriven.com. the blog gets killed occasionally. the typo version is rather old and i did some manual updates to newer typo versions over the time...but the last update is also some months old now. i don't know what exactly is wrong with my typo app but it certainly doesn't behave as i would expect. there are problems with assigning categories to articles and it seems like caching doesnt work (as i initially wondered how my typo app could be too resource intensive even if lighty serves static html - at least that ought to happen with a working typo version iirc). so i will put my own blog/website built with rails online later today if i manage to don't fall behind my schedule again. and then i will look if the samurai problems are gone.

conclusion: i have 2 apps...both have problems with the samurai...the problems arent really surprises to me and i take the samurai behaviour as advice for me personally to either look into the code of my app or put the app offline.

but im eager to learn more about your problems with the resource restrictions as i would really be interested what i can expect my vc account to host if i plan to host a rails app that is more critical to downtime than a hobby project.

Offline

 

#8 2006-07-02 17:13:35

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

Basically, we've been getting about 125,000 page views a month, and the site has been going down constantly at peak times (afternoons and evenings).

I'm sure there are parts of the app that can be tweaked and optimized (I'm in the middle of doing so) but I doubt that I'd be able to reduce the load on the server enough to prevent us from getting killed by the samurai again.

Offline

 

#9 2006-07-07 09:27:18

dpdnolan
Member
From: London, UK
Registered: 2006-01-17
Posts: 80
Website  Expertise

Re: Rails on TextDrive and the Samurai

I am having a similar experience. I have an app that has at most 3 concurrent users. It was running for 4.5 days then got killed by Samurai for hogging processor.

What I don't understand is how it can have used more than 30 cpu seconds over 90 real seconds when noone - noone at all - was accessing it. It was killed off 5 hours after the last entry in production.log and the access logs. And 10 hours before the next one.

I thrashed it in my dev environment and watched the resource usage but never logged any issues.

I would really welcome any recommendations on how to troubleshoot.


Let's dye our hair ginger and fly to Mexico

Offline

 

#10 2006-07-07 11:06:15

koppen
Member
From: Copenhagen, Denmark
Registered: 2005-01-27
Posts: 56
Website  Expertise

Re: Rails on TextDrive and the Samurai

I have a Typo installation as well that tends to die every other for some reason. If Samurai was killing it off, should there be some explanation in some file somewhere?

Offline

 

#11 2006-07-07 11:09:56

bigfleet
Team Captain
From: Charlotte, NC
Registered: 2005-03-03
Posts: 329
Website  Expertise

Re: Rails on TextDrive and the Samurai

I don't know if it will help anyone specifically with their problems, but I can speak for myself. I have my blog and another site I run that uses Rails running on the same account. I was having trouble keeping them up for more than a few hours at a time. On occassion, it would be because the Samurai killed a zombie process. On occassion, it would be for the CPU seconds limitation.

I followed the advice of others and tracked down the pretty much completely rewritten instructions, thanks mostly to Harry in this thread who pointed me to this thread where a lot of useful questions are asked.

There are two key changes in the directions since I did them several months ago. First, you're not encouraged any longer to have lighttpd start up the FCGI processes itself. The new instructions encourage you to start them externally and to reference their location in the lighttpd configuration. The spawning of the FCGI processes is now an additional task that you as the account holder have to face, but it's not that difficult. A template script is provided in the walkthrough.

The second major change is the mechanism for starting lighttpd and the Rails FCGI processes. That's done using much more of an rc.d sort of startup script than just a one liner that you toss off to start lighttpd and have it do the rest.

There are some other file structure related changes. It shouldn't take you long to walk through the changes and get your site back up. (I think it took me about an hour.) Since then, my apps haven't been killed more than once. Granted, when they do die, I'll need to learn to do something different to start it up again, but oh well.

Also, I found that the cron job that I had to start lighttpd on boot had been removed, probably a vote on how old my setup was. Not complaining, I think it's totally appropriate to require us to be good tenants. But those who haven't checked it out because it's been "working" since they set it up should do the same.

Offline

 

#12 2006-07-07 11:35:37

dpdnolan
Member
From: London, UK
Registered: 2006-01-17
Posts: 80
Website  Expertise

Re: Rails on TextDrive and the Samurai

Thanks Bigfleet, but my app already runs under the new structure.

I'm still struggling to understand why it was using so much CPU time when noone was accessing it.


Let's dye our hair ginger and fly to Mexico

Offline

 

#13 2006-07-07 12:41:14

qbert72
Member
From: Montréal, Québec, Canada
Registered: 2005-05-08
Posts: 565
Website  Expertise

Re: Rails on TextDrive and the Samurai

I'm pretty much exactly in your situation, dpdnolan. I deployed following the TxD manual. My app has used 21 seconds of CPU in total since Monday, the last time I restarted it. Yet it can get killed at apparently random moments for using more than 30 sec in 90 real seconds, even if there is not a single request logged in the preceding hours. Pretty damning, and hard to troubleshoot.

What does Rails do when it's not processing requests? Could something like garbage collection cause this?


VCIII -> Mixed Grill = Jervis: not the guy from Survivor -> Bridgeway: You need more than luck in Shanghai
AC200 (S)

Offline

 

#14 2006-07-07 13:40:32

ichigo
panem et circenses 2.0
From: Vienna, Austria, Europe
Registered: 2005-02-25
Posts: 591
Website  Expertise

Re: Rails on TextDrive and the Samurai

my apps are also running under the new setup. i restarted feedication again yesterday without code changes but with corrected settings in the lighttpd configuration files (i spotted a mistake there and thought that might cause the killing) but the app still got killed a few hours after starting it so i let it offline now.

my new personal website running rails did not get killed so far. unlike my typo install that i used before. but the rails app is also significantly simpler and i use page caching for every page. so actually lighty ought to surpass rails completely and just serve static html 99% of the time.

Offline

 

#15 2006-07-08 16:29:22

qbert72
Member
From: Montréal, Québec, Canada
Registered: 2005-05-08
Posts: 565
Website  Expertise

Re: Rails on TextDrive and the Samurai

We've been heard. Yay TextDrive!


VCIII -> Mixed Grill = Jervis: not the guy from Survivor -> Bridgeway: You need more than luck in Shanghai
AC200 (S)

Offline

 

#16 2006-07-08 17:21:02

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

Cheers to TextDrive for increasing the samurai threshold.

It was too late for me, though. We moved to another host and set things up with Apache and FastCGI instead of Lighty. The site has been able to take a merciless beating (the most i tried was 1,000,000 concurrent users requesting 1,000 pages each) without falling prey to the dreaded 500 Internal Server Error.

Offline

 

#17 2006-07-09 22:02:15

derekmw
New member
Registered: 2006-03-04
Posts: 4
Expertise

Re: Rails on TextDrive and the Samurai

Yay, something changed, but it's bordering too little, too late. My client was pretty close to slitting throats when he found out what was going on. Neither of us got any e-mail and he wasn't aware of the RSS feeds. That didn't matter, though, since the notice about Samurai was posted on the forums about a week after it was put in place.

Between Cardero reboots, the week it took to work with Webmin and Apache to get proxying->lighttpd going (why is it failing? why did I have to file a ticket even though I followed the scant documentation?), minimal notice about the new process-slaying policy (the least they could have done was told everybody upfront by e-mail!), TextDrive is making my blood boil.

We'll see if my laughably tiny application continues to get slayed unnecessarily.

I don't know where else to go for the moment so I hope things improve in the Solaris era, which I hope will start sometime before the year is out.

Offline

 

#18 2006-07-10 01:47:47

ubernostrum
My internets, let me show you them
From: Lawrence, KS
Registered: 2005-02-23
Posts: 2174
Website  Expertise

Re: Rails on TextDrive and the Samurai

Eh. I haven't had problems.

And to recount something I posted on one of the Django mailing lists (in a discussion about Django-friendly hosting), I have yet to achieve an understanding of how people have "mission-critical" business and client sites which don't merit more than basic shared hosting. That's like saying that you've got your company payroll and it's of the utmost importance to get it delivered safely, but you transport it in the open bed of a pickup truck with a guard whose only armament is a watergun.

#endrant


When they lay you on the table, better keep your business clean.

Offline

 

#19 2006-07-10 01:55:27

UnLogikal
Habitual Malcontent
From: Flint, Michigan
Registered: 2005-06-08
Posts: 5676
Expertise

Re: Rails on TextDrive and the Samurai

ubernostrum wrote:

Eh. I haven't had problems.

And to recount something I posted on one of the Django mailing lists (in a discussion about Django-friendly hosting), I have yet to achieve an understanding of how people have "mission-critical" business and client sites which don't merit more than basic shared hosting. That's like saying that you've got your company payroll and it's of the utmost importance to get it delivered safely, but you transport it in the open bed of a pickup truck with a guard whose only armament is a watergun.

#endrant


Yea... kind of struck me as odd too. I guess I just assume that most companies are too stupid to understand the concept so the cheaper the better. Just turns around and bites them in the ass and they sit there angry at the host for their ignorance.


Kyle

Offline

 

#20 2006-07-10 02:56:36

Dharma Punk
Member
Registered: 2005-09-17
Posts: 138
Website  Expertise

Re: Rails on TextDrive and the Samurai

Aye. If I'm hosting mission-critical applications/sites, I'm at least looking at a business hosting plan

Offline

 

#21 2006-07-10 09:16:32

crx
New member
Registered: 2006-06-13
Posts: 11
Expertise

Re: Rails on TextDrive and the Samurai

Well come one now, it does depend, some people develop and maintain sites for quite large, or at least medium sized business. Others, myself included, develop smaller sites that might only get a fraction of the traffic compared with yours, and yet those visitors are ecommerce customers buying products from small cottage industries. Fair enough I'm in the UK where business is perhaps smaller (I don't know the US) but these can easily be described as 'mission critical' since they are the primary revenue stream for a small family business. That they only have 3,000 customers and don't need anything more than shared hosting doesn't mean that it's not mission critical, neither does it mean it's not 'real business'.
Please don't take offence at this, but I feel sometimes that some of you who deal with larger, perhaps international business and 'enterprise' forget about the little people making small but important income from the Internet age - and for a lot of these people moving to a dedicated hosting solution would mean a massive drop in profit for something they absolutely don't need, it would mean running their businesses not to feed their kids but so that they can pay TextDrive (or which ever hosting company they use) their hosting fees. Please don't judge shared hosting account holders as second-class citizens and unworthy of 'proper' support just because you're lucky or skilled enough to be working for the big fish. Peace everyone.

Offline

 

#22 2006-07-10 10:32:09

dpdnolan
Member
From: London, UK
Registered: 2006-01-17
Posts: 80
Website  Expertise

Re: Rails on TextDrive and the Samurai

1) I thought the resource limits and AUP on Business plans were the same.

2) Point taken about "mission critical" apps. But exactly what kind of app would you be content to see killed off - apparently arbitrarily?

3) Pls can we return to troubleshooting?

qbert72 wrote:

What does Rails do when it's not processing requests? Could something like garbage collection cause this?


According to why:

Garbage collection is triggered when:

1. Ruby goes to allocate memory and its internal memory counter shows that not enough is available inside Ruby. This just means that Ruby will garbage collect first, before grabbing more of your system

Last edited by dpdnolan (2006-07-10 10:32:44)


Let's dye our hair ginger and fly to Mexico

Offline

 

#23 2006-07-10 12:52:12

qbert72
Member
From: Montréal, Québec, Canada
Registered: 2005-05-08
Posts: 565
Website  Expertise

Re: Rails on TextDrive and the Samurai

dpdnolan wrote:

qbert, are you using RMacgick?


I'm not. Are you? From previous reports, its problems are more related to memory consumption than CPU usage.


VCIII -> Mixed Grill = Jervis: not the guy from Survivor -> Bridgeway: You need more than luck in Shanghai
AC200 (S)

Offline

 

#24 2006-07-10 14:52:46

dpdnolan
Member
From: London, UK
Registered: 2006-01-17
Posts: 80
Website  Expertise

Re: Rails on TextDrive and the Samurai

Yes I am. Useful thread, thanks.
OK so I'm stuck.


Let's dye our hair ginger and fly to Mexico

Offline

 

#25 2006-07-10 15:08:10

yerejm
バカ
Registered: 2004-12-03
Posts: 307
Expertise

Re: Rails on TextDrive and the Samurai

You could see if you could make do with MiniMagick.

Offline

 

#26 2006-07-10 16:08:18

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

qbert72/dpdnolan:

This was listed as an "ongoing problem":

"We have had a couple of reports where our watchdog was killing processes because of high CPU utilization, despite there being little or no traffic at the moment on the site. The CPU stats used are those reported by FreeBSD as being used in real time, so there is obviously something wrong either with how FreeBSD reports on CPU usage, or with what happens inside of the processes regardless of incoming traffic."
http://help.textdrive.com/index.php?pg= … 2&pc=2

The follow-up said that they were raising the limits, which I suppose hasn't fixed the problem for you guys.

Offline

 

#27 2006-07-10 16:22:53

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

When my site was dying left and right on TxD, before I switched to another host, it was because of 2 reasons:
1) The Samurai
2) Something to do with Lighttpd and concurrent requests

Ad 1: The Samurai has been replaced by a kinder, gentler Samurai, so that should address some of the problems that I was having.

Ad 2: After sinking many-an-hour into trying to solve the problem, I decided to try replacing Lighttpd with Apache to see if the same thing would happen, and it didn't.

Have any of you tried using Apache instead of Lighttpd?

Offline

 

#28 2006-07-10 16:31:03

qbert72
Member
From: Montréal, Québec, Canada
Registered: 2005-05-08
Posts: 565
Website  Expertise

Re: Rails on TextDrive and the Samurai

rick, my app hasn't been killed in a week, but I still want to know why it was killed beforehand.

TextDrive uses Apache 2, whose FastCGI is "broken" (read this in the forums, haven't experienced it myself), which is why Lighttpd is the recommended web server at TextDrive for FastCGI stuff. I have not experienced any trouble with Lighttpd, but my app is getting very little traffic.

And then, for even more bleeding edge, lightning-fast performance, there is always Mongrel, which I plan to stay away from as long as possible. I am a late adopter.


VCIII -> Mixed Grill = Jervis: not the guy from Survivor -> Bridgeway: You need more than luck in Shanghai
AC200 (S)

Offline

 

#29 2006-07-10 16:38:39

Arthur
Celebrity Death-panelist
From: Vancouver, BC
Registered: 2004-09-23
Posts: 593
Website  Expertise

Re: Rails on TextDrive and the Samurai

If the Samurai is responsible for the recent vast improvement in server uptime at TextDrive then it's a Good Thing, despite any tuning hiccups.

Offline

 

#30 2006-07-10 16:44:17

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

I'd heard that about Apache 2 as well, but my site is running much better on Apache 2 than it ever did on Lighty:

Server: Apache/2.0.54 (Unix) PHP/4.4.2 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.1.4

I wanted to use Lighttpd initially because that's what David Heinemeier Hansson said we should use. (He built Rails -- wouldn't he know?) In my experience, though, Apache is solid, and Lighttpd is brittle. My site was getting about 2000 page views a day; around peak times, on Lighttpd, it was going down constantly.

This makes sense, in retrospect: Apache is battle-tested. I hadn't even heard of Lighttpd until after I had heard about Rails.

Offline

 

#31 2006-07-10 16:49:07

derekmw
New member
Registered: 2006-03-04
Posts: 4
Expertise

Re: Rails on TextDrive and the Samurai

I have yet to achieve an understanding of how people have "mission-critical" business and client sites which don't merit more than basic shared hosting.


Not everybody is in the same situation, though it's easy to assume that.

My client serves unions and non-profit organizations. Money isn't plentiful (I barely get paid in most cases...) and I'm not left with much choice. My clients just simply don't need and can't afford dedicated hosting.

My application, a small directory of businesses, isn't going to get any bigger, and a small shared hosting account ought to do. At least for now, things are okay, but this is only day 3. I'm hopeful but I'm keeping my bags packed.

Offline

 

#32 2006-07-10 17:12:27

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

Likewise, my client is a small business that doesn't have that much money.

Bottom line: A simple app should not be crashing when it gets a meager amount of traffic. Yes, even under shared hosting. I can understand the site being a bit slow on a shared hosting plan, but grinding to a complete halt, never to come back unless you revive it manually / schedule a cron job?

In extreme situations I could imagine that being the fault of the application. In my case, it wasn't. There was something wrong with the server.

I don't want to place the blame entirely on TextDrive, but really, they should have hammered out the kinks themselves and then made it dead simple to implement, or been up front with people about the need to deal with these sorts of problems themselves. When I signed up, I didn't think that I'd have to go through a crash course in getting Lighttpd to run properly. I assumed a certain amount of configuration would be necessary, but I had no idea that I'd have to mess with such low-level details.

As an aside: I -- like most people I assume -- used Rails because it made things easy to do with high-level abstractions of what would otherwise be rather taxing, low level detail. Spending this much time just making it run somewhat defeats the purpose of it. When you write an app in PHP, you don't have to think about Apache for any more than 5 minutes. When you write an app in .NET, you don't have to think about IIS for any more than 5 minutes. In both cases, the site will just keep humming along unless it gets utterly swamped with traffic -- in which case it will be inaccessible for a short period of time, but that's it. The same should be true of Rails sites and, by extension, Rails hosting.

Offline

 

#33 2006-07-10 17:47:45

dpdnolan
Member
From: London, UK
Registered: 2006-01-17
Posts: 80
Website  Expertise

Re: Rails on TextDrive and the Samurai

@Rick: I agree RoR deployment is nontrivial at the moment, but I'm not sure TxD should take any of the blame for that. In fact, I found that, after a month or two of headless n00bism, I got 3 RoR apps up and running in 30 mins just by following chapter 9 of the TxD Manual.

I didn't want to get intimate with Lightty. But for reasons connected to Joel Spolsky's Law of Leaky Abstractions, it turns out that if you want to deploy technology X, which depends on technology Y, you will almost always have to learn how to tinker with Y. Especially if X and Y are relatively immature.

People here have good reasons for using shared hosting on TxD. We have an interest in it being as good as possible. Samurai is welcome. What qbert and I are trying to discover was why our apps crashed. Is it something that we can fix, or is it FreeBSD/Samurai?


Let's dye our hair ginger and fly to Mexico

Offline

 

#34 2006-07-10 18:17:24

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

dpdnolan wrote:

@Rick: I agree RoR deployment is nontrivial at the moment, but I'm not sure TxD should take any of the blame for that.


There's no use crying over spilled milk, but the reason I would place some blame on TxD is that they aren't doing something that others are doing. Rails hosting doesn't have to feel this hacky and unstable. If everyone was experiencing the same problem with Rails, I'd be inclined to agree, but the fact is that others have gotten this down. Why not the semi-official RoR host?

dpdnolan wrote:

In fact, I found that, after a month or two of headless n00bism, I got 3 RoR apps up and running in 30 mins just by following chapter 9 of the TxD Manual.


The problem with me has been keeping it up, not getting it up. (Insert off-color joke here.)

dpdnolan wrote:

I didn't want to get intimate with Lightty. But for reasons connected to Joel Spolsky's Law of Leaky Abstractions, it turns out that if you want to deploy technology X, which depends on technology Y, you will almost always have to learn how to tinker with Y. Especially if X and Y are relatively immature.


Your point is well-taken. That's part of the reason that I was a bit worried about deploying a Rails app on Lighttpd in the first place. Honestly, it seems like Lighty is still a work in progress. Apache is battle-hardened. I'm much more comfortable with using a "Y" (in your analogy) that is mature.

dpdnolan wrote:

People here have good reasons for using shared hosting on TxD. We have an interest in it being as good as possible. Samurai is welcome. What qbert and I are trying to discover was why our apps crashed. Is it something that we can fix, or is it FreeBSD/Samurai?


The problems that I was experiencing had to do with Lighttpd, not Rails, or FreeBSD. (And, as I've said before, the Samurai was only responsible for a few of these issues.)

Have you tried deploying it on Apache with FastCGI on TextDrive?

Offline

 

#35 2006-07-10 18:27:19

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

In looking over the TxD knowledge base again, it looks like you wouldn't be able to set this sort of thing up anyway:

TextDrive wrote:

To get Rails up and running at TextDrive you will need to configure Lighttpd as your default server and then configure it to work with your Rails application. Unfortunately, it

Offline

 

#36 2006-07-10 18:43:39

dpdnolan
Member
From: London, UK
Registered: 2006-01-17
Posts: 80
Website  Expertise

Re: Rails on TextDrive and the Samurai

rickreilly wrote:

Have you tried deploying it on Apache with FastCGI on TextDrive?


Only briefly on my dev setup. I don't think I'll try it on TxD until it's the recommended setup. Also I'm loath to swap out Lightty until I understand what's going on. As for moving hosts, what can another host be doing that TxD isn't?


Let's dye our hair ginger and fly to Mexico

Offline

 

#37 2006-07-10 20:17:12

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

dpdnolan wrote:

Only briefly on my dev setup. I don't think I'll try it on TxD until it's the recommended setup. Also I'm loath to swap out Lightty until I understand what's going on.


That makes sense.

dpdnolan wrote:

As for moving hosts, what can another host be doing that TxD isn't?


I have no idea what they did. They've no doubt done a ton of hacking behind the scenes to get Apache to work well with FastCGI and Rails. But whatever they did, it just works.

Very simply: I follow the setup instructions. Then the app just works... and more importantly, it just keeps working when the load gets heavy.

Before switching, my app was going down on average 5 times a day. Since then, it hasn't gone down once. It's just running and running and I don't have to put on my SysAdmin hat to figure out how or why it's doing what it's doing.

Keep in mind: I didn't change a single character in my app. All I did was redeploy. Everyone kept saying (customer support, for example) that there was probably something wrong with my app, but there wasn't. It was all the server.

If you're dead-set on using Lighty -- or if you really want to get good at dealing with Lighty -- more power to you. If you just want your app to work, though, I would recommend switching.

Offline

 

#38 2006-07-11 02:04:40

CaptnBenno
Mental Mechanic
From: Perth, Australia
Registered: 2005-09-09
Posts: 95
Website  Expertise

Re: Rails on TextDrive and the Samurai

i have to say i have had two fairly basic RoR apps running on <the server i am hosted on at TxD) for quite some time. months even, until recently the server crashed and within a short time it was back up and so were my sites.

both setup using the reccommended method, both on lighttpd and it was all very straight forward.

i have a couple of other sites (mainly static stuff) that also have the same kind of up time, running on the apache setup.

your logic about it must be the server is somewhat flawed as many people on here are running rails stuff without a problem, therefore it would be more likely that it's you app, or something that you DO in your app.

occaisionally i have found that rebuilding from scratch is a long, but very straight forward way of finding the little scrap of left behind code that was forgotten and is causing the unfindable bug. And because RoR is so bloody simple to make up the skeleton for, cut and paste isn't such a bad way to transfer the model/controller/rhtml/etc stuff over, as long as you read what you are pasting back in.

anyway, i've been hit by the samurai once, it wasn't nice, but after looking at my app i couldn't find anything, then i looked at the data and BOOM! there it was, someone had deleted a parent record and i hadn't thought of that (in the app, i mean, really, why would you remove an author?) and it caused the problem. Rewrote some code and viola! she works and no sword work required since.


VC ]|[ - MxG - Work - Play

Offline

 

#39 2006-07-11 02:47:30

rickreilly
New member
Registered: 2006-06-30
Posts: 13
Expertise

Re: Rails on TextDrive and the Samurai

CaptnBenno wrote:

i have to say i have had two fairly basic RoR apps running on <the server i am hosted on at TxD) for quite some time. months even, until recently the server crashed and within a short time it was back up and so were my sites.


How much traffic have you had?

CaptnBenno wrote:

your logic about it must be the server is somewhat flawed as many people on here are running rails stuff without a problem, therefore it would be more likely that it's you app, or something that you DO in your app.


1. The issue has never been getting the app to run, but getting it keep running. I'm interested to hear how much traffic you've been able to sustain. I have yet to hear from anyone who's gotten a significant amount of traffic and who's been able to keep their rails app running on a shared hosting environment here.

2. If there was something wrong with the app, wouldn't you expect it to cause problems on the other server as well? All I did was drop it into a different hosting environment. That's the only thing that changed.

Offline

 

#40 2006-07-11 05:32:56

mamash
I Just Work Here
From: Prague
Registered: 2004-06-01
Posts: 2084
Website  Expertise

Re: Rails on TextDrive and the Samurai

I thought I'd throw in some light on this.

1. There is a watchdog (the samurai) which takes care of two things: CPU intensive tasks (that's where the latest update to kill less applies) and zombies (no changes, will kill zombies' parent after a grace period).

2. There are FreeBSD memory limits which have not changed and typically account for bloated Typo dispatcher getting killed (note that a long and nasty memory leak was supposed to be fixed in Typo just days ago). Such kills are not logged to the process_watchdog.log file, as, frankly, FreeBSD doesn't provide any logging facility for this.

3. The bug in mod_fastcgi mentioned is a reality but only surfaces once a certain amount of processes get to be run on a server. This may not ever become a problem elsewhere, but from our experience, on a server where suddenly everybody wants to do Rails, it has only taken weeks for the problem to show up (and then it's intermittent 500's, with error log telling us to raise the limit, after we raised it to any level we could think of). There are other ways of getting FastCGI working with Apache (e.g. mod_fcgid) and also different approaches like mongrel, all of which we are evaluating for hosting purposes (but switching existing setup on thousands of accounts would be a nightmare of course). Apache is fine and we still use it for our own purposes, but once you get to a certain number of domains/sites/processes (with mod_fastcgi), it becomes a hog.

4. I don't think we ever experienced a real Lighttpd crash (judging on all the support requests we have got so far) and while there obviously are persisting bugs in Lighttpd (e.g. handling of Blowfish hashes on basic auth), I don't remember any that would make it go down on us. What typically happened was that a dispatcher was killed (for either CPU or memory reasons, see above), and if it was spawned statically (i.e. not as per the current howto in our KB), it would become zombie, hence Lighttpd would get a zombie treatment (as described above), making your wonder where all your stuff had gone.


The things you can't remember tell the things you can't forget.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson