Deployment server

I’ve worked with Java, Tomcat, Rails, lighttpd, apache, fcgi, scgi,
windows/mac, etc etc. and I don’t think that Tomcat is any better/worse
than
lighttpd with fcgi/scgi.

Dropping in a war file and having Tomcat explode it and map it to a url
is
nice, but as Kent said, once you start configuing your connection pool,
server.xml, web.xml, and the other *.xml files in your apps, its just as
much a headache as Rails. What I like about Java and Tomcat is that you
can
package other jar files with your application, so that you can deploy to
any
server with java/tomcat installed. The Rails equivalent of this would be
being able to package other gems with your rails application and having
rails reference those gems rather than looking in your ruby
installation.

However, as far as the two containers go, they are pretty similar. Both
require some configuration to get going. As far as stability, tomcat has
the
edge, but lighttpd/fcgi/scgi or apache/fcgi/scgi is gaining alot of
steam.
Zed S. and company is making that happen. SCGI is totally awesome, it
has
turned my slow and unstable windows Apache/fcgi app to super fast and
stable. Mongrel already looks like the next step up. Just remember that
Java
has Apache, jBoss, and other big OSS companies catering to their server
needs. We have DHH, Zed, and other great talents, and they are doing
things
now that took these other companies years to get right.

Finally, I think alot of software that people call “enterprise worthy”
is
not because of the actual software, but because of its supporting cast.
Tomcat has this thing called “Apache” going for them. That means
support,
regular updates, bug fixes, etc. That means one installation and some
configuration, as opposed to downloading 3 or 4 things and tieing them
together.

For a bunch of guys who believe in open source, I’d say we’re not doing
so
bad. It’s only been a couple months since rails even came out of beta
=)

A lot of the Java people I know say that Tomcat is a dog and they prefer
Resin a great deal more.

As for Lighty, I found it quite a bit easier to install and setup than
Apache.

Joe

On Feb 17, 2006, at 21:29, Jin L. wrote:

Dropping in a war file and having Tomcat explode it and map it to a
url is nice, but as Kent said, once you start configuing your
connection pool, server.xml, web.xml, and the other *.xml files in
your apps, its just as much a headache as Rails. What I like about
Java and Tomcat is that you can package other jar files with your
application, so that you can deploy to any server with java/tomcat
installed. The Rails equivalent of this would be being able to
package other gems with your rails application and having rails
reference those gems rather than looking in your ruby installation.

Isn’t this what lib and vendor are meant for?

– fxn

Ben,
Thanks for the time spent on your response!

I think in some ways we’re in complete agreement and in others we likely
have different priorities.

For example, it would be a decided retrograde maneuver to have to be
concerned with process management, request creation, and all the cruft
from the old CGI world. Servlets took care of that, mod_{php, perl,
ruby, etc. } took care of that, Rails takes care of that. It’s pretty
much a given these days. In that sense servlets solve a real problem
for the developer, but it’s also been solved in another half dozen ways
in other environments.

I also believe it would be nice if it were possible to pick up a little
bundle of model(s), view(s), and controller(s), with routes, drop it
into a directory and have it served off the URL root as a mini Rails
app. That’s actually not too far away – especially if you look at
plugins with the right perspective – given the non-trivial “if” of
having a properly configured web front-end in place.

Is making a plugin harder than making a .war file? Hard to tell.

Starting from novice in either paradigm (Java vs. Ruby/Rails) I would
estimate they are equally difficult – but that’s actually unlikely to
be improved for anyone over time, as there will always be a novice and
things will always be somewhat difficult for him. The more you try to
smooth away the wrinkles, the less powerful the tool he’s using becomes.

For those with some experience in the paradigm, making a .war is
probably less difficult than making a Rails plugin. That, however, is
unrelated to the validity of Rails deployment techniques: either the
overall non-servlet/non-container methodology is sound or it isn’t ­-
ease of making a drop-in package is more a question of optimizing to
developer audience.

But, on the question of whether we should be able to make drop in
“components” for pluggable deployment for Rails, I tend to side with DHH
on this one. Much of the software world has pre-occupied itself with
the “reusable components” holy grail for well over a decade now. The
Java economic ecosystem (not less the .Net market) seems to rely on this
reusability dream to keep its monetary Krebb’s Cycle flowing
perpetually. From where I sit, though, there still aren’t reusable
components. As David has said numerous times (I’m sure I’m
paraphrasing, so forgive me) once a component becomes big enough to be
of use, it’s unwieldy enough that writing it afresh is often easier
than fitting it to your system.

