Based on my experience in diagnosing and troubleshooting high load e-commerce Node.js app in production, I’ve identified three stages in the Node.js diagnostic history. I’d like to briefly tell this path and show where we are now and tell in details "How to debug and tracing Node.js apps on different levels, and how to track performance problems and memory leaks inside Node.js apps in 2018":
Production troubleshooting: I show and explain the strategy of creation and debugging core dump using llnode, node-report and X-Transaction-ID in our company with real-life examples.
Memory leaks: I show how to identify memory leaks, memory holders using V8 GC tracing, llnode debugging + gencore tool with real-life examples.
Performance: I show how to use 0x flame graph to find performance bottlenecks, how identify Event Loop lags, GC slow work and what can give Async Hooks for that with real-life examples.
TDD isn't news, and most everyone agrees that writing tests (before, during or after implementation) is valuable. Hardly anyone agrees on what good, clean tests look like, though; if your tests are a live specification of your codebase, don't they deserve the same care and attention as your production code?
This talk focuses on how to keep your tests readable, simple and maintainable. Specifically we'll discuss how the "given-when-then" pattern affects the way you factor your code, and showcase the remarkable differences between a sloppy specification and a well-factored one.
Moderate experience with testing is expected; knowledge Scala might be helpful but is not required.
The secret unit testing tools no one has ever told you aboutDror Helper
There are more to unit testing than using a unit testing framework - in order to succeed you want to use the right tools for the job. There are a few tools that almost no one talks about - some enabling creating of top-notch, robust unit tests. Some will help you run your tests better and faster.
In this session I'll explain about the inevitable maintainability problems developers face when writing and maintaining huge unit testing suits and how unit level BDD, AutoMocking, and Continuous Execution can help take control over your tests.
This talk was given at FrenchKit 2019 which took place in Paris, France on 7-8 October.
With SwiftUI and Combine, Apple is changing its approach for how we define data flows and UI. As we move from playing with sample code to writing production apps, it’s time to start thinking about testing. Nataliya will show how to apply several learnings from her experience with declarative UIs to this new reality.
TDD isn't news, and most everyone agrees that writing tests (before, during or after implementation) is valuable. Hardly anyone agrees on what good, clean tests look like, though; if your tests are a live specification of your codebase, don't they deserve the same care and attention as your production code?
This talk focuses on how to keep your tests readable, simple and maintainable. Specifically we'll discuss how the "given-when-then" pattern affects the way you factor your code, and showcase the remarkable differences between a sloppy specification and a well-factored one.
Moderate experience with testing is expected; knowledge Scala might be helpful but is not required.
The secret unit testing tools no one has ever told you aboutDror Helper
There are more to unit testing than using a unit testing framework - in order to succeed you want to use the right tools for the job. There are a few tools that almost no one talks about - some enabling creating of top-notch, robust unit tests. Some will help you run your tests better and faster.
In this session I'll explain about the inevitable maintainability problems developers face when writing and maintaining huge unit testing suits and how unit level BDD, AutoMocking, and Continuous Execution can help take control over your tests.
This talk was given at FrenchKit 2019 which took place in Paris, France on 7-8 October.
With SwiftUI and Combine, Apple is changing its approach for how we define data flows and UI. As we move from playing with sample code to writing production apps, it’s time to start thinking about testing. Nataliya will show how to apply several learnings from her experience with declarative UIs to this new reality.
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
This is the support of a course to teach React programming for Java and C# programmers. It covers from its origins in Facebook til separation of presentational and container components. What is JSX, rules, state, props, refactoring, conditionals, repeats, forms, synchronizing values, composition, and so on.
Robert Knight, Software Engineer at Mendeley
Rob will explore how to take advantage of React's use of JavaScript/JSX and the virtual UI to catch regressions earlier and make writing and debugging tests for React components easier and faster.
Struts has outgrown its reputation as a simple web framework and has become more of a brand. Because of this, two next generation frameworks are being developed within the project: Shale and Action 2.0. Action 2.0 is based on WebWork, and though its backing beans are similar to JSF, its architecture is much simpler, and easier to use.
Migrating to Struts Action 2.0 is more about unlearning Struts than it is about learning the "WebWork Way". Once you understand how simple WebWork is, you'll find that Struts Action 2.0 is a powerful framework that supports action-based navigation, page-based navigation, AOP/Interceptors, components and rich Ajax support.
Come to this session to see code comparisons and learn about migration strategies to use the kick-ass web framework of 2006.
Have you ever thought how is it to work with ReactJS for a long time? I do. The talk is taking you through the life of the stack at HolidayCheck, lessons learned and other experiences.
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Peter Martin
One of the new feature since Joomla 3.2 is Rapid Application Development (RAD) framework.
A Joomla component is a PHP/MySQL web application that uses Joomla's framework. You can build your components on Joomla's framework and Joomla will take care of the database connection, the design (using templates), access levels, forms (JForms), etc. Using Joomla's framework saves you a lot of work and development time. However, it can be even faster!
Most Joomla components include the same functionality: In the front-end a list of records from the database hyperlinked to pages with details of each record individually. In the back-end the component list records from the database, with a link to a form where you can change the data and save.
Using the Rapid Application Development Framework (also known as FOF (Framework On Framework)) allows you to develop a component with common functionality with far fewer lines of code.
In this presentation, Peter shows how you can use Joomla's RAD to build a simple Joomla component to manage locations and categories and present those on the front-end to visitors on a Google Map.
Contents:
* Programming a simple front-end component using FOF
* Demo with programming, github & local web environment
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Codemotion
Since we started to see JS on the server side, the dream of developers has been to reduce the gap and the cost of switch between frontend/backend. Today with Node.js, React and a whole ecosystem of tools, this dream is becoming true! In this talk I am going to discuss about Universal (a.k.a. Isomorphic) JS and present some practical example regarding the major patterns related to routing, data retrieval and rendering. I will use Node, React, Webpack, Babel and React Router and give you a series of example to get you started easily with this new technology trend.
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
This is the support of a course to teach React programming for Java and C# programmers. It covers from its origins in Facebook til separation of presentational and container components. What is JSX, rules, state, props, refactoring, conditionals, repeats, forms, synchronizing values, composition, and so on.
Robert Knight, Software Engineer at Mendeley
Rob will explore how to take advantage of React's use of JavaScript/JSX and the virtual UI to catch regressions earlier and make writing and debugging tests for React components easier and faster.
Struts has outgrown its reputation as a simple web framework and has become more of a brand. Because of this, two next generation frameworks are being developed within the project: Shale and Action 2.0. Action 2.0 is based on WebWork, and though its backing beans are similar to JSF, its architecture is much simpler, and easier to use.
Migrating to Struts Action 2.0 is more about unlearning Struts than it is about learning the "WebWork Way". Once you understand how simple WebWork is, you'll find that Struts Action 2.0 is a powerful framework that supports action-based navigation, page-based navigation, AOP/Interceptors, components and rich Ajax support.
Come to this session to see code comparisons and learn about migration strategies to use the kick-ass web framework of 2006.
Have you ever thought how is it to work with ReactJS for a long time? I do. The talk is taking you through the life of the stack at HolidayCheck, lessons learned and other experiences.
Developing a Joomla 3.x Component using RAD FOF- Part 2: Front-end + demo - J...Peter Martin
One of the new feature since Joomla 3.2 is Rapid Application Development (RAD) framework.
A Joomla component is a PHP/MySQL web application that uses Joomla's framework. You can build your components on Joomla's framework and Joomla will take care of the database connection, the design (using templates), access levels, forms (JForms), etc. Using Joomla's framework saves you a lot of work and development time. However, it can be even faster!
Most Joomla components include the same functionality: In the front-end a list of records from the database hyperlinked to pages with details of each record individually. In the back-end the component list records from the database, with a link to a form where you can change the data and save.
Using the Rapid Application Development Framework (also known as FOF (Framework On Framework)) allows you to develop a component with common functionality with far fewer lines of code.
In this presentation, Peter shows how you can use Joomla's RAD to build a simple Joomla component to manage locations and categories and present those on the front-end to visitors on a Google Map.
Contents:
* Programming a simple front-end component using FOF
* Demo with programming, github & local web environment
Universal JavaScript Web Applications with React - Luciano Mammino - Codemoti...Codemotion
Since we started to see JS on the server side, the dream of developers has been to reduce the gap and the cost of switch between frontend/backend. Today with Node.js, React and a whole ecosystem of tools, this dream is becoming true! In this talk I am going to discuss about Universal (a.k.a. Isomorphic) JS and present some practical example regarding the major patterns related to routing, data retrieval and rendering. I will use Node, React, Webpack, Babel and React Router and give you a series of example to get you started easily with this new technology trend.
It’s trivial today to start writing and debugging some React code, but it’s not 100% clear how to properly deploy the application, manage versions and what implications that has on the build configurations. Especially if you want to allow different versions for different users in order to perform some A/B testing, testing new features in production environment, come up with some UI experiments, or gradually roll out new features for a subset of users.
In this presentation I hopefully covered all that.
Application Security from the Inside - OWASPSqreen
Presentation at the OWASP (Open Web Application Security Project) on how to make apps secure by protecting them from the inside.
Detecting and protecting from
1. SQL injection
2. Cross Site Scripting (XSS)
3. Third party components vulnerabilities
4. Shell injection
etc.
PRG 420 Week 3 Individual Assignment Netbeans Project (annual compensation with commission)/build.xml
Builds, tests, and runs the project PRG420V10_Week3.
PRG 420 Week 3 Individual Assignment Netbeans Project (annual compensation with commission)/build/classes/.netbeans_automatic_build
PRG 420 Week 3 Individual Assignment Netbeans Project (annual compensation with commission)/build/classes/DriverCalculator.classpublicsynchronizedclass DriverCalculator {
public void DriverCalculator();
publicstatic void main(String[]);
}
PRG 420 Week 3 Individual Assignment Netbeans Project (annual compensation with commission)/build/classes/SalesPerson.classpublicsynchronizedclass SalesPerson {
double fixedSalary;
double annualSales;
double commission;
double target;
public void SalesPerson(double);
public double getTotalAnnualCompensation();
}
PRG 420 Week 3 Individual Assignment Netbeans Project (annual compensation with commission)/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
PRG 420 Week 3 Individual Assignment Netbeans Project (annual compensation with commission)/nbproject/build-impl.xml
Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set build.test.classes.dir
Must set build.test.results.dir
Must set build.classes.excludes
Must set dist.jar
.
Logux, a new approach to client-server communication by Andrey SitnikReact London 2017
Combining ideas from both Redux and CRDT, Logux is a new tool which replaces AJAX with real-time data in applications, synchronising action logs between the client and server while also providing an offline mode. This approach could significantly simplify application code and bring plug&play support for live updates and offline editing.
2016년 12월에 진행되었던 W3C HTML5 Conference 2016의 오후 트렉 (웹프레임워크)의 발표 자료입니다.
GDG Korea Web Tech 운영진이신 한장현 님께서 ‘AngularJS와 ES6’에 대한 주제로 발표를 진행하였습니다. 이 발표를 통해서 Angular와ES6를 함께 사용하기 위해 필요한 구체적인 내용들을 공유하였습니다. Angular를 현재 사용하시는 분들께 많은 도움이 되는 시간이었던 것 같습니다.
4 Node.js Gotchas: What your ops team needs to knowDynatrace
To register for this webinar replay, click here:
https://info.dynatrace.com/apm_wc_nodejs_na_registration.html
There is no doubt that Node.js is one of the fastest growing platforms today. It can be found at start-ups and enterprises throughout all industries from high-tech to healthcare.
A lot of people have written about the reasons for its popularity and why it has made sense in “digital transformation” efforts. But when you implement Node.js, do you have to replace your mainframes and legacy software with a shiny new Node.js-based microservice architecture?
This 30-minute webinar walks in the shoes of those who oversee the whole digital value chain: Operation and performance teams. We will cover:
Node.js implementation requirements (Hint: you might not have to gut your whole system)
What challenges operations and performance teams face when they begin to implement Node.js
The big four gotchas that can make using Node.js difficult for an operations team
Gain the know-how to support your development and ops teams in implementing Node.js.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Modern design is crucial in today's digital environment, and this is especially true for SharePoint intranets. The design of these digital hubs is critical to user engagement and productivity enhancement. They are the cornerstone of internal collaboration and interaction within enterprises.
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
Data privacy is one of the most critical issues that businesses face. This presentation shares insights on the principles and best practices for ensuring the resilience and security of your workload.
Drawing on a real-life project from the HR industry, the various challenges will be demonstrated: data protection, self-healing, business continuity, security, and transparency of data processing. This systematized approach allowed to create a secure AWS cloud infrastructure that not only met strict compliance rules but also exceeded the client's expectations.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
4. Diagnostics
Node.js Diagnostics Working Group https://github.com/nodejs/diagnostics
Post Mortem Diagnostics Working Group https://github.com/nodejs/post-mortem
Work is divided into several domains:
1. Tracing
Profiling
Heap and Memory Analysis
Step Debugging
2. Postmortem debugging
4
5. Stages of Node.js diagnostics evolution before 2017
The first stage The second stage
5
6. The third stage of Node.js diagnostics evolution
The first stage The second stage The third stage
6
7. 1. Diagnostic tools appeared with a delay.
2. Most tools didn’t support the latest version of V8 (Node.js )
3. We had to choose: performance or tools
4. Or new tools appear, but without support for previous versions of Node. js
V8 engine update
7
8. Node.js in Enterprise Architecture
Transperfect internationalization CDN
8
* This is a greatly simplified scheme
Node.js Microservices
app app app
Node.js Web
back-end
app app app
Akamai CDN
Oracle
Splunk
NewRelic
Redis
Security Gateway
Java apps
AWS Services
Catalog
Web UIMobile
Tealium Paypal
Bazaar
voice Olapic
… and many other
external services
CDN scene Seven
CMS
Search Engine
14. Core dump creation algorithm for postmortem debugging
Serving traffic
uncaught exception
abort() before
the crash
Restart app
core dump
debugging
with llnode
Fix
14
local
node --abort-on-uncaught-exception app.js
name: core.<PID>
size: ~1.5GB
> llnode -c /cores/core.<PID>
15. Debugging steps
1. Get the Stack Trace and find the last JS function before the exit
2. Read the source code of the function
3. Get input parameters: request and response
15
16. $ llnode -c /cores/core.13364
$(llnode) v8 bt
frame #4: 0x3501dbc040dd <exit>
frame #5: 0x3501dbceb5cc <builtin>
frame #6: 0x3501dbc12f12 reserve(this=0x0153bf0e84d1:<Object: ProductController>,
0x163b0e223089:<Object: IncomingMessage>, 0x163b0e224e39:<Object: ServerResponse>) at
/demo/controllers/ProductController.js:8:11 fn=0x04c146ed3fa1
frame #7: 0x3501dbcf3fa1 <builtin>
frame #8: 0x3501dbc12f12 (anonymous)(this=0x163b0e223089:<Object: IncomingMessage>) at
/demo/app.js:21:28 fn=0x163b0e227699
frame #9: 0x3501dbcf373c <builtin>
frame #10: 0x3501dbc12f12 emitNone(this=0x0b9b56e02241:<undefined>, 0x163b0e2278a9:<Array:
….
Step 1. Get the Stack Trace and find the last JS function
16
starts llnode debugger with core dump
returns JS and C++ Stack Trace
addresses in the Memory
17. Step 2. Read the source code of the function
(llnode) v8 inspect --print-source 0x4c146ed3fa1
0x04c146ed3fa1:<function: reserve at /demo/controllers/ProductController.js:8:11
source:
const { id, storeId } = req.cookies['profile'];
const rewards = req.cookies['rewards'];
const { products } = req.body;
this._reservationService.reserve(id, storeId, rewards.id, products)
.then(data => {
return res.send(data);
}
);
17
26. Case 2. List of the killed requests in current process
$(llnode) v8 findjsinstances IncomingMessage
...
0x0af20adff4a1:<Object: IncomingMessage>
0x25c630d8fe69:<Object: IncomingMessage>
0x25c630d97861:<Object: IncomingMessage>
0x25c630d9d811:<Object: IncomingMessage>
0x25c630da9729:<Object: IncomingMessage>
0x25c630daf8d9:<Object: IncomingMessage>
0x25c630dbb669:<Object: IncomingMessage>
0x25c630dc1591:<Object: IncomingMessage>
0x25c630dd6c31:<Object: IncomingMessage>
0x25c630ddcb59:<Object: IncomingMessage>
0x25c630de2ed1:<Object: IncomingMessage>
0x25c630de8d01:<Object: IncomingMessage>
0x25c630deec29:<Object: IncomingMessage>
…
26
add X-Transaction-ID
Event Loop
request
response
27. Case 2. Search headers by the value of request ID
$(llnode) v8 findrefs --string "6af9c8d5-1b18-48b0-86fc-b9aac43b3cd6"
0x25c630deef01: Object.X-Transaction-ID=0x25c630deea51 '6af9c8d5-1b18-48b0-86fc-b9aac43b3cd6'
27
string address
address of parent object - headers
28. Case 2. Search request by address of headers object
$(llnode) v8 findrefs --string "6af9c8d5-1b18-48b0-86fc-b9aac43b3cd6"
0x25c630deef01: Object.X-Transaction-ID=0x25c630deea51 '6af9c8d5-1b18-48b0-86fc-b9aac43b3cd6'
$(llnode) v8 findrefs --value 0x25c630deef01
0x27a40a5bbce9: IncomingMessage.headers=0x25c630deef01
28
the request object that we need
33. I use core dump! Let’s the debugging begin!
33
34. I use core dump! Let’s the debugging begin!
What is the difference between all of them?
34
35. I use core dump! Let’s the debugging begin!
What is the difference between all of them?
35
Boss: How much time do you need to solve
the issue?
Core dump flood
36. const gencore = require('gencore');
const errorRegistry = new ErrorRegistry(redisClient);
app.use( function errorHandlerMiddleware (err, req, res, next) {
errorRegistry.add(err, req)
.then(result => {
if (result) { // was error added to registry
gencore.collectCore((error, name) => {
logger.info(`Core dump created at: ${name}
for request: ${req.headers['X-Transaction-ID']}`);
});
}
// … send 500 status
})
.catch(err => { … // handleError(err, req, res, next); })
});
Error handler with Error Registry and gencore
36
npm install --save-dev gencore
Makes process fork and creates core dump
core
dump
* This is the simplified example
error selection logic
37. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
37
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
38. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
38
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
39. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
39
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
40. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
40
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
41. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
41
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
42. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
42
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
43. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
43
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
44. Core dump creation algorithm in production
Serving Traffic Error Handler
core dump
logs
Request ID
Fix
No
Yes
44
caught
create
dump?
gencore
process fork
abort
Restart node-report
report
abort
core dump
write log
read in Splunk
llnode
No
Yes
45. Tips
1. Follow to Error handling best practices
2. Call abort() only in centralized error handler
3. Use gencore
4. Use node-report to generate a report
5. Track requests using id – X-Transaction-ID or X-Request-ID (NGINX) header (or Zipkin headers)
6. Avoid core dump flood
45
50. 50
modules App logic logic in handlebars templates fs lodash
page rendering
partials/helpers hbspartials/helpers
~65% on page
rendering (SSR)
~20% on lodash
operations with
data
~10% on data
retrieval from API
(Promises)
Application spends:
53. Performance improvements
After performance profiling with perf, DTrace, 0x and bcc utils we:
▪ Reduced CPU intensive operations:
a. lodash objects merge, deep clone
b. long cycles
c. JSON parse
▪ Removed logic from view templates and helpers
▪ Reviewed and updated npm dependencies
▪ Gradually implemented React SSR
53
55. Tips
55
1. Performance should be a part of requirements.
2. Measure performance before embedding third-party libraries and after
3. Collect measurement results archive
4. Profile on staging/pre-production environments
5. Monitor diagnostic tools performance impact
56. 3. Memory grows
Ways to identify:
▪ Application Monitoring tools (N|Solid, NewRelic)
▪ DTrace, Instruments, perf
▪ node-memwatch
▪ GC Tracing
▪ Valgrind for C++ modules
▪ heapdump
▪ Fatal error
▪ and other...
56
57. Case: Excessive garbage collection.
The creation a lot of new objects
57
GC rate grows in New Space (Scavenge GC)
58. 256201 ms: Scavenge 824.5 (1014.4) -> 811.4 (1016.2) MB, 16.9 / 0.0 ms [allocation failure].
256218 ms: Scavenge 838.8 (1019.3) -> 827.7 (1024.7) MB, 17.6 / 0.0 ms [allocation failure].
256236 ms: Scavenge 852.8 (1024.7) -> 842.9 (1026.5) MB, 11.0 / 0.0 ms [allocation failure].
256557 ms: Scavenge 869.8 (1201.6) -> 858.1 (1209.6) MB, 33.3 / 0.0 ms (+ 86.0 ms in 176 steps since
last GC) [allocation failure].
256925 ms: Scavenge 884.1 (1232.8) -> 871.9 (1239.2) MB, 36.5 / 0.0 ms (+ 56.7 ms in 168 steps since
last GC) [allocation failure].
Case: Scavenge GC in New Space.
58
Long Garbage collectionMemory grows
Interval
node --trace_gc --trace_gc_verbose app.js > gc-trace.log
67. Tips
1. Control the Life Cycle of app Objects and Sessions
2. Trace Scavenge GC in Profiler Stacks to find allocation cause (bcc/tools/stackcount.py)
3. Use D8 to check Javascript behavior in V8 (%DebugTrackRetainingPath(x))
4. Call GC manually to check memory allocation
5. Write memory usage tests for code and libraries with leakage
6. Create heapdump/ coredump for deep investigation
67
68. Result
1 month before 3 weeks of investigation
and refactoring
After improvements
original
time has been
grown x4
68
new baseline