The present invention is generally related to computer systems, and is particularly related to supporting a server environment.
Modern computing systems, particularly those employed by larger organizations and enterprises, continue to increase in size and complexity. Particularly, in areas such as Internet applications, there is an expectation that millions of users should be able to simultaneously access that application, which effectively leads to an exponential increase in the amount of content generated and consumed by users, and transactions involving that content. Such activity also results in a corresponding increase in the number of transaction calls to databases and metadata stores, which have a limited capacity to accommodate that demand.
This is the general area that embodiments of the invention are intended to address.
Described herein are systems and methods that can support socket programming in a server environment, such as a distributed data grid. The server environment can include a selection service that operates to register a plurality of sockets, wherein each said socket is associated with a handler in a plurality of handlers. Furthermore, the selection service can listen for one or more incoming connection requests on the plurality of sockets, and invoke a pluggable callback provided by a said handler associated with a registered socket in the plurality of sockets, when said registered socket receives an incoming connection request.
Described herein are systems and methods that can support socket programming in a server environment, such as a distributed data grid.
In accordance with an embodiment, as referred to herein a “distributed data grid”, “data grid cluster”, or “data grid”, is a system comprising a plurality of computer servers which work together to manage information and related operations, such as computations, within a distributed or clustered environment. The data grid cluster can be used to manage application objects and data that are shared across the servers. Preferably, a data grid cluster should have low response time, high throughput, predictable scalability, continuous availability and information reliability. As a result of these capabilities, data grid clusters are well suited for use in computational intensive, stateful middle-tier applications. Some examples of data grid clusters, e.g., the Oracle Coherence data grid cluster, can store the information in-memory to achieve higher performance, and can employ redundancy in keeping copies of that information synchronized across multiple servers, thus ensuring resiliency of the system and the availability of the data in the event of server failure. For example, Coherence provides replicated and distributed (partitioned) data management and caching services on top of a reliable, highly scalable peer-to-peer clustering protocol.
An in-memory data grid can provide the data storage and management capabilities by distributing data over a number of servers working together. The data grid can be middleware that runs in the same tier as an application server or within an application server. It can provide management and processing of data and can also push the processing to where the data is located in the grid. In addition, the in-memory data grid can eliminate single points of failure by automatically and transparently failing over and redistributing its clustered data management services when a server becomes inoperative or is disconnected from the network. When a new server is added, or when a failed server is restarted, it can automatically join the cluster and services can be failed back over to it, transparently redistributing the cluster load. The data grid can also include network-level fault tolerance features and transparent soft re-start capability
In accordance with an embodiment, the functionality of a data grid cluster is based on using different cluster services. The cluster services can include root cluster services, partitioned cache services, and proxy services. Within the data grid cluster, each cluster node can participate in a number of cluster services, both in terms of providing and consuming the cluster services. Each cluster service has a service name that uniquely identifies the service within the data grid cluster, and a service type, which defines what the cluster service can do. Other than the root cluster service running on each cluster node in the data grid cluster, there may be multiple named instances of each service type. The services can be either configured by the user, or provided by the data grid cluster as a default set of services.
Asynchronized Message Processing
In accordance with various embodiments of the invention, the distributed data grid can support asynchronized message processing based on the using of both a continuation data structure and a message processing pattern. The continuation data structure can represent the control state of a computational process at a given point in execution and can allow the computational process to resume execution at a later point in time on another thread. Furthermore, the message processing pattern can be used to forward a received message to a subscriber for processing, based on a message queue in the distributed data grid.
A service thread 125 on the cluster node 120, e.g. a cluster service thread or a partition cache thread, can be responsible for handling the received incoming message 121. Since the service thread 125 can be a thread on the cluster node 120 that facilitates various other data grid operations, performing message processing on the service thread 125 can become a bottleneck that may affect the performance of the distributed data grid 119. Thus, it may be preferable to dispatch the processing of the incoming message 121 to other threads on the cluster node 120.
In accordance with various embodiments of the invention, an asynchronized message processing scheme can include three stages: a pre-processing stage, an asynchronized message processing stage, and a post-processing stage. While the pre-processing stage and the post-processing stage can be performed on the service thread 125, the asynchronized message processing stage can be performed on another thread, e.g. a message processing thread 127, in order to alleviate the bottleneck on the service thread 125.
As shown in
The pre-processor 123 on the service thread 125 can send a continuation data structure 129 to a message processor 133 on the message processing thread 127 along with the request. The continuation data structure 129 can represent the control state for processing the incoming message 121 on the service thread 123. Thus, the continuation data structure 129 can store attributes for continuing the processing of the incoming message 121 on the message processing thread 127.
After the message processor 133 on the message processing thread 127 finishes processing the incoming message, the message processing thread 127 can wrap a continuation data structure 139 in a return message 137, and send the return message 137 to a service queue 135 associated with the service thread 125. The continuation data structure 139 in the return message 137 can be created by the message processor 133 on the message processing thread 127, based on the continuation data structure 129 that was received from the service thread 123.
Then, a post-processor 141 on the service thread 125 can pick up the return message 137 from the service queue 135 and process the return message 137 accordingly, e.g. based on the message processing pattern supported in the distributed data grid 119. The outcome of processing the return message 137 on the service thread 125 is that the service thread 125 can perform post-processing of the incoming message 121 based on the continuation data structure 139 wrapped in the return message 137.
Unlike the traditional continuation programming scheme, the asynchronized message processing scheme ensures that the post-processing of the incoming message 121 always returns to the originating service thread 123, instead of on a random thread. Also, using the asynchronized message processing scheme, the service thread 123 is not blocked and can perform other tasks 131, while the message processing thread 123 is processing the incoming message 121.
Selection Services
The asynchronous I/O model 201 can use a plurality of server sockets 211-219, e.g. sockets 1 to N, in order to perform read and/or write operations for the one or more applications 202. A server socket 211-219 can wait for requests coming over the network at a physical port 250. Then, the server socket 211-219 can perform the read and/or write operations based on the request.
Furthermore, the server environment 200 can provide a plurality of handlers 221-229, e.g. handlers 1 to N, for handling incoming network streams at each of the plurality of sockets 211-219 respectively.
The asynchronous I/O model 201 can include a selection service 220, which maintains one or more socket channels 230. A server socket channel 230 can be created unbounded, and a server socket channel can be bound with an associated server socket 211-219 by invoking one of the bind methods of the associated server socket 211-219.
The server environment 200 can register the plurality of server sockets 211-219 and the corresponding handlers 221-229 with the selection service 220, e.g. by associating a server socket 211-219 with a server socket channel 230 maintained by the selection service 220.
Each handler 221-229 can provide a pluggable callback to the selection service 220 at the time of registration. At the time when a registered server socket channel 230 needs servicing an incoming connection request, the selection service 202 can invoke a callback to a corresponding handler in the plurality of handlers 221-229.
In accordance with an embodiment of the invention, a selection service 220 can implement an interface, e.g. a SelectionService interface in Coherence, which describes a service for selecting on different channels. For example, the SelectionService interface can provide a register function, as in the following.
The register function can register a channel, e.g. chan, with the selection service 220 for monitoring and can provide the selection service 220 with a handler, e.g. handler, for callback when the channel is ready for servicing with the service. If the handler is called for the same channel for multiple times, the prior handler may be unregistered and the new handler can be registered in its place. The handler can be deregistered either by closing the channel or via an explicit reregistration with a null handler. Following a (re)registration, the handler can have an initial interest set based on the channels full valid operation set.
Additionally, the SelectionService interface can provide a invoke function, as in the following.
The SelectionService can invoke a runnable object, e.g. runnable, via the invoke function. The invoke function can guarantee that the runnable object associated with the SelectableChannel, e.g. chan, and any handler associated with the same channel do not run concurrently. Additionally, if the invoke function is called for the same channel for multiple times, the runnable objects can be executed sequentially in the order the invoke function is called.
Additionally, the server environment 200 can deregister a socket 211-219 from the selection service 220.
Furthermore, the asynchronous I/O model 201 can utilize a thread pool 240 provided by server environment 200 for handling the plurality of sockets 211-219. The server environment can decide how many threads can be used in the thread pool 240, and there is no need for the applications 202 to implement application logics for handling multiple threads. Thus, the asynchronous I/O model 201 can be easily scalable in terms of using a large number of threads for performing read and/or write operations. For example, using the asynchronous I/O model 201, the same application 202 can be deployed on a distributed data grid with a large number of processing threads, or on a single server machine with a single I/O thread.
In accordance with an embodiment of the invention, the selection service 220 can support multiplexing the single physical port 250 e.g., a physical port 80, into multiple sub-ports 251-259, e.g. port 80.1 to port 80.n.
In order to support using multiplexed sockets 211-219 based on the multiplexed multiple sub-ports 251-259, the selection services 220 can maintain a plurality of multiplexed server socket channels 230, e.g. MultiplexedServerSocketChannel, which is an implementation of a ServerSocketChannel that shares an underlying ServerSocketChannel with a number of other MultiplexedServerSocketChannels.
The selection service 220 can open one or more server socket channels 230 for the plurality of multiplexed sockets 211-219, and bind a specific sub-port address 251-259 on a single physical port 250 with each multiplexed socket 211-219, which is registered with a server socket channel, before an incoming connection can be accepted. Then, the selection service 220 can invoke a callback to a corresponding handlers 221-228 for handling the incoming network stream. Thus, the plurality of multiplexed sockets 211-219 can share a single physical port 250, and the applications 202 can use the different multiplexed sockets 211-219 for performing read and/or write operations.
The present invention may be conveniently implemented using one or more conventional general purpose or specialized digital computer, computing device, machine, or microprocessor, including one or more processors, memory and/or computer readable storage media programmed according to the teachings of the present disclosure. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art.
In some embodiments, the present invention includes a computer program product which is a storage medium or computer readable medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present invention. The storage medium can include, but is not limited to, any type of disk including floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
The foregoing description of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
This application is a continuation of U.S. patent application Ser. No. 13/671,433, filed Nov. 7, 2012, now U.S. Pat. No. 9,787,561, issued Oct. 10, 2017, titled “SYSTEM AND METHOD FOR SUPPORTING A SELECTION SERVICE IN A SERVER ENVIRONMENT”, which claims the benefit of priority to U.S. Provisional Patent Application No. 61/714,100, filed Oct. 15, 2012, titled “SYSTEM AND METHOD FOR SUPPORTING A DISTRIBUTED DATA GRID IN A MIDDLEWARE ENVIRONMENT”, which application is herein incorporated by reference in their entirety. The current application hereby incorporates by reference the material in the following patent application: U.S. patent application Ser. No. 13/671,420, filed Nov. 7, 2012, now U.S. Pat. No. 9,246,780, issued Jan. 26, 2016, titled “SYSTEM AND METHOD FOR SUPPORTING PORT MULTIPLEXING IN A SERVER ENVIRONMENT”.
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
Number | Name | Date | Kind |
---|---|---|---|
5014265 | Hahne | May 1991 | A |
5301350 | Rogan | Apr 1994 | A |
5561785 | Blandy | Oct 1996 | A |
5784698 | Brady | Jul 1998 | A |
6070202 | Minkoff | May 2000 | A |
6338112 | Wipfel | Jan 2002 | B1 |
6826597 | Lonnroth | Nov 2004 | B1 |
7058055 | Mugica | Jun 2006 | B2 |
7139925 | Dinker | Nov 2006 | B2 |
7707513 | Broda | Apr 2010 | B2 |
7861249 | Jiang | Dec 2010 | B2 |
7904493 | Schmelter | Mar 2011 | B2 |
7936753 | Colloff | May 2011 | B1 |
8024445 | Kamijima | Sep 2011 | B2 |
8122006 | De Castro Alves | Feb 2012 | B2 |
8131894 | Cain | Mar 2012 | B2 |
8166095 | Ferwerda | Apr 2012 | B2 |
8249072 | Sugumar | Aug 2012 | B2 |
8259571 | Raphel | Sep 2012 | B1 |
8271980 | Jackson | Sep 2012 | B2 |
8290919 | Kelly | Oct 2012 | B1 |
8332493 | Rowley | Dec 2012 | B2 |
8392368 | Kelly | Mar 2013 | B1 |
8447793 | Burka | May 2013 | B2 |
8510376 | Kaczmarski | Aug 2013 | B2 |
8539192 | Castillo | Sep 2013 | B2 |
8612386 | Tien | Dec 2013 | B2 |
8621031 | Desai | Dec 2013 | B2 |
8687636 | Sivan | Apr 2014 | B1 |
8768981 | Milne | Jul 2014 | B1 |
9787561 | Falco | Oct 2017 | B2 |
20020023173 | Jacobs | Feb 2002 | A1 |
20020196782 | Furukawa | Dec 2002 | A1 |
20040010674 | Boyd | Jan 2004 | A1 |
20040083317 | Dickson | Apr 2004 | A1 |
20040172618 | Marvin | Sep 2004 | A1 |
20050249215 | Kelsey | Nov 2005 | A1 |
20060026169 | Pasqua | Feb 2006 | A1 |
20060112174 | L'Heureux | May 2006 | A1 |
20060129516 | Bradford | Jun 2006 | A1 |
20060161893 | Han | Jul 2006 | A1 |
20060230128 | Chung | Oct 2006 | A1 |
20070168336 | Ransil | Jul 2007 | A1 |
20070230477 | Worley | Oct 2007 | A1 |
20080208960 | Rowley | Aug 2008 | A1 |
20080320501 | Li | Dec 2008 | A1 |
20090077233 | Kurebayashi | Mar 2009 | A1 |
20090116484 | Buford | May 2009 | A1 |
20090177914 | Winchell | Jul 2009 | A1 |
20090219820 | Acke | Sep 2009 | A1 |
20090234897 | Qi | Sep 2009 | A1 |
20100005472 | Krishnaraj | Jan 2010 | A1 |
20100011414 | Banerjee | Jan 2010 | A1 |
20100017461 | Kokkevis | Jan 2010 | A1 |
20100037222 | Tatsubori | Feb 2010 | A1 |
20100042755 | Fuente | Feb 2010 | A1 |
20100060934 | Bellert | Mar 2010 | A1 |
20100093441 | Rajaraman | Apr 2010 | A1 |
20100125624 | Bachhuber-Haller | May 2010 | A1 |
20100265945 | Bejerano | Oct 2010 | A1 |
20100287216 | Ylonen | Nov 2010 | A1 |
20100333099 | Kupferschmidt | Dec 2010 | A1 |
20110004701 | Panda | Jan 2011 | A1 |
20110055322 | Gregersen | Mar 2011 | A1 |
20110137991 | Russell | Jun 2011 | A1 |
20110225120 | Cooper | Sep 2011 | A1 |
20110225121 | Cooper | Sep 2011 | A1 |
20110225122 | Denuit | Sep 2011 | A1 |
20110246550 | Levari | Oct 2011 | A1 |
20110296052 | Guo | Dec 2011 | A1 |
20120084409 | Rowley | Apr 2012 | A1 |
20120113896 | Karo | May 2012 | A1 |
20120144025 | Melander | Jun 2012 | A1 |
20120197840 | Oliver | Aug 2012 | A1 |
20120197959 | Oliver | Aug 2012 | A1 |
20120198455 | Lee | Aug 2012 | A1 |
20120278398 | Lowekamp | Nov 2012 | A1 |
20120331029 | King | Dec 2012 | A1 |
20130014114 | Nagata | Jan 2013 | A1 |
20130041969 | Falco | Feb 2013 | A1 |
20130073809 | Antani | Mar 2013 | A1 |
20130074101 | Oliver | Mar 2013 | A1 |
20130103837 | Krueger | Apr 2013 | A1 |
20130128726 | Hellhake | May 2013 | A1 |
20130262632 | Fein | Oct 2013 | A1 |
20130325543 | Magee | Dec 2013 | A1 |
20140016457 | Enyedi | Jan 2014 | A1 |
20140108516 | Ekeroth | Apr 2014 | A1 |
20140219209 | Soneda | Aug 2014 | A1 |
20170359240 | Falco | Dec 2017 | A1 |
Entry |
---|
D. Johnson et al., Network Working Group, RFC 4728; “The Dynamic Source Routing Protocol (DSR) for Mobile Ad Hoc Networks for IPv4”, Microsoft Research Feb. 2007, 107 Pages. |
Andrew S. Tanenbaum, Modem operating systems, 2nd edition, © 2001 by Prentice-Hall, Inc., Chapter 4, pp. 199-202. ISBN 0-13-031358-0. |
Andrew S. Tanenbaum, Computer Networks, Fourth Edition, Chapter 5, 5.2.7 Broadcast Routing, © 2003, p. 368, Prentice Hall PTR, Upper Saddle River, NJ 07458, US. ISBN 0-13-066102-3. |
Martin Sustrik, [zeromq-dev] subports, Grokbase, Jul. 27, 2011, 6 pages. retrieved from: http://grokbase.com/t/zeromq/zeromq-dev/117vwvr6z9/subports. |
Oracle, Class SocketChannel, Java™ 2 Platform, Standard Ed. 5.0, © Copyright 2004, 2010, 13 pages. retrieved from: http://docs.oracle.com/javase/1.5.0/docs/api/java/nio/channels/SocketChannel.html. |
Number | Date | Country | |
---|---|---|---|
20170359240 A1 | Dec 2017 | US |
Number | Date | Country | |
---|---|---|---|
61714100 | Oct 2012 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 13671433 | Nov 2012 | US |
Child | 15688151 | US |