130 likes | 291 Views
Performance, Scalability and Management. Topic Refining the object model Threading models Distributed callbacks Iterators Client-side cashing Monitoring performance. Refining the Object Model. Functional model Logical composition of functionality
E N D
Performance, Scalability and Management • Topic • Refining the object model • Threading models • Distributed callbacks • Iterators • Client-side cashing • Monitoring performance Performance Management
Refining the Object Model • Functional model • Logical composition of functionality • Independent of actual distribution of objects and infrastructures • Implementation model or design • Association of logical objects with run-time entities Performance Management
Room Booking Application Revisit • “Meeting” from interface to struct • View() • Array of CORBA object references (100 to 600 bytes) • Array of Java objects (~ 100 bytes) • Accessing details of a Meeting • Client makes two CORBA invocations on a remote Meeting object • Client access local Java objects • Booking a meeting • Complex • Create local object and pass it as an argument to a CORBA invocation • Cancel a meeting • Complex • One CORBA invocation Performance Management
Threading Models • Threading in clients • Multithreaded clients Client delivers results creates, starts Client Proxy Proxy Thread Server Object Implementation Performance Management
Threading in Servers • How can a server handle hundreds or thousands of concurrent client? • ORB provide automatic mechanisms for multithreaded servers • Single-threaded servers • Thread per connection • Thread per request (thread pools) Performance Management
Single-threaded Server • Place incoming requests in a queue and process only one at a time • Poor performance • Potential of deadlocks (callback on a single-threaded client program) Client Client Client Client Proxy Client Proxy Client Proxy Object Adapter Worker thread Server Object Implementation Performance Management
Thread-per-Connection Servers • Use one worker thread for each network connection Client Client Client Client Proxy Client Proxy Client Proxy Object Adapter Worker thread Worker thread Worker thread Object Implementation Server Performance Management
Thread-per-Request Servers • Use one worker thread for each request • Max num of threads • Threads are returned to the pool after finishing processing requests • Creating thread overhead is minimized • Default model Client Client Client Client Proxy Client Proxy Client Proxy Thread Pool Object Adapter Worker thread Worker thread Worker thread Object Implementation Server Performance Management
Distributed Callbacks • Break a synchronous call that returns some data into a pair of calls, i.e., a request and a response module hello { interface Callback { oneway void responseHello(in string str); }; interface GoodDay { oneway void requestHello(in Callback cb); } } Client delivers results calls Client Proxy Callback Object request response Server Object Implementation Performance Management
Iterators • Transmission of large amount of data • Lazy evaluation • Pull and push Client delivers results calls Client Proxy Iterator Handler initial invocation pull creates Server Pull Iterator Object Implementation Performance Management
Iterators • Push Client delivers results calls Client Proxy Iterator Handler initial invocation push creates Server Push Iterator Object Implementation Performance Management
Client-Side Caching • Cache data at the client side --- optimize communication • Encapsulate the IDL-generated client proxy in a caching object • Use extensions provided by some ORB implementation Client Cache Proxy Client Proxy Client Proxy Smart Proxy Performance Management
Monitoring Performance • Simple way: write code to take the time and compute the difference on both side • Mixing performance code with other logic • Make performance code conditional • CORBA portable interceptors framework Performance Management