Perepelitsa
Upcoming SlideShare
Loading in...5
×
 

Perepelitsa

on

  • 484 views

 

Statistics

Views

Total Views
484
Views on SlideShare
212
Embed Views
272

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 272

http://techforum.mail.ru 272

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Perepelitsa Perepelitsa Presentation Transcript

  • Современная разработкав 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[] data}
  • 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 rps/core)
  • M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)Tarantool
  • M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTP
  • M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTPEV
  • M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPModernasyncframefork!ResPerl 7!AnyEventIProto::Server(40k rps/core)HTTP::Server(8k rps/core)TarantoolHTTPEVXS
  • 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
  • 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 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
  • Database?
  • M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPNoSQLDatabaseResTarantoolTarantool- High performance- Latest stable- Built in Lua- Multiple indexes- Composite indexes
  • M1SrvSrvQueS1Mn SnswpIProtoIProtoHTTPAndalsoqueueResTarantoolTarantool- High performance- Latest stable- Built in Lua- Multiple indexes- Composite indexes- Lua-based queue
  • 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 s a @ c o r p . m a i l . r u >