That as may be, I think where I see us having different priorities (and
if we’re lucky we’re representative of two broader groups with similarly
differing priorities) is in the value of “sharing” at the process level.

I think you’ve identified a trade-off that is of relevance. On one end
of the spectrum, to get the sort of persistence between calls or the
sharing between processes/threads that you highlight, certain constructs
must be available to the program. This means a certain amount of
infrastructure must be present to support that type of persistence
and/or sharing. The more important this sharing is, the more the
architecture is built around supporting sharing without burdening the
developer.

On the other end of the spectrum, to get the ability to pare down the
infrastructure, to be able to scale trivially and cheaply, to use small
and efficient specialized parts (“loosely joined”?), certain
architectural techniques are used which result in, essentially zero
sharing – sometimes known as the Share Nothing approach. Clearly, this
makes it more difficult for the programmer to share information between
requests or across the process/thread boundary (hence things like
storage in the session, DRb servers, memcache integration, even using
the database as a blackboard all become common techniques).

There’s a sharing continuum with tradeoffs. On the one end, while there
may be more overhead in setting up for easy sharing, it becomes easy for
the programmer to contact processes around the server (and cluster), and
easier to leave things in memory for later use. On the other end of the
spectrum, while it may be difficult to do certain types of
communication, the overhead in setting up a project is reduced.

The fundamental problem I think people are trying to solve in building
large-scale applications is building large-scale applications. Choosing
a point on the sharing spectrum is one part of that process of building.

All along that spectrum everyone is basically in agreement that
developer time is worth more than hardware cost. We can always throw
more hardware at the problem. The Share Nothing crowd says, “By sharing
nothing we can scale horizontally faster and cheaper than guys who don’t
Share Nothing.” The other crowd (Share Something?) says, “Yeah, but
you’re going to have to share eventually to get things done, so you
might as well plan for it. We can still throw hardware at the problem,
maybe it costs us 15% more, but that’s still cheap.”

Sitting mostly in the Share Nothing world, I perceive things a certain
way:

  • The sharing people talk about doing isn’t actually as common as it’s
    made out to be. I.e., optimizing for it is premature optimization,
    which is the famous Root Of All Evil. Corollary: the cost of sharing
    architecture is often high, and the biggest proponents of installing
    such architecture are usually the vendors who stand to make even more
    money when the architecture becomes unwieldy and requires support.

  • While it appears that sharing and messaging in the way we’re talking
    about will save developer effort, often the communication mechanisms
    fail to work as intended and result, even when working properly, in
    increased coupling and complexity. If that’s not the Root, it’s the
    Trunk Of All Evil. Developer cost and support cost tends to go up
    rather than the intended down.

  • Once one starts down the road away from Share Nothing the ability to
    change storage strategies, to change how a system is accessed, to make
    decisions on where to put which data all become compromised. It
    becomes difficult to Refactor the application deployment layout.

I tend to see the Share Nothing philosophy as the Agile Deployment
philosophy. It stresses YAGNI. It stresses repeatability. It stresses
scalability both up and DOWN.

(…try running JBoss on a 486 laptop sometime, and try running Rails
in the same environment. And while deploying to tomcat may be as
simple as dropping in a .war, and setting up tomcat might require just
a couple of commands, the stack required is as light as a
self-assembling dump truck. I’m not saying we should consider the 486
laptop as a deployment target, merely that I feel the methodology
which gives up little if anything and foregoes no option for
deployment is more Agile than the one which closes off platforms as a
condition of adoption)

It stresses using what works for the problems at hand. Rails takes
things a step further and says, rather than building countless doomed
frameworks which try to predict what constructs will be useful (Big
Design Up Front), let’s extract the useful pieces from applications that
already work, and refactor those pieces for use where they make sense.

If what you do a lot of is sharing information between processes, then
you should optimize your design for that. If, on the other hand, that’s
something you do rarely, that’s something you shouldn’t be optimizing
for. Rails currently doesn’t optimize for sharing between
process/requests, because the real world applications from which it is
extracted never do that sort of thing. Will this kill Rails’ “adoption
into the enterprise”? Hard to tell now, but there’s no point in trying
to fabricate scenarios that have no applicability to real applications
since that’s the exact opposite technique to the one the Rails framework
developers took, and many believe is why Rails has been so successful.
Thinking otherwise is more BDUF than Agile – and, while there may be
advantages to both mindsets, it’s going to be hard to find kindred souls
in the Rails community who want to discard an Agile way of thinking.

