Serveurs Web à contenu
dynamique
Emmanuel Cecchet
INRIA Rhône
-
Alpes, Projet Sardes
http://sardes.inrialpes.fr
Rice University, Systems lab
http://www.cs.rice.edu/CS/Systems/DynaServer
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
2
Web
Contenu du Web de plus en plus dynamique
screenshot page web ici
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
3
Serveurs Web à contenu dynamique
Architecture multi
-
tiers
un serveur Web
un serveur d’application
une base de données
Web server
Database
server
Client
Internet
HTTP
HTTP
SQL
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
4
Plan
Technologies
Benchmarks
Serveurs d’applications J2EE
Conclusion
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
5
PHP
Hypertext Preprocessor
Langage de script
Module intégré dans le serveur Web
Web server
Database
server
Client
HTTP
SQL
httpd
PHP
httpd
PHP
...
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
6
Exemple PHP
<!DOCTYPE HTML PUBLIC "
-
//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<?php
print
("<h1>Liste des regions</h1>");
$result =
mysql_query
("SELECT * FROM regions", $link) or
die
("ERREUR: La requête a échoué");
if
(
mysql_num_rows
($result) == 0)
print
("<h2>Désolé, pas de région. BD vide</h2><br>");
else
while
($row =
mysql_fetch_array
($result))
{
print
("<a href=
\
"BrowseCategories.php?region=".
$row["id"]."
\
">".$row["name"]."</a><br>
\
n");
}
mysql_free_result
($result);
?>
</body>
</html>
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
7
Servlets Java
Basé sur Java
S’exécute dans un “Servlet Container” sur
une JVM
JDBC: interface unique pour toutes les BDs
JDBC
Tomcat Servlet
server
Apache
Web server
MySQL
Database server
Client
HTTP
Tomcat
Servlet server
AJP12
h
t
t
p
d
JVM
...
h
t
t
p
d
servlet
servlet
servlet
servlet
servlet
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
8
Exemple Servlet Java
public class BrowseRegions extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException
{
out.print("<h1>Liste des regions</h1>");
try
{
ResultSet rs = connection.prepareStatement("SELECT * FROM regions").executeQuery();
if (!rs.first())
out.print("<h2>Désolé, pas de région. BD vide</h2><br>");
else
do
{
print("<a href=
\
"BrowseCategories.php?region="+rs.getInteger("i")+
"
\
">"+rs.getString("name")+"</a><br>
\
n");
} while (rs.next());
}
catch (Exception e)
{
out.print("La requête a échoué pour la raison suivante : " +e);
return;
}
}
}
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
9
et JSP ?
Java Server Pages
réponse de Sun à Microsoft ASP
“scripting de servlets”
Langage de script (tags JSP)
Compilé en une servlet Java lors de la
première exécution
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
10
J2EE
Java 2 Enterprise Edition
Conçu pour le développement multi
-
tiers
Découpe présentation et logique de l’application
J2EE Application Server
Web server
Database server
Presentation logic
Business logic
h
t
t
p
d
Web container
...
h
t
t
p
d
EJB container
servlet
servlet
servlet
servlet
servlet
Client
Internet
JSP
JSP
JSP
JSP
JSP
RMI /
IIOP
JNDI
JDBC
JMS
JTA
RMI /
IIOP
JNDI
JDBC
JMS
JTA
EJB
EJB
EJB
EJB
EJB
EJB
EJB
EJB
EJB
EJB
EJB
EJB
Applet container
Applet
Applet
Applet
Applet
Applet
Application Client
container
Application
Client
JMS
JDBC
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
11
Plan
Technologies
Benchmarks
Serveurs d’applications J2EE
Conclusion
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
12
Benchmarks
TPC
-
W
librairie électronique (amazon.com)
charge sur la base de données
RUBiS
ventes aux enchères électroniques (eBay.com)
charge sur le serveur d’application
RUBBoS
forums interactifs (slashdot.org)
charge sur le serveur d’application
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
13
TPCW
–
PHP & Servlets
Débit et utilisation CPU pour le shopping mix
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
14
RUBiS
–
PHP & Servlets
Browsing mix
Bidding mix
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
15
RUBiS
–
PHP & Servlets
Browsing mix
Bidding mix
0
%
1
0
0
%
PH
Se
Se
Se
CPU
Number
Web server
Dat abase server
Servlet s server
Number of client s
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
16
EJB implementations
From Servlets
to Session Beans
Session bean
Database
Web container
Servlet
EJB container
Business
logic
Servlet
Web container
Servlet
Database
Presentation
logic
Business
logic
Servlet
Presentation
logic
Business
logic
Presentation
logic
Presentation
logic
Session bean
Business
logic
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
17
EJB implementations
Data Access Objects separation with Entity
Beans
EJB container
Entity
Bean
Database
Entity
Bean
Entity
Bean
Web container
Servlet
Presentation
logic
Business
logic
Servlet
Presentation
logic
Business
logic
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
18
EJB implementations
Session façade
EJB container
Entity
Bean
Session facade
Web container
Session facade
Database
Entity
Bean
Entity
Bean
Business
logic
Business
logic
Servlet
Servlet
Presentation
logic
Presentation
logic
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
19
Design patterns
Presentation logic
Business logic
Total
Classes
Lignes de code
Classes
Lignes de code
Classes
Lignes de code
Servlets only
25
4590
-
-
25
4590
Session Beans
24
2650
52
5270
76
7920
DAO (EB CMP)
24
4060
40
7260
64
11320
Session façade
24
2660
85
10780
109
13440
Session bean
Database
Web container
Servlet
EJB container
Business
logic
Servlet
Web container
Servlet
Database
Presentation
logic
Business
logic
Servlet
Presentation
logic
Business
logic
Presentation
logic
Presentation
logic
Session bean
Business
logic
EJB container
Entity
Bean
Database
Entity
Bean
Entity
Bean
Web container
Servlet
Presentation
logic
Business
logic
Servlet
Presentation
logic
Business
logic
EJB container
Entity
Bean
Session facade
Web container
Session facade
Database
Entity
Bean
Entity
Bean
Business
logic
Business
logic
Servlet
Servlet
Presentation
logic
Presentation
logic
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
20
RUBiS
–
Session beans
Browsing mix
Bidding mix
0
2000
4000
6000
8000
10000
12000
0
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
Number of clients
Throughput in requests/minute
JBoss
JOnAS - RMI
JBoss optimized calls
JOnAS - Jeremie
Java Servlets
0
2000
4000
6000
8000
10000
12000
0
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400
1500
Number of clients
Throughput in requests/minute
JBoss
JOnAS - RMI
JBoss optimized calls
JOnAS - Jeremie
Java Servlets
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
21
RUBiS
–
Results overview
0
2000
4000
6000
8000
10000
12000
Browsing mix
Bidding mix
Maximum throughput in requests/minute
Servlets-only
Session Beans
EB-CMP
EB-BMP
Session façade
EJB 2.0 Local
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
22
RUBiS
–
Throughput
Bidding mix
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
Session Beans
EB-CMP
EB-BMP
Session façade
EJB 2.0 Local
Maximum throughput in requests/minute
JBoss
JOnAS - RMI
JBoss optimized calls
JOnAS - Jeremie
JBoss optimized calls JDK 1.4
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
23
EJB Container design
RUBiS bidding mix / Session façade
0
500
1000
1500
2000
2500
3000
3500
4000
0
20
40
60
80
100
120
140
160
180
200
220
240
260
280
300
320
340
360
380
400
420
440
460
480
500
Number of clients
Throughput in requests/minute
JBoss
JOnAS - RMI
JBoss optimized calls
JOnAS - Jeremie
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
JBoss
JOnAS RMI
JBoss optimized
calls
JOnAS Jeremie
Execution time breakdown
Other
Garbage Collector
Security
Naming
MM-MySQL
Connection pooling
Transaction manager
Container
Reflexion
Beans (edu.rice.*)
Communication
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
24
Plan
Technologies
Benchmarks
Serveurs d’applications J2EE
Conclusion
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
25
PHP, Java Servlets ou EJB ?
PHP
idéal pour de petits projets
pas de typage, APIs ad
-
hoc pour les BD
Servlets
programmation objet (JSP pour faire du script)
JDBC pour l’accès aux BDs
EJB
pour les gros projets développés par n
-
tiers
isolation de la présentation et de la business logic
service de persistence peu performant en EJB 1.1
Séminaire MIM ENS Lyon
–
8 octobre 2002
–
Emmanuel.Cecchet@inrialpes.fr
26
Perspectives
RUBiS
code source et articles disponibles sur
http://www.cs.rice.edu/CS/Systems/DynaServer
plateforme de test pour les technologies de serveurs Web à contenu
dynamique
contributions bienvenues
JOnAS
code source et documentation sur
http://www.objectweb.org
support du clustering pour passage à l’échelle
On embauche !!!
évaluation de performances
grappes de bases de données en Java (C
-
JDBC)
pour plus d’info voir
http://sardes.inrialpes.fr
ou
http://www.objectweb.org
Enter the password to open this PDF file:
File name:
-
File size:
-
Title:
-
Author:
-
Subject:
-
Keywords:
-
Creation Date:
-
Modification Date:
-
Creator:
-
PDF Producer:
-
PDF Version:
-
Page Count:
-
Preparing document for printing…
0%
Comments 0
Log in to post a comment