Introduction to BEA Tuxedo - Go

Download Report

Transcript Introduction to BEA Tuxedo - Go

An introduction to BEA Tuxedo
David Kurtz
Go-Faster Consultancy Ltd.
[email protected]
www.go-faster.co.uk
Who am I?
Oracle DBA
Independent
consultant
ex-PeopleSoft UK
Book
www.psftdba.com
Performance Tuning
PeopleSoft ERP
Oracle RDBMS
Oak Table
www.oaktable.net
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
2
T&C
If you can’t hear me say so now.
Make sure that you ask questions as we
go along.
Trust nothing, trust nobody (especially me)
Question everything.
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
3
Why am I talking about Tuxedo
Tuxedo is now an Oracle product,
it is a part of your Oracle estate
Tuxedo used within PeopleSoft ERP
(although no ‘Tuxedo development’
required)
This presentation is a stalking horse.
As a UKOUG director, I want to gauge the
interest in the product.
Somebody has to do it!
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
4
Tuxedo
Architectural Overview
How it works
The DBA is often has the best mix of skills
to assimilate this technology
Intimate relationship with the database
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
5
BEA says:
Tuxedo is:
“middleware for building scalable multitier client/server applications in
heterogeneous distributed
environments.”
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
6
T.U.X.E.D.O.
Transactions under
UniX
Extended for
Distributed
Operations
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
7
Tuxedo Products
BEA TSAM
Tuxedo Systems Application Monitor
I think this is what I used to know as ATMI
XA Transaction
BEA SALT
Services Architecture Leveraging Tuxedo
SOAP over HTTP
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
8
What is Tuxedo?
I’m the DBA. Why should I care?
Intimate relationship with database
Sizing and Configuration
Affects your database
And therefore performance of system
DBA best placed to understand this
technology.
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
9
Tuxedo Concepts
Remote subroutine call
Usually synchronous
Sometimes not
Message protocol
Amongst other things.
PeopleSoft only uses ATMI
Application-to-Transaction Monitor
Interface
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
10
What is Tuxedo?
The knots on the ends of the string?
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
11
PeopleSoft Two-tier client
Presentation
Logic
Panel
Load
Panel
Save
Field
Change
etc...
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
12
PeopleSoft Three-tier client
PeopleSoft created generic services
Tuxedo Server
Tuxedo Client
Presentation
Logic
Panel
Load
Panel
Save
Field
Change
etc...
Client Side
Introduction to BEA Tuxedo
Server Side
UKOUG2008 ©www.go-faster.co.uk
13
Three-tier client
More conventional to make a business
transaction into a service.
Tuxedo Server
Tuxedo Client
Presentation
Logic
Application
Logic
Application
Logic
Application
Logic
etc...
Client Side
Introduction to BEA Tuxedo
Server Side
UKOUG2008 ©www.go-faster.co.uk
14
Advantage of Middleware
Application Logic removed from client
Few client-server communications
Reduced resource overhead
And it isn’t in the database either
Database CPUs must be licensed
Scalable middle-tier
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
15
Simple Application Server
Delivered by BEA
%TUXDIR%\samples\atmi\simpapp
Remote Call ‘Hello World’ program
simpcl.c
TOUPPER
service
Tuxedo
MIB
TOUPPER
service
TOUPPER()
simpserv.c
ubbsimple
client
Introduction to BEA Tuxedo
Tuxedo
process
UKOUG2008 ©www.go-faster.co.uk
server
process
16
Simple Client
1. Connects to Bulletin Board
/* Attach to System/T as a Client Process */
if (tpinit((TPINIT *) NULL) == -1) {
(void) fprintf(stderr, "Tpinit failed\n");
exit(1);
}
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
17
Simple Client
2. Allocates memory for messages
sendlen = strlen(argv[1]);
if((sendbuf = (char *) tpalloc("STRING", NULL,
sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating send
buffer\n");
tpterm();
exit(1);
}
if((rcvbuf = (char *) tpalloc("STRING", NULL,
sendlen+1)) == NULL) {
(void) fprintf(stderr,"Error allocating receive
buffer\n");
tpfree(sendbuf);
tpterm();
exit(1);
}
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
18
Simple Client
3. Copy command line to message and
send the message to the server
(void) strcpy(sendbuf, argv[1]);
ret = tpcall("TOUPPER", (char *)sendbuf, 0, (char
**)&rcvbuf, &rcvlen, (long)0);
(void) fprintf(stdout, "Returned string is:
%s\n", rcvbuf);
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
19
Simple Client
4. Release memory and disconnect
/* Free Buffers & Detach from System/T */
tpfree(sendbuf);
tpfree(rcvbuf);
tpterm();
return(0);
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
20
Simple Server
%TUXDIR%/include/atmi.h
/* interface to service routines */
struct tpsvcinfo {
#define XATMI_SERVICE_NAME_LENGTH 32
char
name[XATMI_SERVICE_NAME_LENGTH]; /* service name
invoked */
long
flags; /* describes service attributes */
char
*data; /* pointer to data */
long
len;
/* request data length */
int
cd;
/* connection descriptor */
long
appkey; /* application authentication client key
*/
CLIENTID cltid; /* client identifier for originating
client */
};
typedef struct tpsvcinfo TPSVCINFO;
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
21
Simple Server
Each service is a sub-routine.
TOUPPER(TPSVCINFO *rqst)
{
int i;
for(i = 0; i < rqst->len-1; i++)
rqst->data[i] = toupper(rqst->data[i]);
/* Return the transformed buffer to the requestor.
*/
tpreturn(TPSUCCESS, 0, rqst->data, 0L, 0);
}
#
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
22
Simple Domain
The domain has one server that
advertises one service.
*SERVERS
DEFAULT:
CLOPT="-A"
Simpserv
SRVGRP=GROUP1 SRVID=1
*SERVICES
TOUPPER
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
23
Anatomy of the Application Server
PeopleSoft works in the same way as
the simple server
Except
there are more servers and more services.
Runs on different nodes, so there is a
listener process
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
24
Processes, Messages & Memory
Unix IPC memory structures
Bulletin Board
Shared Memory Segment
Queues
IPC Queues
Semaphores
To protect Bulletin Board, WSL and JSH
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
25
PeopleSoft 2-Tier Client
Client Connects Directly to the
Database
What happens in 3-Tier?
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
DATABASE
26
Application Server Structure
Bulletin Board Liaison process
Always first process to be started
Reads configuration file
It creates BB shared memory segment
BB
PSTUXCFG
BBL
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
27
Listener Processes
Listens for incoming client requests
1
2
WSL
3
BB
WSH
BBL
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
28
A Transaction
C++ client
PSAPPSRV is the application server
process written by PeopleSoft.
Physical
Cache Files
Windows
client
8
7
1
6
WSHQ
3
WSH
APPQ
4
PSAPPSRV
5
WSL
2
BB
BBL
DATABASE
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
29
Transaction from Java Client
PeopleSoft Internet Architecture
JREPQ
3
4
JREPSVR
JREPOSITORY
PIA JVM
2
13
5
12
6
1
JSHQ
11
8
JSH
APPQ
9
PSAPPSRV
10
JSL
7
BB
BBL
DATABASE
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
30
IPC Resources
IPCS
Standard Unix Command
so not in the Tuxedo documentation
Reports on IPC resources
Queues
Memory Segments
Semaphores
BEA implementation on Windows
No concept of group and ownership so always
zero
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
31
ipcs -a
ipcs -a
IPCS status from BEA_segV8.1 as of Mon May 10 14:39:08 2004
T
ID
KEY
MODE
CBYTES QNUM QBYTES LSPID LRPID
STIME
RTIME
CTIME
Message Queues:
q 5632 0x00000000 --rw-rw-rw0
0 65536
0
0 no-entry no-entry 14:38:42
q
257 0x0000bbe2 -Rrw-rw-rw0
0 65536 4072 1716 14:39:00 14:39:00 12:10:42
q
515 0x00000000 -Rrw-rw-rw0
0 65536
0
0 no-entry no-entry 12:26:14
q
516 0x00000000 -Rrw-rw-rw0
0 65536 2904 3952 13:12:51 13:12:51 12:26:14
q
517 0x00000000 -Rrw-rw-rw0
0 65536 2904 3544 12:37:30 12:37:30 12:26:14
q
518 0x00000000 --rw-rw-rw0
0 65536
0
0 no-entry no-entry 12:28:11
q
519 0x00000000 --rw-rw-rw0
0 65536 1716
688 14:37:14 14:37:14 12:28:11
q
520 0x00000000 --rw-rw-rw0
0 65536
0
0 no-entry no-entry 12:28:46
q
521 0x00000000 --rw-rw-rw0
0 65536
0
0 no-entry no-entry 12:28:46
q
522 0x00000000 -Rrw-rw-rw0
0 65536 3544 2548 12:37:26 12:37:26 12:30:13
q
523 0x00000000 --rw-rw-rw0
0 65536 3544 2548 12:37:26 12:37:26 12:30:13
q
524 0x00000000 -Rrw-rw-rw0
0 65536
0
0 no-entry no-entry 12:30:59
q
525 0x00000000 -Rrw-rw-rw0
0 65536 1132 3648 14:39:07 14:39:07 12:30:59
q
526 0x00000000 -Rrw-rw-rw0
0 65536 1132 2616 14:39:07 14:39:07 12:30:59
q
783 0x00000000 -Rrw-rw-rw0
0 65536 2616 1708 12:46:04 12:46:04 12:32:22
q
784 0x00000000 --rw-rw-rw- 13608
1 65536 2616 1132 14:39:08 14:39:07 12:33:04
q 1297 0x00000000 --rw-rw-rw0
0 65536 1716 2904 12:37:30 12:37:30 12:33:04
q 3602 0x00000000 --rw-rw-rw0
0 65536
0
0 no-entry no-entry 12:37:26
q
532 0x00000000 --rw-rw-rw0
0 65536 1716 1132 14:38:53 14:38:53 14:38:51
T
ID
KEY
MODE
NATTCH SEGSZ CPID LPID
ATIME
DTIME
CTIME
Shared Memory:
m
50 0x0000bbe2 --rw-rw-rw27 646432 1716 4072 14:39:00 14:39:00 12:10:40
m
101 0x00000000 --rw-rw-rw3
504 2196 3544 12:26:14 no-entry 12:26:14
m
102 0x00000000 --rw-rw-rw3
1112
260 2616 12:30:59 no-entry 12:30:59
T
ID
KEY
MODE
NSEMS
OTIME
CTIME
Semaphores:
s 1024 0x0000bbe2 --ra-ra-ra5 14:39:07 12:10:40
s 3073 0x00000000 --ra-ra-ra52 13:34:04 12:10:40
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
32
M52
CPID2796
1112 bytes
2
JSL
PID 260
1
13
PIA JVM
JSH
PID 3648
JSH
PID 2616
3
Q783
JREPSVR
PID 1708
Q524
4
JREPOSITORY
5
Q525
12
6
7
Q526
11
8
9
APPQ Q784
M101
CPID 2196
504 bytes
Q1297
Q532
WSL
PID 2196
WSH
PID 3952
WSH
PID 3544
PSAPPSRV
PSAPPSRV
PID
2904
PID 1132
Q515
MONITOR Q520
Q516
Q521
PSMONITORSRV
PID 3260
10
Q517
SAMQ Q522
Q523
Q3602
Windows
client
BB
WATCH Q518
M50
Key BBE2
CPID 1716
646432 bytes
Q519
Introduction to BEA Tuxedo
Physical
Cache Files
PSSAMSRV
PSSAMSRV
PID
2548
PID 2620
PSWATCHSRV
PID 668
DATABASE
BBL
PID 1716
Q257
UKOUG2008 ©www.go-faster.co.uk
33
tmadmin and ipcs
Tuxedo command line interface utility
Issue administrative commands
Monitor application server
Reads IPC status
printqueue
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
34
pq or printqueue
> pq
Prog Name
--------PSSAMSRV.exe
JSL.exe
WSL.exe
JREPSVR.exe
PSMONITORSRV.e
PSAPPSRV.exe
BBL.exe
PSWATCHSRV.exe
Queue Name # Serve Wk Queued
------------------- --------SAMQ
2
00095.00200
1
00001.00020
1
00094.00250
1
MONITOR
1
APPQ
2
48098
1
WATCH
1
-
# Queued
-------0
0
0
0
0
1
0
0
Ave. Len
--------
Machine
------GO-FASTER+
GO-FASTER+
GO-FASTER+
GO-FASTER+
GO-FASTER+
GO-FASTER+
GO-FASTER+
GO-FASTER+
ipcs -a
IPCS status from BEA_segV8.1 as of Mon May 10 14:39:08 2004
T
ID
KEY
MODE
CBYTES QNUM QBYTES LSPID LRPID
STIME
RTIME
CTIME
Message Queues:
...
q
784 0x00000000 --rw-rw-rw- 13608
1 65536 2616 1132 14:39:08
14:39:07 12:33:04
...
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
35
PIA in BEA Weblogic
Cookie
HTTP
browser
Weblogic Server
JVM
Servlet engine
Servlet container
Web server servlet
Client
thread
Client
Thread
PeopleSoft PIA servlet
Servlet
thread
Servlet
thread
Servlet
thread
Tuxedo
application
server
JSL
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
JSH
JSH
JSH
36
Connection Concentration
35000 users
Fairly typical picture
35,000 users
1000 concurrent connections
1000 connections
1000 users active in the last n minutes
1000 Java Threads
where n is the Java + JSH timeout
4 JVMs
therefore need 1000 threads, maybe 4 JVMs
100 JSH
100 JSHs
assumes 10 clients per JSH
10-20 PSAPPSRV processes
each PSAPPSRV connects to database
10-20 PSAPPSRVs
1 database
But, we didn’t use shared database
server processes.
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
1 database
37
X/Open Distributed Transaction
Processing
In an XA environment
different resource
managers
Tuxedo server
processes
May connect to different
resources (databases)
At the very least they are
different sessions on the
same database.
One distributed
transaction
They are commit or
rollback together.
Tuxedo can be used as a
Transaction Manager
(coordinator)
Introduction to BEA Tuxedo
From Oracle Application
Developers’ Guide Fundamentals
UKOUG2008 ©www.go-faster.co.uk
38
Summary
Tuxedo Architecture
Unix IPC based
Queues, Shared Memory, Semaphores
Same on Windows
Sort of!
Function calls
Connection Concentration
Scalable middleware
Transaction Monitor
Introduction to BEA Tuxedo
UKOUG2008 ©www.go-faster.co.uk
39
Questions