Restricting Thread Pool for Servlet instances

I am using WebLogic5.1.0 version wherein I am registering a Servlet which
would be called by all the clients connecting
to my aplication. The servlet's service methods is taking some time to
execute. Since the servlet is following a SingleThreadModel, when there are
a large number of Clients connected, the number instances of Servlets
created are very high and the number of thread in the Application Server
process becomes very high affecting the performance of the other
applications.
Is it possible to restrict the number of instances of the servlets that get
created in the Application server ?
What are the setting required to achieve this ?
Sandeep

Hi.
I'm not aware of a property setting that allows you to restrict the number of
servlet instances in WLS for the SingleThreadModel. The number of execute
threads is fixed - it does not grow depending on load. You can set this value
in the weblogic.properties file by setting weblogic.system.executeThreadCount.
This value is 15 by default.
It does sound like you are reaching the max capability of your
server/hardware. You should try tuning WLS.
Here are a couple of suggestions:
1. Try adjusting the executeThreadCount value to a higher value. Start by
setting it to 30 - see if that makes any difference.
2. Check out the following tuning guide:
http://www.weblogic.com/docs51/admindocs/tuning.html
3. Here is a list of admin properties that might aid in tuning:
http://www.weblogic.com/docs51/adminhelp/AdminPropertyHelp.html
4. If you are still having problems you might do better by posting this issue
to the performance newsgroup.
Regards,
Michael
Sandeep Rajpathak wrote:
I am using WebLogic5.1.0 version wherein I am registering a Servlet which
would be called by all the clients connecting
to my aplication. The servlet's service methods is taking some time to
execute. Since the servlet is following a SingleThreadModel, when there are
a large number of Clients connected, the number instances of Servlets
created are very high and the number of thread in the Application Server
process becomes very high affecting the performance of the other
applications.
Is it possible to restrict the number of instances of the servlets that get
created in the Application server ?
What are the setting required to achieve this ?
Sandeep--
Michael Young
Developer Relations Engineer
BEA Support

