Tải bản đầy đủ

xây dựng mạng xã hội eel trên nền tảng dịch vụ điện toán đám mây google app engine

I HC BÁCH KHOA HÀ NI


 CÔNG NGH THÔNG TIN 










 ÁN
TT NGHII HC
NGÀNH CÔNG NGHỆ THÔNG TIN


XÂY 


 EEL TRÊN















MÂY GOOGLE APP ENGINE



Sinh viên thc hin : 


Lp CNPM  K50
ng dn: ThS 


PGS.TS 



 6-2010
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 1

PHIU GIAO NHIM V  ÁN TT NGHIP
1. Thông tin v sinh viên
H và tên sinh viên: 


n thoi liên lc 0984005591 Email: quangdp1986@gmail.com
Lp: CNPM H o: 
 án tt nghic thc hin ti: 




Th ngày 21/12/2010 n 28/5/2010

2. Mi dung c
 . 












.

3. Các nhim v c th c
- : 














- 
- 











.

4. La sinh viên:
Tôi  Đa
̀
o Phan Quang - cam ku ca bi
s ng dn ca ThS Lê Quốc  GS.TS Huy
̀
nh Quyết Thắng.
Các kt qu c, không phi là sao chép toàn a bt k
công trình nào khác.

Hà Nội, ngày 28 tháng 5 năm 2010
Tác gi 





Quang

5. Xác nhn cng dn v m hoàn thành co
v:





Hà Nội, ngày 28 tháng 5 năm 2010
ng dn




PGS.



Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 2

TÓM TT N ÁN TT NGHIP



3 

:
- 1:  : , 


























.
- 2:  








 : 









, 




, .
- 3: 










.

Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 3


PHIU GIAO NHIM V  ÁN TT NGHIP 1
TÓM TT N ÁN TT NGHIP 2






 6






 7










8




 9
1 : 







 11
I. 



 11
II.  11
III. 









 14
III.1. 



: 14
III.2. 











: 16
IV.  18
IV.1. 











: 19
IV.2. 















: 19
IV.3. : 20
IV.4. 









: 20
IV.5. 







 21
IV.6.  21
IV.7. 







 21
IV.8. 



 21
IV.9. 



21
IV.10.  22
V. : 22
 23
I. 



 23
II. 









 26
II.1. 

 26
II.2. 



 26
II.3. 

 26
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 4

II.4. Sandbox 28
II.5. Logging 30
II.6.  31
II.7.  32
III.  48
IV.  48
V. : 49
3 : 











 50
I. : 50
II. 







: 10
III. Uses Case : 50
IV. 





: 52
IV.1. Google Web Toolkit : 52
IV.2. GWT RPC : 53
IV.3. 

: 54
IV.4. 







: 55
V. 

: 56
V.1. 







: 60
V.2. 







: 62
V.3. 















: 66
V.4. 









: 68
V.5. 







: 68
VI. 







: 72
VII. 





: 73
VIII. 













: 75
VIII.1.  76
VIII.2.  77
VIII.3. Blobstore 78
VIII.4. 

 79
VIII.5. Memcache 79
IX.  













: 79
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 5





 80
1. 



: 80
2. : 80
3. 





: 80
 81

Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 6








1. 





AWS, GAE, Azure [1] 14
2. 2003, 2008 
[1] 17
3. 













 19
4. 











 19
5. 











 24
6. 





24
7. 













25
8.  25
9. 







 34
10. 







 36
11. 







 38
12. 







 41
13. 







 45
14. 







 46


Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 7








1. 



[1] 11
2.  15
3. [4] 43
4. [4] 43
5. [4] 43
6. [4] 43
h 7. [4] 43
8. I'm Feeling Lucky [4] 43
9. 



 51
10. 





52
11. 





[3] 53
12. 

[7] 54
13.  56
14. 

















 57
15. 





(1) 58
16. (2) 59
17.  60
18. 





 61
19. 



 62
20. 





 62
21. 

 63
22. 









 65
23. 











 66
24. 





 66
25. 





67
26. 









67
27. 







68
28. 





(1) 69
29. 





(2) 70
30. 





(3) 72
31.  72
32. 





 73
33. 



(





) 73
34. 







 74
35. 







74
36. 



 75
37. 





75
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 8
















Cloud computing







SaaS
Software as a Service : 





Cloud









Datacenter








(

)
EC2
Elastic Compute Cloud : 









AWS
Amazon web service :  









CLR
Common language runtime : 




.Net
Pay as you go











Bottleneck



API
Application programming interface: 






 .












.
GEA
Google App Engine : 
GWT
Google Web Toolkit : 








web.
Quota





RPC
Remote Procedure Call : 






JDO
Java Data Object : 



























JPA
Java Persistence API : 







.
JSNI
Javascript native interface : 









History (trang 50)



