Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton....
Transcript of Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton....
![Page 1: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/1.jpg)
Application Performance Monitoring in Tryton
![Page 2: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/2.jpg)
1/Why?
![Page 3: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/3.jpg)
● Usually crashes are pretty easy to fix● Other kind of bugs
1.1/Bugs/crashes?
![Page 4: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/4.jpg)
● It is hard to analyze specially on production because it's always too late
● Lots of elements:● Server hardware● Virtualization & OS● PostgreSQL● Python● Trytond● Trytond Modules● Network● Client
1.2/Performance
![Page 5: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/5.jpg)
● Ideally: should take into account as much layers as possible
● But, let's concentrate on Tryton
1.3/Specialized instrumentation
![Page 6: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/6.jpg)
2/What is apm.py?
![Page 7: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/7.jpg)
● A patch/hack on trytond/protocols● Signals:
● SIGUSR1: Print currently running RPC calls in the log● User ID● Object & RPC method● Postgres PID – APM!● Current total execution time of the request
● SIGUSR2: Print backtrace in the log – great for finding performance issues
2.1/The patch: Signals
![Page 8: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/8.jpg)
● Profiling using:● cProfile – A lof of overhead – should not be used in
production (usually)● vmprof (from pypy project) – 2~3% overhead
● When?● Criteria in trytond.conf (should it be dynamic??)● Criteria can include: user, rpc request
● Storage of the trace based on criteria (same as above + total time of request) – stores a Transaction ID
2.2/The patch: Profiling
![Page 9: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/9.jpg)
● Logging in JSON format:● Transaction ID● Time spent on transaction● RPC request● User
● Only log based on criteria in trytond.conf
2.3/The patch: Logging
![Page 10: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/10.jpg)
● Similar to Sentry● Give the user a “Transaction ID” for tracking the error● Maybe we should convert the Transaction ID into a docker-
like string: adjective_name such as angry_einstein
2.4/The patch: Friendly user message for crashes
![Page 11: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/11.jpg)
3/What about data gathering?
![Page 12: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/12.jpg)
● Python● Send and store in JSON format● Pick information from servers to RabbitMQ server● Store that information and query from the command line
3.1/Recull
![Page 14: Application Performance Monitoring in Tryton · Application Performance Monitoring in Tryton. 1/Why? ... Trytond Trytond Modules Network Client 1.2/Performance Ideally: should take](https://reader034.fdocuments.net/reader034/viewer/2022042806/5f6b1bb227a8df48de061889/html5/thumbnails/14.jpg)