Multiservice Servers Chuan-Ming Liu Computer Science and Information Engineering spring 2004. ntut TAIWAN CSIE NTUT Taiwan
1 CSIE, NTUT, Taiwan Multiservice Servers Chuan-Ming Liu Computer Science and Information Engineering Spring 2004, NTUT TAIWAN
●。° Consolidating Servers o Same motivations for multiprotocol servers o Higher risk to use a single, multiservice server, why? o Consolidating many services into a single server process reduces o the number of executing processes dramatically The total code required o Most multiservice servers use a single transport protocol SIE NTUT. Taiwan
2 CSIE, NTUT, Taiwan Consolidating Servers Same motivations for multiprotocol servers Higher risk to use a single, multiservice server, why? Consolidating many services into a single server process reduces ⚫ the number of executing processes dramatically ⚫ The total code required Most multiservice servers use a single transport protocol
。。 Connectionless multiservice erver Application Process Master sockets ←OS (One for each service being offered) SIE. NTUT. Taiwan
3 CSIE, NTUT, Taiwan Connectionless Multiservice Server OS Application Process Master sockets (One for each service being offered)
Connection-Oriented ●●● Multiservice o Multiservice server can be programmed to handle some services iteratively and other services concurrent o Concurrency can be implemented with multiple single-threaded processes or a multi-threaded process 4 SIE NTUT. Taiwan
4 CSIE, NTUT, Taiwan Connection-Oriented Multiservice Multiservice server can be programmed to handle some services iteratively and other services concurrently Concurrency can be implemented with multiple single-threaded processes or a multi-threaded process
Iterative Connection- ●。 Oriented multiservice Master Application rocess Master sockets Sockets for←OS (One for each a TcP service offered connections 5 SIE NTUT. Taiwan
5 CSIE, NTUT, Taiwan Iterative, ConnectionOriented Multiservice Master OS Application Process Master sockets (One for each service offered) Sockets for a TCP connections
Concurrent connection Oriented multiservice Application Maste… rocesses (or threads) Slave Slave Socket for Sockets for←OS connection individual requests connections 6 SIE NTUT Ta
6 CSIE, NTUT, Taiwan Concurrent ConnectionOriented Multiservice Master OS Application Processes (or threads) Socket for connection requests Sockets for individual connections slave 1 slave n
o..I Single-thread, Multiservice o It is also possible but uncommon to implement multiservice servers with a single thread of execution o Mainly on connection-oriented style SIE NTUT. Taiwan
7 CSIE, NTUT, Taiwan Single-thread, Multiservice It is also possible, but uncommon, to implement multiservice servers with a single thread of execution Mainly on connection-oriented style
●° Invoking Separate Programs o Main flaw for multiservice servers inflexible o Changing small piece of code needs to recompile the entire server- time consuming o Stopping the server to recompile bothers clients o How to overcome this? o Break a server into independent parts o Then, handle each part independently .", implemented by execve SIE NTUT. Taiwan
8 CSIE, NTUT, Taiwan Invoking Separate Programs Main flaw for multiservice servers – inflexibility ⚫ Changing small piece of code needs to recompile the entire server – time consuming ⚫ Stopping the server to recompile bothers clients How to overcome this? ⚫ Break a server into independent parts ⚫ Then, handle each part independently ⚫ “overloading” implemented by execve
。。 Multiprocess Multiservice(TCP) laster Application rocesses ave slave og D. prog n k+- execve()used ro OS Master sockets Sockets for (One for each individual slave service offered) connections SIE NTUT. Taiwan
9 CSIE, NTUT, Taiwan Multiprocess Multiservice (TCP) Master OS Application Processes Master sockets (One for each service offered) Sockets for individual slave connections slave 1 slave n prog 1 prog n execve( ) used fork( )
●° Invoking Separate programs In a mulitservice server, the execveo system call makes it possible to separate the code that handles an individual service from the code that manages initial requests from clients 10 SIE NTUT. Taiwan
10 CSIE, NTUT, Taiwan Invoking Separate Programs In a mulitservice server, the execve( ) system call makes it possible to separate the code that handles an individual service from the code that manages initial requests from clients