X

Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • November 25, 2015

Concurrency Utilities support in WebLogic Server 12.2.1, Part Five: Multi-tenancy Support

Overview

One of the key features in WLS
12.2.1 is the multi-tenancy support where a single Weblogic
Server domain can contain multiple partitions. Please read Part One ~
Part Four prior to this article. Applications deployed to partitions
can use the 4 types of concurrent managed objects in the same way as
described in Part One ~ Part Four. Applications deployed to partitions can
also use global pre-defined concurrent managed object templates, which
means when an application is deployed to a partition, WebLogic Server
creates concurrent managed objects for this application based on the configuration of global concurrent managed object templates. As you may recall there are server scope Max Concurrent Long Running Requests and Max Concurrent New Threads, please note that they limit long-running request/running threads in the whole server, including partitions.

Configuration

System administrators can define partition scope concurrent managed object templates.

As mentioned in Part One(ManagedExecutorService) and Part Three(ManagedThreadFactory), WebLogic Server provides configurations(Max Concurrent Long Running Requests/Max Concurrent New Threads) to limit the number of concurrent long-running tasks/threads in a ManagedExecutorService/ManagedScheduledExecutorService/ManagedThreadFactory
instance, in the global (domain-level) runtime on a server or in the
server. Among them, instance scope and server scope limits are
applicable to partitions. Besides, system administrators can also define
partition scope Max Concurrent Long Running Requests and Max Concurrent New Threads. There are a default Max Concurrent Long Running Requests(50) and a default Max Concurrent New Threads(50) for each partition.

ManagedExecutorService/ManagedScheduledExecutorService/ManagedThreadFactory
accepts a long-running task submission/new thread creation only when
neither of the 3 limits is exceeded. For instance, there is an
application deployed to a partition on a server, when a long-running
task is submitted to its default ManagedExecutorServiceRejectedExecutionException will be thrown if there are 10 in progress long-running tasks which are submitted to this ManagedExecutorService, or there are 50 in progress long-running tasks which are submitted to the ManagedExecutorServices/ManagedScheduledExecutorServices in scope of this partition on the server, or there are 100 in progress long-running tasks which are submitted to the ManagedExecutorServices/ManagedScheduledExecutorServices in the server.

Configure Partition Scope Concurrent Managed Object Templates

WebLogic
system administrators can configure pre-defined concurrent managed
object templates for a partition. When an application is deployed to the
partition, WebLogic Server creates concurrent managed object instances
based on the configuration of partition scope concurrent managed
object templates, and the created concurrent managed object
instances are all in scope of this application.

Example-1: Configure a Partition Scope ManagedThreadFactory template using WebLogic Administration Console

Step1:
in WebLogic Administration Console, a Partition Scope
ManagedThreadFactory template can be created by clicking on the “New”
button from the “Summary of Concurrent Managed Object Templates” page.
This brings up the "Create a New Managed Thread Factory Template" page
where the name and other parameters of the new
ManagedThreadFactory template can be specified. Choose the Scope to the partition. In this example, a ManagedThreadFactory template called "testMTFP1" is being created for partition1.

Step2:
Once a Partition Scope ManagedThreadFactory template is created, any
application in the partition can get its own
ManagedThreadFactory instance to use.

@WebServlet("/SomeServlet")

public class SomeServlet extends HttpServlet {

    @Resource(mappedName="testMTFP1")

    ManagedThreadFactory mtf;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        Runnable aTask = new Runnable() {
            ...
        };
        Thread t = mtf.newThread(aTask);

        t.start();
        ...
    }

}

Configure Partition Scope Max Concurrent New Threads & Max Concurrent Long Running Requests

Max Concurrent New Threads of a partition is the limit of running threads created by all ManagedThreadFactories in that partition on a server. Max Concurrent Long Running Requests of
a partition is the limit of concurrent long-running tasks submitted
to all ManagedExecutorServices and ManagedScheduledExecutorServices in
that partition on a server.

In WebLogic Administration Console, Max Concurrent New Threads and Max Concurrent Long Requests of a partition can be edited from the “Settings for <partitionName>” screen. In this example, Max Concurrent New Threads of partition1 is set to 30, Max Concurrent Long Running Requests of partition1 is set to 80

Related Articles:

See for more details Configuring Concurrent Managed Objects in the product documentation.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha