Современная разработкав Mail.ruНа Perl и не только
MythesPerl 5.6 Apache 1CGI?
How many serversenough to process100k requestsper secondwith 0.01s delay?Thequestion
Users
Reademail
Andwant
Andwantavatars
Fromeverywhere
Many4Krps
Andfast4Krps0.01s
FilinIntroduce:Filin4KrpsСервер на C,который отдаетаватарки и иконки
Whatthesource?
Own…
Mail,Fb,Ok,Gravatar,ICQ,…… … …
FilinOwndataondisk4Krpsdisk1Krps
FilinWheretheothers?4Krps 3Krpsdisk1Krps?
FilinCodename“Avatard”4Krps 3KrpsСервис, умеющийискать и отдаватьаватарки. Быстроdisk1Krps
IProtoFilinHTTP–Overhead.IProto!4Krps 3Krpsdisk1Krpsstruct packet {uint32_t type,uint32_t length,uint32_t sequence,char[] ...
SrvIProtoFilinAvatardinside:theserver4Krps 3Krps
SrvSrvIProtoFilinAvatard:servers4Krps 3Krps
DBSrvSrvIProtoFilinTakedatafromdatabase4Krps 3Krps
MSrvSrvIProtoFilinReplicated4Krps 3Krps S
M1SrvSrvS1Mn SnIProtoFilinOfcourse,sharded4Krps 3KrpsTarantool
M1SrvSrvQueS1Mn SnIProtoFilinButwheretheyfrom?4Krps 3KrpsTarantoolочередь
M1SrvSrvQueS1Mn SnIProtoFilinFromtheinternet)4Krps…3KrpsResTarantool
M1SrvSrvQueS1Mn SnIProtoHTTPFilinSvcSomeHTTPRequests4Krps…3Krps3KrpsResTarantool
M1SrvSrvQueS1Mn SnIProtoHTTPFilinSvcGotaproblem!4Krps…3Krps3KrpsResTarantool0.01s3s1.5s2.5s
Howemailworks?письмо SMTP ServerSMTP Mail.ruХранилищеhttp://e.mail.ruАгент Mail.ruПисьмоилисписок писемКогдаузнаемКогдапок...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPFilinSvcMTAImprove!4Krps5Krpsdisk…3Krps3Krps5Krps ResTarantool>>3s
M1SrvSrvQueS1Mn SnIProtoIProtoHTTPFilinSvcMTASecondproblem:RAM4Krps5Krps…3Krps3Krps5Krps ResTarantool
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPFilinSvcMTARAMisnotrubber.Usedisk4Krps5Krpsdisk…3Krps3Krps5Krps ResTarantoolЗачем хра...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPFilinSvcMTAWelldone!4Krps5Krpsdisk…3Krps3Krps5Krps ResTarantool
Language?
C?
Avoidit
Perl!TIMTOWTDI
Fast devearly deploy
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernlanguage!ResPerl 7!
WellknownPerl5.
Perl6.O’RLY?
Perl7!Now!
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernlanguage!ResPerl 7! (5.16)
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEvent
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rp...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rp...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rp...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rp...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rp...
SourcesavailablePerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTPEVXSgithub.com/Mons/AnyEv...
Perl 5.6?Perl 5.6!M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPResPerl 7!Apache!Apache?CGI!CGI?
Perl5.16vsPerl5.8- Released 11.03.2013- Lower memory usage up to 25%- Lower CPU usage up to 10%- The best Unicode 6 suppor...
Database?
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPNoSQLDatabaseResTarantoolTarantool- High performance- Latest stable- Built in Lua- Mu...
M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPAndalsoqueueResTarantoolTarantool- High performance- Latest stable- Built in Lua- Mul...
How many serversenough to process100k requestsper secondwith 0.01s delay?So,thequestion…
Theansweris…
Morecorrectanswer;)
Profit: effective highloadIProto: 120k rps / serverHTTP: 40k rps / serverFast development – early deploy
Profit: effective highload1400%reservation
ApplianceHigh performance applicationsUComplex logic with many data sources
Mons AndersonР у к о в од и т ел ь отд ел а , П оч т а @ M a i l . r u< m o n s @ c p a n . o r g >< v. p e r e p e l i t ...
Perepelitsa
Perepelitsa
Upcoming SlideShare
Loading in...5
×

Perepelitsa

468

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
468
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Perepelitsa

  1. 1. Современная разработкав Mail.ruНа Perl и не только
  2. 2. MythesPerl 5.6 Apache 1CGI?
  3. 3. How many serversenough to process100k requestsper secondwith 0.01s delay?Thequestion
  4. 4. Users
  5. 5. Reademail
  6. 6. Andwant
  7. 7. Andwantavatars
  8. 8. Fromeverywhere
  9. 9. Many4Krps
  10. 10. Andfast4Krps0.01s
  11. 11. FilinIntroduce:Filin4KrpsСервер на C,который отдаетаватарки и иконки
  12. 12. Whatthesource?
  13. 13. Own…
  14. 14. Mail,Fb,Ok,Gravatar,ICQ,…… … …
  15. 15. FilinOwndataondisk4Krpsdisk1Krps
  16. 16. FilinWheretheothers?4Krps 3Krpsdisk1Krps?
  17. 17. FilinCodename“Avatard”4Krps 3KrpsСервис, умеющийискать и отдаватьаватарки. Быстроdisk1Krps
  18. 18. IProtoFilinHTTP–Overhead.IProto!4Krps 3Krpsdisk1Krpsstruct packet {uint32_t type,uint32_t length,uint32_t sequence,char[] data}
  19. 19. SrvIProtoFilinAvatardinside:theserver4Krps 3Krps
  20. 20. SrvSrvIProtoFilinAvatard:servers4Krps 3Krps
  21. 21. DBSrvSrvIProtoFilinTakedatafromdatabase4Krps 3Krps
  22. 22. MSrvSrvIProtoFilinReplicated4Krps 3Krps S
  23. 23. M1SrvSrvS1Mn SnIProtoFilinOfcourse,sharded4Krps 3KrpsTarantool
  24. 24. M1SrvSrvQueS1Mn SnIProtoFilinButwheretheyfrom?4Krps 3KrpsTarantoolочередь
  25. 25. M1SrvSrvQueS1Mn SnIProtoFilinFromtheinternet)4Krps…3KrpsResTarantool
  26. 26. M1SrvSrvQueS1Mn SnIProtoHTTPFilinSvcSomeHTTPRequests4Krps…3Krps3KrpsResTarantool
  27. 27. M1SrvSrvQueS1Mn SnIProtoHTTPFilinSvcGotaproblem!4Krps…3Krps3KrpsResTarantool0.01s3s1.5s2.5s
  28. 28. Howemailworks?письмо SMTP ServerSMTP Mail.ruХранилищеhttp://e.mail.ruАгент Mail.ruПисьмоилисписок писемКогдаузнаемКогдапоказываем+ аватарки
  29. 29. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPFilinSvcMTAImprove!4Krps5Krpsdisk…3Krps3Krps5Krps ResTarantool>>3s
  30. 30. M1SrvSrvQueS1Mn SnIProtoIProtoHTTPFilinSvcMTASecondproblem:RAM4Krps5Krps…3Krps3Krps5Krps ResTarantool
  31. 31. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPFilinSvcMTARAMisnotrubber.Usedisk4Krps5Krpsdisk…3Krps3Krps5Krps ResTarantoolЗачем хранить в памятинеиспользуемые?
  32. 32. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPFilinSvcMTAWelldone!4Krps5Krpsdisk…3Krps3Krps5Krps ResTarantool
  33. 33. Language?
  34. 34. C?
  35. 35. Avoidit
  36. 36. Perl!TIMTOWTDI
  37. 37. Fast devearly deploy
  38. 38. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernlanguage!ResPerl 7!
  39. 39. WellknownPerl5.
  40. 40. Perl6.O’RLY?
  41. 41. Perl7!Now!
  42. 42. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernlanguage!ResPerl 7! (5.16)
  43. 43. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEvent
  44. 44. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server
  45. 45. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)
  46. 46. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server
  47. 47. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)
  48. 48. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)Tarantool
  49. 49. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTP
  50. 50. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTPEV
  51. 51. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTPEVXS
  52. 52. SourcesavailablePerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTPEVXSgithub.com/Mons/AnyEvent-IProtogithub.com/Mons/AnyEvent-HTTP-Server-IITwiggy,Twisted,Node.js,(but not nginx ;)Faster than
  53. 53. Perl 5.6?Perl 5.6!M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPResPerl 7!Apache!Apache?CGI!CGI?
  54. 54. Perl5.16vsPerl5.8- Released 11.03.2013- Lower memory usage up to 25%- Lower CPU usage up to 10%- The best Unicode 6 support- Many modern features- Latest libraries- Support for new libraries- No old bugs- New regular expression- Async frameworks- Green threadsPerl 5.16- Released 31.01.2006- Buggy- Obsoleted!Perl 5.8
  55. 55. Database?
  56. 56. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPNoSQLDatabaseResTarantoolTarantool- High performance- Latest stable- Built in Lua- Multiple indexes- Composite indexes
  57. 57. M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPAndalsoqueueResTarantoolTarantool- High performance- Latest stable- Built in Lua- Multiple indexes- Composite indexes- Lua-based queue
  58. 58. How many serversenough to process100k requestsper secondwith 0.01s delay?So,thequestion…
  59. 59. Theansweris…
  60. 60. Morecorrectanswer;)
  61. 61. Profit: effective highloadIProto: 120k rps / serverHTTP: 40k rps / serverFast development – early deploy
  62. 62. Profit: effective highload1400%reservation
  63. 63. ApplianceHigh performance applicationsUComplex logic with many data sources
  64. 64. Mons AndersonР у к о в од и т ел ь отд ел а , П оч т а @ M a i l . r u< m o n s @ c p a n . o r g >< v. p e r e p e l i t s a @ c o r p . m a i l . r u >
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×