beanstalkd queues in django
DESCRIPTION
Description of concurrent worker processing with BeanstalkD message queue server used in conjuction with Django at ViideaTRANSCRIPT
![Page 1: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/1.jpg)
1
Distribuirano delo
Jernej Virag
Jernej Virag | @jernejv | http://www.virag.si
z Djangom
![Page 2: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/2.jpg)
2
Problemi
Strežniki so počasniHudo počasni. Res. Zelo.
Distribuirano delo z Djangom
![Page 3: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/3.jpg)
3
Problemi
Več strežnikovVeč strežnikov za različna heterogena opravila
Distribuirano delo z Djangom
![Page 4: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/4.jpg)
4
Rešitev
MQ strežnikiDrugi jeziki in infrastrukture to poznajo že lep čas
Distribuirano delo z Djangom
![Page 5: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/5.jpg)
5
Rešitev
MQ strežnikiDrugi jeziki in infrastrukture to poznajo že lep čas
Distribuirano delo z Djangom
![Page 6: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/6.jpg)
6
Rešitev
Distribuirano delo z Djangom
Task Task Task
Status
Status
Status
Django
Workers
MQ strežnik
Workers
Workers
![Page 7: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/7.jpg)
7
Problem
Python + MQ
Distribuirano delo z Djangom
![Page 8: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/8.jpg)
8
BeanstalkD
Distribuirano delo z Djangom
• Prioritete• Binarna shramba• Preprost tekstovni protokol• Ni odvisnosti• Hiter
• Hroščat
![Page 9: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/9.jpg)
9
BeanstalkD
Tekstovna sporočilaPreprosto pošiljanje in sprejemanje – JSON, YAML itd.
Distribuirano delo z Djangom
![Page 10: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/10.jpg)
10
BeanstalkD
„Cevi“ – posamezne vrsteZelo light-weight, možno delanje z večimi hkrati
Distribuirano delo z Djangom
![Page 11: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/11.jpg)
11
BeanstalkD
beanstalkc za knjižnicoJe „ok“.
Distribuirano delo z Djangom
![Page 12: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/12.jpg)
12
BeanstalkD - task
Distribuirano delo z Djangom
PUT čaka RESERVE procesira DELETE
![Page 13: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/13.jpg)
13
BeanstalkD - task
Distribuirano delo z Djangom
![Page 14: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/14.jpg)
14
BeanstalkD - task
Distribuirano delo z Djangom
![Page 15: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/15.jpg)
15
BeanstalkD - task
Distribuirano delo z Djangom
DELAYED
READYRESERVE
D
BURIED
PUT-DELAY
PUT RESERVE
RELEASE
KICK
BURY
DELETE
![Page 16: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/16.jpg)
16
BeanstalkD - tubes
Distribuirano delo z Djangom
• .tubes()
• .use(tube) / .using()
• .watch(tube) / .watching()• .ignore(tube)
![Page 17: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/17.jpg)
17
BeanstalkD
Kontrola napakNastavljanje TTR, avtomatsko vračanje v vrsto, …
Distribuirano delo z Djangom
![Page 18: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/18.jpg)
18
Pozor
Stabilnost beanstalkdBeanstalkc zganja paniko če beanstalkd zgine
Distribuirano delo z Djangom
![Page 19: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/19.jpg)
19
Pozor
Privzet je in-memory storeZa trajno shranjevanje sporočil je treba podati -b
Distribuirano delo z Djangom
![Page 20: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/20.jpg)
20
Pozor
Ciklanje pri napakahPrestrezite vse exceptione drugače se zgodijo GrdeStvari™
Distribuirano delo z Djangom
![Page 21: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/21.jpg)
21
Pozor
VarnostNi avtentikacije, enkripcije in ostalih mehanizmov
Distribuirano delo z Djangom
![Page 22: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/22.jpg)
22
Pozor
Hrošči
https://github.com/kr/beanstalkdhttps://github.com/earl/beanstalkc
Distribuirano delo z Djangom
![Page 23: BeanstalkD Queues in Django](https://reader036.vdocuments.pub/reader036/viewer/2022062419/5579160fd8b42a03578b5587/html5/thumbnails/23.jpg)
23
?Jernej Virag
@jernejvhttp://www.virag.si
Distribuirano delo z Djangom