Not sharing between entities in the lifecycle has led to a Share Nothing
approach which turns out to have huge benefits in Business Agility – in
a sense Share Nothing is very much like taking Agile to where the
Enterprise Unified Process was trying to take the Rational Unified
Process. Rather than focusing on just the hunk of code we’re crafting,
we must focus on the lifecycle before and afterwards as well. What
would Agile look like in that expanded environment? I believe it starts
with Share Nothing.

Since Rails has started down the Share Nothing road and accrued the
benefits, while realizing that it’s not seeing the need to share things
between requests and processes, it moves farther and farther away from
Share Something. Will there come a time when the Rails developers want
rails to storm the “enterprise” castle but Share Nothing is keeping them
from there? Hard to say (though many seem compelled to say so).

I tend to think not. I think the Era of The Big App Server is slowly
(to put on my Bruce Tate hat: probably as slow as the never-ending
demise of COBOL, of course) coming to an end. Rails is already storming
the “enterprise” castle, but it’s doing so not because a consortium of
vendors and standards bodies are pushing it in, but rather because the
people from inside the castle are pulling it in themselves. Deploying
in a Share Nothing fashion will get the job done, and I’m of the belief
that the lost sharing won’t be missed along the way.

Anyway, this is really all to say that I see a spectrum of different
approaches to sharing in resolving the problem of building heavy-use
systems. Many in the Java community appear to choose one end of that
spectrum, while many in the Rails community choose the other end of that
spectrum. From experience I happen to place a higher priority on the
factors that promote Share Nothing, and believe I’ve seen in the Java
“enterprise” community an evolutionary history that tells me that, with
the tools available today, for the applications we’re tasked to build,
Shared Something rarely ever works. So I’m compelled to go with what
does work, which today is Shared Nothing – and nothing enables Shared
Nothing like Rails.

But that’s because of how I see my priorities. In another world,
perhaps just a block away someone may say “that doesn’t work for me.”
If so, they should do what does work for them.

Best,
Rick

http://www.rickbradley.com MUPRN: 881
| communicate,
random email haiku | among other things, ideas,
| emotions, or thoughts.

Hello all,

I teach Java to new programmers at a college. I use tomcat and jboss
and I have many years of “enterprise” development experience including
some very large e-commerce sites. I am really loving rails and I will
be teaching it too starting in the fall. I don’t even try to teach my
java students production installation, configuration, and tuning of
java application servers. It is just too complicated and is vendor
specific. Knowing how to work with jboss doesn’t really help you with
WebSphere. Every java shop that my students might work at will have
dedicated engineers for this.

I will be teaching this with rails, though. If you think about it for
a minute there really aren’t that many ways to do this. All of them
get discussed often on here on the list. Ezra is even writing a book
that will most likely be definitive and help rails move forward in
lots of “enterprise” shops. With WebSphere you really need to send an
engineer to expensive training before you try deploying something
major. With JBoss you have to figure out just what the heck they are
talking about and hope for the best.

The relative simplicity of deploying a production rails application is
one of its attractions for me and I hope that doesn’t get lost during
the next few years.

-Eric

Wow! Lots of food for thought there Rick. And I think we probably do
mostly agree. I hope
this thread hasn’t been too annoying for other folks, because I’ve found
it really
thought-provoking.

Couple of points: For the record, I wasn’t promoting the drop-in-able
.war file as a
plugin or component style device. I haven’t really seen anyone do such a
thing, though I
think it would be possible. What the .war approach gives you is the
ability to zip up your
project directory and drop it into your server’s webapp directory and it
handles the rest.

And interestingly enough, I do see a trend in the Java world towards
using replaceable
frameworks or components as needed rather than buying into the
mega-appserver world of
j2ee. This is the approach of the Spring framework, of which I am a big
fan. So,
ironically, I’m on the “use the tools you need to get the job done” side
of things in Java.

However, I think the original concern I had was at a different level
than all that. I was
just looking for – basically – a webrick that I start running and into
which can add and
remove my apps and which also provides a virtual machine memory space
that I can use
without having to deal with running a differnt process.

You know, I’m actually not even talking about scalability concerns
here… I know that
servlet containers can be clustered and all that. Any decent web
platform will have some
way of doing that. I’m more concerned with what runtime environment is
available to me as
a developer. Now, since there’s still plenty more for me to learn about
Ruby, I’ll
probably find ways of doing everything I want.

Ok. Now I’ll let this thread die a natural death!