Similar Messages

  • Thread pool for Servlets

              Hi all,
              I am facing a big problem while doing a concurrent testing of my web application.
              I am testing with 60 concurrent users.
              I have set the database connection pool minimum capacity to 50, capacity increment
              to 10 and maximum capacity to 100.
              While there is no problem in getting database connection, the session variables
              are getting mixed up (i.e. the session variable for one user is coming up as that
              for another user!!!).
              Does it have something to do with configuring some pool for servlets threads or
              something?
              Please help.
              Thanks a lot in advance and best regards,
              Jaya
              

              Hi all,
              I am facing a big problem while doing a concurrent testing of my web application.
              I am testing with 60 concurrent users.
              I have set the database connection pool minimum capacity to 50, capacity increment
              to 10 and maximum capacity to 100.
              While there is no problem in getting database connection, the session variables
              are getting mixed up (i.e. the session variable for one user is coming up as that
              for another user!!!).
              Does it have something to do with configuring some pool for servlets threads or
              something?
              Please help.
              Thanks a lot in advance and best regards,
              Jaya
              

  • Configuration of Thread Pool for CQ's Web Container

    I am trying to detrmine whether there is any specific configuration for tuning the web container thread pool for CQ. The only configuration I observe is OSGi 's Apache Sling Event Thread Pool but tuning this does not directly correlate to the thread pool that is used for serving web requests by the publish instance.
    Any help would be greatly appreciated as I work through tuning our CQ instance.

    Unfortunately, the max thread settings is not exposed in CQ 5.5.However, all the other configurable settings (equivalent for server.xml) can be seen at [1]
    [1] http://localhost:4502/system/console/configMgr/org.apache.felix.http
    This is fixed in CQ 5.6 current release.
    Thanks,
    Varun

  • Thread pools for execute queues

    We've set up thread pools for several execute queues dedicated to high-load servlets
    in our application. Once in a while, we get into a condition in which none of
    these threads are available and then the threads never become available - we have
    to restart the server.
    I realize that this is a pretty generic description of the problem :-) but I wonder
    if anyone else has encountered this and has an idea what might be causing it ?
    Right now I am guessing that something in our code causes a resource contention
    that eventually deadlocks all the threads. But that is just a guess.

    Ethan,
    "Ethan Allen" <[email protected]> wrote in message
    news:3e0220a1$[email protected]..
    Thanks, Dimitri and Slava !
    I will do this and learn a little emore ...FYI, there is a web site dedicated to weblogic documentation -
    http://e-docs.bea.com/
    Pick your server version, go to "Search", type "thread dump".
    Regards,
    Slava Imeshev
    >
    ethan
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ethan,
    For windows press <Ctrl>+<Break> in the server shell window,
    for *nix send kill -3 {server PID}.
    Regards,
    Slava Imeshev
    "Ethan Allen" <[email protected]> wrote in message
    news:3e020fb4$[email protected]..
    Thanks for your reply, Dimitri.
    We have not looked at thread dumps. How may we do this ?
    Ethan
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Did you try looking at thread dumps when this happens ?
    Ethan Allen <[email protected]> wrote:
    We've set up thread pools for several execute queues dedicated to
    high-load
    servlets
    in our application. Once in a while, we get into a condition in
    which
    none of
    these threads are available and then the threads never become
    available
    - we have
    to restart the server.
    I realize that this is a pretty generic description of the problem:-) but I wonder
    if anyone else has encountered this and has an idea what might be
    causing
    it ?
    Right now I am guessing that something in our code causes a
    resource
    contention
    that eventually deadlocks all the threads. But that is just a
    guess.
    >>>>
    Dimitri

  • Custom thread pool for Java 8 parallel stream

    It seems that it is not possible to specify thread pool for Java 8 parallel stream. If that's so, the whole functionality is useless in most of the situations. The only situation I can safely use it is a small single threaded application written by one person.
    In all other cases, if I can not specify the thread pool, I have to share the default pool with other parts of the application. If someone submits a task that takes a lot of time, my tasks will get stuck. Is that correct or am I overlooking something?
    Imagine that someone submits slow networking operation to the fork-join pool. It's not a good idea, but it's so tempting that it will be happening. In such case, all CPU intensive tasks executed on parallel streams will wait for the networking task to finish. There is nothing you can do to defend your part of the application against such situations. Is that so?

    You are absolutely correct. That isn't the only problem with using the F/J framework as the parallel engine for bulk operations. Have a look http://coopsoft.com/ar/Calamity2Article.html

  • [svn] 1605: Bug: BLZ-155 - Deadlock using a thread pool for tomcat connectors

    Revision: 1605
    Author: [email protected]
    Date: 2008-05-07 14:24:53 -0700 (Wed, 07 May 2008)
    Log Message:
    Bug: BLZ-155 - Deadlock using a thread pool for tomcat connectors
    QA: Yes - Jorge verified in the QE lab
    Doc: No
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-155
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/client/EndpointPushNotifier.j ava

    Cross post: http://forum.java.sun.com/thread.jspa?threadID=5215686&tstart=0
    If you must post across forums, just post in the most relevant one and then give the link to that in the other posts.

  • Servlet Thread Pools for iPlanet WS 4.1

    We have iPlanet WS 4.1 SP 5, running on HP UX. Wanted to make sure servlets run fast, so set up servlet thread pool. Initial result was that even the startup servlet could not be loaded, got stack overflow. Reduced number of threads from 60 to 5. Now startup servlet kicked off OK, but a subsequent servlet processing a request bombed with same error. This is obviously some kind of resource issue; how does one allocate enough memory or whatever it needs to handle the thread pool? Do I really even need a thread pool?

    Thanks, and a follow-up question: at that reference, it seemed to imply there is really no need to allocate a user thread pool if running on Unix. Could even slow down the application. Am I likely to be OK with about 300 concurrent users if I don't allocate a thread pool? I was afraid they'd be single-threaded through the front controller servlet if I did not specifically allocate and use a thread pool, but perhaps multiple threads are already built into the container?

  • Thread ID for servlets implementing SingleThreadModel

    Container creates different instances for every request to a Servlet implementing SingleThreadModel. So I tried to print thread IDs for such a Servlet by calling Thread.currentThread().getId(). I expected different thread IDs for every request to this Servlet. But what I noticed is - the same thread ID is logged several times (I got thread id 98 and 99 more than once). Can someone please explain why this is behaving like that?

    If container creates a thread pool and if it assigns different requests to same thread (fetched from the pool), then what's the point in creating multiple instances of one servlet?

  • Thread pool in servlet container

    Hello all,
    I'm working on this webapp that has some bad response times and I've identified an area were we could shave off a considerable amount of time. The app is invoking a component that causes data to be catched for subsequently targeted apps in the environemnt. Our app does not need to wait for a response so I'd like to make this an asyncronous call. So, how best to implement this?...I considered JMS, but started working on a solution using the Java 1.4 backport of JSR 166 (java.util.concurrent).
    I've been testing the use of a ThreadPoolExecutor, using an ArrayBlockingQueue. The work that each Runnable will perform involves a lot of waiting (the component we call invokes a web service, among a couple other distributed calls). So I figure the pool will be much larger than the queue. Our container has 35 execute threads, so I've been testing with a thread pool size of 25, and a queue of 10.
    Any thoughts on this approach? I understand that some of this work could be simplified by JMS, but if I don't need to be tied to the container, I'd prefer not to. The code if much easier to unit test, and plays nicely with our continious build integration (which runs our junit test for us and notifies on errors).
    Any thoughts are greatly appreciated...Thanks!!

    Well, if it works, that's by far the best way to go - but note that creating threads in a servlet container means those threads are outside of the container's control. Many containers will refuse to give the new threads access to the JNDI context, even, and some may prevent you from creating threads at all.

  • Which structure to use for time-restricted thread pools

    Hi,
    I am looking for the advice on the best concurrent structure (if such even exist)
    for executing concurrent jobs and forcing the timeout on these.
    Here is the problem description:
    I have to call up to 50 webs services.
    I want to run these web service calls concurrently (i.e. in separate threads)
    I want to force timeout, or execution windows of each one of these threads.
    E.g. I want to make sure that each threads completes the execution in 5 sec
    regardless if the web service result has returned or not.
    Is there a combination of the pool and a worker type from java.util.concurrent
    or elsewhere that would allow me to implement this functionality.
    Thank you in advance,
    Edmon

    Do you want get rich easily?
    You can change life, you can have money as much as you want. All you have to do is to send 12 dollars to 6 people bank accounts.
    All you have to do is the fallowing:
    You have to have bank account. You have to send 2 $ to below listed bank accounts. This is legal, you made a favour for those people and for your self.
    This is the bank accounts:
    1. LT957300010074515201
    2. LT217044000017612013
    3. LT547400012388523830
    4. LT857044000879616105
    5. LT577300010085485906
    6. LT837300010088377105
    After sending money, you need to delete the first bank account and make room for your account, after deleting first account, in the bottom of the list write your accounts number. You have to delete only the first one. Very important to do it honestly.

  • Thread pool configuration for write-behind cache store operation?

    Hi,
    Does Coherence have a thread pool configuration for the Coherence CacheStore operation?
    Or the CacheStore implementation needs to do that?
    We're using write-behind and want to use multiple threads to speed up the store operation (storeAll()...)
    Thanks in advance for your help.

    user621063 wrote:
    Hi,
    Does Coherence have a thread pool configuration for the Coherence CacheStore operation?
    Or the CacheStore implementation needs to do that?
    We're using write-behind and want to use multiple threads to speed up the store operation (storeAll()...)
    Thanks in advance for your help.Hi,
    read/write-through operations are carried out on the worker thread (so if you configured a thread-pool for the service the same thread-pool will be used for the cache-store operation).
    for write-behind/read-ahead operations, there is a single dedicated thread per cache above whatever thread-pool is configured, except for remove operations which are synchronous and still carried out on the worker thread (see above).
    All above is of course per storage node.
    Best regards,
    Robert

  • Servlet Instances

    How can we differentiate between Servlet instances and threads.
    Actuaaly i want to know how a servlet handles multiple client requests at the same time.
    what i know is like:::
    a client sends a request to the server.
    A new thread is generated which will call the instance of the serlvlet on the server for processing..
    Is this flow is correct???
    am bit confused between threads and instances.
    Please help!!!!

    If you make that your servlets implement the
    SingleThreadModel interface (definition below), then
    you can configure Tomcat with the size of the pool. I
    think that even you can have only one instance, but
    this is not very advisable, unless you want your users
    to wait...Thnx for reply, Do you know how I can tell Tomcat to start multiple instances or alway stick with single instance. I cannot find this.
    "public interface SingleThreadModel
    Ensures that servlets handle only one request at a
    time. This interface has no methods. Yes I am aware of this.
    If a servlet implements this interface, you are
    guaranteed that no two threads will execute
    concurrently in the servlet's service method. The
    servlet container can make this guarantee by
    synchronizing access to a single instance of the
    servlet, or by maintaining a pool of servlet instances
    and dispatching each new request to a free servlet.
    This interface does not prevent synchronization
    problems that result from servlets accessing shared
    resources such as static class variables or classes
    outside the scope of the servlet."If only one user can access the servlet using this interface then why would you want syncrhonization??? There shouldn't be synchornization issues with a servlet that implements SingleThreadModel right??

  • Cold Fusion in a generic thread pool and enabling JAVA don't mix

    I've got Cold Fusion MX installed on a server running Sun One 6.1. I ran into a problem trying to enable JAVA (for servlet support) which I had previous disabled because I didn't use it.
    Well, when I went to enable JAVA on the server last week, the service wouldn't restart and the error logs gave me no indication of the problem.
    Through a tedious trial-and-error process I've found that having Cold Fusion running under a generic thread pool while trying to have JAVA (the j2ee plugin) running under Sun One simply doesn't work (for whatever reason).
    Once I killed the pool, everything runs fine.
    Does anyone happen to know why this is? I keep CFMX under its own thread pool because there are certain elements to CFMX that aren't wholly stable and can result in CFMX crashing. If it crashes, the process keeps accepting requests, but never processes them. I'd like to keep the native thread pool free to keep accepting non-CFMX requests even when CFMX crashes.
    Thus the separate thread pool for CFMX.
    But now I can't run CFMX in a separate thread pool with JAVA enabled.
    Anyone have any insights into why this is?
    Thanks

    Two things. Firstly, it's better to use     private static final Object classLock = new Object();because that saves you worrying about whether any other code synchronises on it. Secondly, if you do decide to go for the delegation route then java.lang.reflect.Proxy may be a good way forward.

  • The different thread pools in 6.1

    Boy am I just flooded with just 6.1 migration issues. Life was much
    simpler with weblogic.properties file.
    Looking at Config.Dtd I couldnt see the different thread pools that WLS
    5.1 offered.
    How do I do set up thread pools for
    a) Servlets
    b) RMI
    c) JMS
    In 5.1 you had a servletthreadpool, an executethreadcount(for RMI) and a
    jms thread pool.

    In 6.1
    There isn't any seperate execute ThreadPool for servlets.
    The only thread pool that you can tune is the default
    queue which can be done via console. Ofcourse you can
    configure user defined thread queues.
    Also there are some internal thread pools that are not
    exposed to the developers. for e.g. admin queue, replication
    queue , console queue , rmi queue , jms queue etc....
    If you still want to route your servlet requests via a
    seperate thread queue, you have to specify
    the dispatch policy & the queue name.
    see below
    http://e-docs.bea.com/wls/docs61/perform/AppTuning.html#1105201
    Kumar
    Aswin Dinakar wrote:
    Boy am I just flooded with just 6.1 migration issues. Life was much
    simpler with weblogic.properties file.
    Looking at Config.Dtd I couldnt see the different thread pools that WLS
    5.1 offered.
    How do I do set up thread pools for
    a) Servlets
    b) RMI
    c) JMS
    In 5.1 you had a servletthreadpool, an executethreadcount(for RMI) and a
    jms thread pool.

  • CORBA thread pools

    Is there a code sample that takes a CORBA request and passes it to an available
    thread in a thread pool. All the multi-threaded examples I have seen seem to rely
    on creating a thread on receipt of a request/creation of an object, which could
    be quite inefficient.
    -Giles Cory

    Ethan,
    "Ethan Allen" <[email protected]> wrote in message
    news:3e0220a1$[email protected]..
    Thanks, Dimitri and Slava !
    I will do this and learn a little emore ...FYI, there is a web site dedicated to weblogic documentation -
    http://e-docs.bea.com/
    Pick your server version, go to "Search", type "thread dump".
    Regards,
    Slava Imeshev
    >
    ethan
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ethan,
    For windows press <Ctrl>+<Break> in the server shell window,
    for *nix send kill -3 {server PID}.
    Regards,
    Slava Imeshev
    "Ethan Allen" <[email protected]> wrote in message
    news:3e020fb4$[email protected]..
    Thanks for your reply, Dimitri.
    We have not looked at thread dumps. How may we do this ?
    Ethan
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Did you try looking at thread dumps when this happens ?
    Ethan Allen <[email protected]> wrote:
    We've set up thread pools for several execute queues dedicated to
    high-load
    servlets
    in our application. Once in a while, we get into a condition in
    which
    none of
    these threads are available and then the threads never become
    available
    - we have
    to restart the server.
    I realize that this is a pretty generic description of the problem:-) but I wonder
    if anyone else has encountered this and has an idea what might be
    causing
    it ?
    Right now I am guessing that something in our code causes a
    resource
    contention
    that eventually deadlocks all the threads. But that is just a
    guess.
    >>>>
    Dimitri

Maybe you are looking for