.
Work-around












 , 










 




.

Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 9






















, 






 Khoa, 






































.
Em xin 
, 






























 . 





 
















 . 























.


  , 
















.

Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 10
















 , 






















 . 









 ,  . 














 


























 , 
.








 , 















 
 . 































. 





, 























































 . 





 , 












 


































.










:
- 








.
- 




.
- 




























.




Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 11

1 : 











I. 










 






























. 




  (SaaS). 


























 (cloud).
Khi  









 , 


 ,  . 




mây 

















 






.




 





:


1. 





[1]

Cloud Provider:  





 , 




 



() thuê.
Saas Provider/Cloud User:  






 (CPU, RAM, Storage, Bandwidth) 






, 
(SaaS).
SaaS User: 



.
II. 












, 












. 















, 




  .

 , 


























, 




 













 . 




Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 12

  , 














.








, 

















:
- 














-  





 , 















-  gian
(



1 

), 









.
 






mây. 











 










 

. 
2000-2001 






















.










 





 . 
Elastic Compute Cloud (EC2)  1.0 GHz x86 


0.1$ 



.  (S3) 0.12$ 0.15$ cho










 ,  0.1$ 0.15$ 



 1








.
















 , 


















, 



. 



 u 

, 





















 . 
, 







 




























 . 
































 quan


.










:
(1) : Gmail, Google Docs.
(2) : AppEngine, Azure.
(3) : Amazon.
Amazon EC2 h. 

2  



.



















EC2 instance.






































. 
















, 















  , IP, 


. 















 








  2 

  thêm EC 2


.
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 13











 . 








 ,  


.  -






























 . 







































.

























ph 

.  .NET, 






CLR. 


























. 




















 .  






















.
, 







.

AWS
Ms Azure
GEA



- 








x86 




Xen
- 








, 




















.
- 
- 












 khai; 






.
- 













- 







; 

















; 




a
.



- 








(EBS) 

DB)
- 











(EBS) 
(S3,
SimpleDB)
- 










- 








(EBS) 
- SQL Data Server
(











SQL Server)
- 
Azure storage
service
- MegaStore/
BigTable
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 14

M


m
- 

- 








- 


















- 











.
- 














- 









3 






web
- 














.
1. 





, GAE, Azure [1]
III. 










III.1. 





: 



i ro










 





 




















 , 












. 











 




, 







100 server-hour trong khi
 10 server-hour (

-














). 


.


, 

















 () 



























gian, 

 












 : 











 , 


















.
 . 

 







 






  (thêm


2 2-5 ) 








 . 

 ,  5-20%
 . 
 , 


 2-10 





 . 









 , ta










 , 










..
:  500 






100 



 . 















 300
server. 











(a) 300*24=7200 server-
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 15

hour, 





 500*24=12000 server-hour,  1.7 


 . 

, 





 3 



 1.7 
, 







 .

2. 























 , 






 

, 
















, 















.  trang 


















 12 









 
 . 











 , 


















 .  , 




 

 , 












.


(b), 











 , 












 . 























 , tuy


 






















 . (c) 









 , 






 nh. 
























 , 




.


















 . Trong
3 , 

 



 50 server lên 3500 server. 

, 
















 . 



 , 
 , trong khi
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 16
























.
















 











 : 
 
















. g 





 
r 

. Ch:















 





 














 . 









 -






 -



 . 




















 . u Utilization = 1 




nhau. 







0.6 0.8. 


 





 










ng server-hour. 







(a), 














 (Utilization<1). 



 (b), 




 (



 ) 
k





.
C 


























 . 


cho 100 

1 





1 

100 

.














:
- 























 .
 2100$ 














 1400$ . 



 






 .
- 















 . 


 , 














thân.
III.2. 













:














 





 , tuy nhiên










 : 














mây 



















.


WAN ()













1
2 GHz CPU, 2GB DRAM
200 GB, 

50
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 17

2003
Mbps WAN
Mb/s
2003
$100/
$2000
$200
$1 


1GB
8 


1GB





2008

100 Mbps
2 GHz, 2 sockets, 4
nhân/1 socket, 4GB
DRAM
1 TB, 

115
MB/s
$1 


2.7 GB
128 


10GB





$1 

$0.27-$0.40
($0.10 - $0.15 x
2.7GB)
$2.56 (128x 2 


$0.10 

)
$1.20-$1.50
($0.12-$0.15/GB-





10GB)

2. 2003, 2008 








AWS [1]
 1$  , trong 2 





 2003 
2008  2008.  1$ 








  .












 .
-   uyên:  , 
 ,  .
























 .  50%




 , 





 2.56$ 
1$ 









2.56$ cho 2$ CPU. 






mây, 



















.
- 



,  g: 

























. 







 



 chi 2$ cho 128 