b

Ezra Z. wrote:

Mongrel will be a great way to simplify things for rails deploys as
well. but i don’t think the goals of mongrel are to become a servlet
container as much as just a different take on fcgi style processes.
So you wold still want to proxy from lighty or apache to multiple
back end mongrel listeners is how I see it working. Of course Zed is

(Pardon if this screws up the thread, I’m trying a post from ruby-forum
for the first time)

While the OP mentioned differences between shared-nothing and threaded
environments, I think the original point and that of the quote from TSS
(or at least the point I’ve thought many times) is more so the relative
immaturity of deploying Rails for production (i.e. stable) deployments,
rather than a debate on process vs. thread models. Yes FCGI is old, but
I think it’s a safe bet the ruby-fcgi drivers and associated machinery
are not nearly as time-tested as FCGI itself and FCGI libs for Perl for
example.

My impression is it’s the perceived flakiness that worries many people,
and as originally mentioned, the “Rails Bible” even mentioning the
flakiness wasn’t especially encouraging. Lots of places can’t switch to
lighty, or have to use Apache2 (the status of FCGI with at this point is
hard to ascertain - though it was noted mod_fcgi work was going to
resume(?)). And as Ezra mentions (and is working on improving), much
documentation for deployment is scattered and piecemeal. That’s fine for
very roll-your-own types of shops, but that’s not all shops. And it’s
probably the main source of the “taped-together-ness” impressions and
comments.

Thankfully it’s all getting better, and I think somewhat ironically it’s
the contrast between how well and smooth all the Rails parts work
together and the still somewhat ad-hoc art (more than science) of
deploying a Rails app that makes this such a visible issue (for some at
least).

Another significant point is that most apps don’t need to scale to
enterprise levels; for those having a single process with threads that
easily handles your load is a much easier proposition than setting up a
shared-nothing setup and managing multiple listeners and so on, esp when
they seem to be flaky and require kill -9’s of zombie procs and so on.
This is one example of where Tomcat and friends are a much nicer option
than Rails, as Webrick doesn’t cut it. Hopefully mongrel will be able to
fill that spot for Rails (though I’m not clear on how the threading but
locking around Rails part will affect speed).

Sorry this is long, I’ve been thinking about this stuff a lot myself and
just brain dumped.

On Feb 17, 2006, at 1:45 PM, Rick B. wrote:

Best,
Rick

I have to agree with Rick here. I don't really see what the benefit

of a servlet type environment would be for rails deployments of
various sizes. Rails has been built from the start with the Shared
Nothing mentality. Instead of a monolithic app server that does
everything, rails delegates to other processes the tasks they do
best. And it makes sense, I wouldn’t want the complexity that would
come with trying to take a rails servlet container and scale it to
more and more machines as an app becomes more and more popular. As it
stands now it is relatively easy to add more hardware and spawn
external fcgi listeners on it from a lighttpd front end.

Mongrel will be a great way to simplify things for rails deploys as

well. but i don’t think the goals of mongrel are to become a servlet
container as much as just a different take on fcgi style processes.
So you wold still want to proxy from lighty or apache to multiple
back end mongrel listeners is how I see it working. Of course Zed is
a smart guy so we will see what he comes up with in this area. But
rails wasn’t built for sharing like a servlet. Ruby doesn’t have
native threads like java yet and so it becomes much more difficult
for rails to run multiple threads within one container then it is to
run multiple in memory fcgi processes.

So the problem of having global shared assets is better solved with

drb or memcached or something similar and keeping as much as possible
sharing nothing. Only explicitely share something if you really need
it to be shared. I agree with Rick that shared nothing fits better
with the agile practices of many ruby developers and with ruby itself
as well. Rails is gaining popularity in leaps and bounds these days
and I think the deployment options are getting better and better.
Lighttpd is really a very solid piece of kit now. Its a paradigm
shift away from the java servlet container mentality, but its no less
ready for the enterprise. I think we will see more and more
widespread adoption of rails in the enterprise and with it will come
more widespread adoption of the shared nothing approach to scaling
web applications.

Also the documentation on deploying rails apps for production is

severely fragmented and conflicted in its current state. This is the
reason I decided to write my book about it. Its one of the areas of
rails documentation that is sorely needed to be collected all in one
place. I hope to help solidify the communities understanding of how
rails apps work in production situations as much as i can with the
release of my book coming soon.

Cheers-
-Ezra Z.
Yakima Herald-Republic
WebMaster

509-577-7732
[email protected]