0

I am implementing the Mahout user-based recommendation engine where the recommendations will be served via RecommenderServlet running in Tomcat.

So far looks like a basic setup, but it has some extra properties:

  1. Recommendations will be served from 100 different data models, depending on user's context. Each data model is ~2 Mb.

  2. There could be 1000s of concurrent users querying recommendations at a given time.

One option I considered is setting up one RecommenderServlet per data model. So there will be 100 of them distributed between multiple Tomcat instances.

The main question for Mahout experts:

Would you recommend to set up one RecommenderServlet per data model, or there are better alternatives?

4

1 回答 1

0

I don't think that choice really makes a difference to the issues of performance you mention.

It's more about what makes more logical sense to you. A servlet typically provides one logical service and answers one "type" of request -- for a page, or method. In theory you could have one servlet serve everything on your site but it would be ugly, design-wise.

My rule of thumb would be to use different servlets for different URL paths.

It's not going to change the memory requirements or performance though. Either way you're serving those requests, from that data in memory.

Now, you could in fact dedicate whole instances of Tomcat to serving only a subset of those 100 models. But then you're really running different web apps, on different servers. It's no longer a question of 1 or 100 servlets, but a bigger choice of splitting up your architecture.

于 2011-09-27T15:19:20.677 回答