2.56$ 

 2, hay 2$ cho 10



 1.2$-1.5$ 


Amazon S3. 

, S3 3 , 












 , 









 6$ cho 10


1.2$-1.5$ 

3.
- 





 :   , 























. 















, 








 . 



, 

 












nguyên.












 





 : 






 500











 . 








2 2 







1



. 20 
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 18













 500 x 2 / 20 hay 50 

. 


 1000 EC2 





 1 

. 










1000 x 0.1$ = 100$ 500 x 0.1$ = 50$ . . 














20Mbits/

. 












 (500GB x 1000MB/GB x 8bits/Byte)/20Mbits/sec =
4.000.000/20 = 200.000 sec ~ 55 . 





 






mây 

56 ti50  .





















 :
- , 









.
-  





.
- 



.
- 

















.
- 





.
- 







.
IV. 







 

































, 







  .
10 

















 :










1














2











































3

 , 






.
4















 
.
5



















.
6













.
7















 









.
8





 ,

9
























 




.
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 19

10









mây.
3. 



 







 :  








 









.
IV.1. 












 . 




 . 







 , 












 . 












, 





. 








.










S3: 
2h
15/2/2008
S3: 




6-8h
20/7/2008
AppEngine: 






5h
17/6/2008
Gmail: 








1.5h
11/8/2008
4. 


































, 
.






















 . 























.  0.03$ 

. 


 2 







 500 





 1GB/s


 500.000 bot. 



 15.000$ 
công. 



 360$ 

 100$ cho 1000 EC2 instance




. 



 32 







 , 




.
IV.2. 
















 

, tuy


















. 






















 . 













































 . 

















 
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 20

, 





  ,






.
 PI 


















, 














. 





 
. 



:
- 

















, 







- 





,  




 .
IV.3. 
















 








 . Tuy nhiên, 










 

 








, 

, hay firewall, 

, 


























 , 














.




 



 thông tin
 



  .


















 ,  ,








.
IV.4. 

 







 lên mây
 ,  100$-150$ 


n 

 , 













 . 




 .


























 . 
 . 1 



500GB, 16




, 1 







 1 









. 

 20 








 200$. 











 



 . 




















ng, 
.


























trên mây, 








 . 


















. 













 2 3 












2 instance.
.
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 21

IV.5. 




















 , 




/





 . 









 60% 












/O.








 v
kênh I/O. 













 , 


.




















 /O. 



 




 ( ) 


.
IV.6. 




 













 : 
, k



 , 







 . 




 





  



, 






, .








  (












), 





, 







, 










 (









 ). 
 










 


















, 







.
IV.7. 




































 .


















 , 








.
IV.8. 














 
























 . 

 , 












 . 










 





 2 














.
IV.9. Chia 


























 . 




2 



















 . 






















 










.
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 22

















 , 












. 








Amazon.
IV.10. 



. 











 ê










. 

 






















.























c













 





 .











. 

2 





 0.15$ 






0.1$ khi .
V. 

:





























mây, 
 











 . 































mây. 



 , 











 
 .  

 , 

  








   



 







 



 Google App
Engine.

Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 23



I. 




Google 
















Google.  , 


















 . 

, 
, .

 (example.appspot.com). 









 
























.


















 . 



,










 





 ,  JVM,





















 (

 ). 




 , 









 

.




















 ,






















.








 





 ,  
. 













. 













 ,






, 


















 . 






















, 









.




. 















500 MB























5 

















. 




, 













 , 












.










:
- 



 : 
































 . 

, 


















 . 












: 





















.
- 







:  
G



.
-  y, 





 : G


























 . 
 





 



 














trên GAE.
Xây dư
̣
ng ma
̣
ng xa
̃

̣
i eel trên nền ta
̉
ng di
̣
ch vu
̣
điê
̣
n toa
́
n đa
́
m mây Google App Engine

Sinh viên thư
̣
c hiê
̣
n : Đa
̀
o Phan Quang K50 Lơ
́
p CNPM 24

-  : G






















.
- 







 : G 500 



 



uyên
 5 





 











 .






, 















 .
 guyê



. 


















, 
 .
 



, 




























 . 




























.


nguyên




 








 






















Requests
1.300.000
requests
7.400
requests/
43.000.000
requests
30.000
requests/

1 gigabyte
56
megabyte/
1 gigabyte


 ;
1.046 gigabyte
10
gigabyte/


1 gigabyte
56
megabyte/
1 gigabyte


;
1.046 gigabyte
10
gigabyte/
CPU time
6.5 CPU-hour
15 CPU-
minute/
6.5 CPU-hour




;1.729
CPU-hour
72 CPU-
minute/
5. 



 














 








 









1 gigabyte
1 



;




.
6. 



 




nguyên




 








 






























10.000.000 



57.000 /
140.000.000





129.000
/

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay

×

×