An attempt to see how node is faster than (PHP+Acpache) stack where situations are similar and none of them are tweaked from their default configuration
Servers with Event Machine - David Troy - RailsConf 2011David Troy
EventMachine allows Ruby programs to handle many concurrent connections without blocking or threads. It uses an asynchronous model where callbacks are invoked in response to I/O events like incoming connections or data. EventMachine provides a high performance non-blocking TCP server that handles all I/O with callbacks rather than blocking. It can be used to build scalable I/O intensive applications like email servers that handle thousands of concurrent connections in a single Ruby process. The key is to never block the EventMachine reactor loop.
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.comIlya Grigorik
A high-performance proxy server is less than a hundred lines of Ruby code and it is an indispensable tool for anyone who knows how to use it. In this session we will first walk through the basics of event-driven architectures and high-performance network programming in Ruby using the EventMachine framework.
These are the slides to a talk I gave at Pittsburgh techFest 2012. The topic was an overview of the Node.js framework, and how you can use it to build amazing things.
* See more of my work at http://www.codehenge.net
0-60 with Goliath: Building High Performance Ruby Web-ServicesIlya Grigorik
The document discusses Goliath, an open source Ruby web framework for building high-performance web services. It provides an overview of Goliath's features like asynchronous HTTP processing, routing, middleware, streaming responses and websockets. Examples are given showing how to write simple Goliath applications and APIs. The document also discusses how Goliath enables building asynchronous apps using techniques like EventMachine and Fibers.
A look at the technologies and the architecture behind the emerging real-time web. We will discuss XMPP/Jabber and AMQP protocols and explore the advantages of each over the commonly used HTTP request-response cycle. As part of the workshop we will look at the available tools and libraries and work through simple examples of creating an event driven, real-time service.
0-60 with Goliath: High performance web servicesIlya Grigorik
This document discusses Goliath, an open source Ruby web framework for building high performance web services. It provides an overview of Goliath's architecture and goals of optimizing for performance through an asynchronous event-driven model. Key topics covered include HTTP pipelining and keep-alive, the EventMachine reactor loop, and Goliath's minimal client API.
Ruby Proxies for Scale, Performance, and MonitoringIlya Grigorik
The document discusses using Ruby proxies with EventMachine to provide transparent scaling, performance improvements, and monitoring capabilities for web applications. Proxies can intercept, cache, and alter requests and responses to balance load across multiple application servers, simulate production traffic for staging environments, and benchmark performance. The EM-Proxy library provides an API and examples for building intercepting, transparent, and other types of proxies with EventMachine for networking applications in Ruby.
Servers with Event Machine - David Troy - RailsConf 2011David Troy
EventMachine allows Ruby programs to handle many concurrent connections without blocking or threads. It uses an asynchronous model where callbacks are invoked in response to I/O events like incoming connections or data. EventMachine provides a high performance non-blocking TCP server that handles all I/O with callbacks rather than blocking. It can be used to build scalable I/O intensive applications like email servers that handle thousands of concurrent connections in a single Ruby process. The key is to never block the EventMachine reactor loop.
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.comIlya Grigorik
A high-performance proxy server is less than a hundred lines of Ruby code and it is an indispensable tool for anyone who knows how to use it. In this session we will first walk through the basics of event-driven architectures and high-performance network programming in Ruby using the EventMachine framework.
These are the slides to a talk I gave at Pittsburgh techFest 2012. The topic was an overview of the Node.js framework, and how you can use it to build amazing things.
* See more of my work at http://www.codehenge.net
0-60 with Goliath: Building High Performance Ruby Web-ServicesIlya Grigorik
The document discusses Goliath, an open source Ruby web framework for building high-performance web services. It provides an overview of Goliath's features like asynchronous HTTP processing, routing, middleware, streaming responses and websockets. Examples are given showing how to write simple Goliath applications and APIs. The document also discusses how Goliath enables building asynchronous apps using techniques like EventMachine and Fibers.
A look at the technologies and the architecture behind the emerging real-time web. We will discuss XMPP/Jabber and AMQP protocols and explore the advantages of each over the commonly used HTTP request-response cycle. As part of the workshop we will look at the available tools and libraries and work through simple examples of creating an event driven, real-time service.
0-60 with Goliath: High performance web servicesIlya Grigorik
This document discusses Goliath, an open source Ruby web framework for building high performance web services. It provides an overview of Goliath's architecture and goals of optimizing for performance through an asynchronous event-driven model. Key topics covered include HTTP pipelining and keep-alive, the EventMachine reactor loop, and Goliath's minimal client API.
Ruby Proxies for Scale, Performance, and MonitoringIlya Grigorik
The document discusses using Ruby proxies with EventMachine to provide transparent scaling, performance improvements, and monitoring capabilities for web applications. Proxies can intercept, cache, and alter requests and responses to balance load across multiple application servers, simulate production traffic for staging environments, and benchmark performance. The EM-Proxy library provides an API and examples for building intercepting, transparent, and other types of proxies with EventMachine for networking applications in Ruby.
Cloud Native Night June 2019, Munich: Talk by Moritz Kammerer (Software Architect at QAware)
Join our Meetup: www.meetup.com/cloud-native-muc
Abstract: Startup-Zeiten von Containern werden bei elastischer Skalierung in der Cloud immer wichtiger – wer möchte schon 2 Minuten warten, bis eine neue Instanz des Services erscheint? Hier kann der Shooting Star von Java-basierten Microservices, Spring Boot, nicht glänzen. Systembedingt steigt die Startzeit des Containers mit der Menge der Klassen auf dem Classpath. Auch der Speicherverbrauch einer Spring Boot Anwendung ist nicht gerade gering.
Micronaut, erschaffen von den Machern des Grails-Frameworks, behauptet, diese Probleme in den Griff zu bekommen. In dem Talk sehen wir uns an, wie sich Microservices mit Micronaut entwickeln lassen und prüfen, ob es die Versprechen hält.
Bonus: Da Micronaut kaum Reflection verwendet, sollte es sich mit dem GraalVM AOT Compiler in ein natives Image kompilieren lassen. In dem Vortrag werden wir dies ausprobieren und die Performance dieses Native Images messen.
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...wallyqs
The NATS Go client is the canonical implementation of a client for the NATS Messaging System, and from the beginning it was designed for high performance. In this talk, we will cover its APIs and dissect how the client internal engine works to get the most out of Go to achieve maximum throughput.
The document summarizes a transition from a LAMP stack (Linux, Apache, MySQL, PHP) to a LNLP stack (Linux, Nginx, NoSQL, PHP-FPM). It discusses moving from Apache to Nginx as the web server for improved performance under load. It also discusses moving from MySQL to a NoSQL database like MongoDB for flexibility with data structures and large datasets. Finally, it discusses moving from mod_php to PHP-FPM to improve PHP performance and flexibility. Steps are provided to install and configure Nginx, PHP-FPM and MongoDB on Ubuntu. Benchmark results show improved request throughput and reduced response times with the new stack configuration.
Ville Lautanala describes different transport channels that allow pushing data from servers to clients in real time.
He also introduces a case study of Flowdock's experience with socket.io and WebSockets.
Presentation from Frontend Finland meetup, March 14th. A slightly modified version was presented at SFJS, April 3rd.
اِنجیناِکس (به انگلیسی: nginx) یک کارساز وب با حجم پایین و کارایی بالا است که تحت مجوز بیاسدی منتشر میشود. این کارساز وب در یونیکس، گنو/لینوکس، بیاسدی، مک او اس و ویندوز اجرا میشود. بر طبق گفتهٔ نتکرافت، در حال حاضر ۱۲.۰۷٪ از دامنههای اینترنت از این کارساز استفاده میکنند.
این پروژه در سال ۲۰۰۱ بنیان نهاده شد و توسط یک توسعهدهنده مستقل به نام ایگور سیسووف (به انگلیسی: Igor Sysoev) به مرحله اجرا درآمد تا در یکی از وبسایتهای پرترافیک به نام رامبرلر به خدمت گرفته شود که این وبسایت در تاریخ سپتامبر ۲۰۰۸، روزانه بیش از ۵۰۰ میلیون درخواست HTTP داشته است. در حال حاضر وبسایتهای سرشناسی همچون فیسبوک، نتفلیکس، وردپرس، سورسفورج و ... از انجیناکس استفاده میکنند.[۶] در نسخه ۵٫۲ اوپنبیاسده که در نوامبر ۲۰۱۲ عرضه شد هم نرمافزار انجیناکس به صورت پیشفرض در سیستم قرار داده شد تا جایگزینی باشد برای آپاچی ۱٫۳. در نهایت در سال ۲۰۱۴ آپاچی از درخت کد منبع اوپنبیاسدی حذف شد.
Communication in Python and the C10k problemJose Galarza
Talk at the Codemotion Spain 2014 about how to handle communication (polling, long polling, websockets, SSE), concurrency (processes, threads, coroutines, green threads) and the C10K problem in python
Node.js is a JavaScript runtime built on Chrome's V8 engine that allows building scalable network applications using JavaScript on the server-side. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, suitable for data-intensive real-time applications that run across distributed devices. Common uses of Node.js include building web servers, file upload clients, ad servers, chat servers, and any real-time data applications. The document provides an introduction to Node.js concepts like callbacks, blocking vs non-blocking code, the event loop, streams, events, and modules.
The document discusses using alternative infrastructures like Nginx and Redis instead of traditional Apache and MySQL. It describes building a Twitter clone called "Retwis" using Sinatra and Redis, and compares the performance of Nginx to Apache when serving static and dynamic content. Nginx generally outperforms Apache, especially for static files, due to its asynchronous and event-based architecture avoiding context switches. Load testing revealed issues with current practices for MySQL dumps and load testing that do not properly simulate high concurrency or isolate variables.
A language for the Internet: Why JavaScript and Node.js is right for Internet...Tom Croucher
Increasingly we want to do more with the web and Internet applications we build. We have more features, more data, more users, more devices and all of it needs to be in real-time. With all of these demands how can we keep up? The answer is choosing a language and a platform that are optimized for the kind of architecture Internet and web applications really have. The traditional approach prioritises computation, assigning server resources before they are actually needed. JavaScript and Node.js both take an event driven approach only assigning resources to events as they happen. This allows us to make dramatic gains in performance and resource utilization while still having an environment which is fun and easy to program.
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...Tom Croucher
Node.js allows JavaScript to be used for server-side programming. It is a popular choice because JavaScript programmers can reuse code and libraries on both the client-side and server-side. Node.js is also fast and non-blocking which allows for high concurrency levels. The Node.js ecosystem includes many libraries like Express for building web servers and Mustache.js for templating that make building server-side JavaScript applications easy.
“Node's goal is to provide an easy way to build scalable Network programs”
Asynchronous i/o framework
Core in c++ on top of v8
Rest of it in javascript
Swiss army knife for network Related stuffs
Can handle thousands of Concurrent connections with Minimal overhead (cpu/memory) on a single process
It’s NOT a web framework, and it’s also NOT a language
• Created by Ryan Dahl in 2009
• Development && maintenance sponsored by Joyent
• License MIT
• Last release : 0.10.31
• Based on Google V8 Engine
• +99 000 packages
Jeff Miccolis discusses how node.js is better than PHP/Drupal for handling asynchronous tasks like sending large numbers of emails, processing feed items, and handling big file uploads/long sessions. Node.js uses an event loop and non-blocking I/O which allows it to process requests much faster than blocking languages like PHP. It also has a thriving package ecosystem like npm that makes it easy to reuse code.
John presents several tools and techniques he uses to automate tasks and maintain consistency across systems in order to maximize his productivity while developing software. Some of the key tools and strategies he discusses include: App::MiseEnPlace for managing directory structures and symlinks; smartcd for running scripts when entering or leaving directories; building critical tools like Perl, Node.js, and Git from source instead of relying on system versions; and keeping his entire $HOME directory under revision control with GitGot. He emphasizes automating repetitive tasks, maintaining consistency across systems, and not having to think about tools or environments.
Node.js is well-suited for applications that require lightweight concurrency and asynchronous I/O. It uses an event-driven, non-blocking model that makes it efficient for real-time applications with high concurrency needs, such as chat, live data feeds, and web site monitoring dashboards. While Node.js performs well for lightweight operations, heavier CPU-intensive tasks may be better suited for Java/J2EE due to its multi-threading capabilities. The Node.js ecosystem is growing rapidly but still less mature than Java/J2EE's established ecosystem.
This document provides a complete guide to Node.js, covering installation methods, checking installation, modules, NPM, events, streams, and persisting data. It discusses installing Node.js from nodejs.org, using a version manager like NVM, or compiling from source. It also covers creating a basic web server, reading and writing files, uploading files, and using Socket.IO for real-time applications.
This document summarizes tools and techniques for open source network testing, including testing routers and Wi-Fi networks with multiple concurrent clients to evaluate performance under real-world conditions. It describes using tools like net-hydra, netburn, and whenits to automate testing across multiple client devices and collect throughput and latency statistics. The document advocates an approach of testing networks with multiple concurrent activities like downloading, browsing, VoIP calls, and streaming to evaluate how equipment handles collision domains under more challenging real-world loads.
Solving some of the scalability problems at booking.comIvan Kruglov
This document summarizes how Booking.com solved scalability issues with their Event Graphite Processor (EGP) system. The EGP processes large volumes of event data to generate metrics but was limited by high RAM usage. A new approach was developed that uses event streaming and parallelization, reducing processing time from over 120 seconds to 80 seconds while using much less RAM. This was achieved through a hackathon that rewrote 260 monitors in one day. The new system uses 56-core servers, processes events in parallel groups, and requires only 500MB of RAM compared to the previous 15GB.
A quick introduction to Python's Twisted networking library, given at a NZPUG meeting in April 2009.
Covers some of the stuff you can do with Twisted really easily, like an XMPP bot and an SSH/Telnet shell into your running applications.
This document discusses adding context support to the NATS client library. It begins with an overview of NATS and context in Go. It then describes enhancing the Subscription.NextMsg method to support context, avoiding blocking indefinitely. This allows building a RequestWithContext method for cancelling requests. The key steps are selecting on the subscription channel or context being done, and returning the context's error on cancellation. Learning from standard library patterns like validating contexts helps make the API clearer.
Introduction to performance tuning perl web applicationsPerrin Harkins
This document provides an introduction to performance tuning Perl web applications. It discusses identifying performance bottlenecks, benchmarking tools like ab and httperf to measure performance, profiling tools like Devel::NYTProf to find where time is spent, common causes of slowness like inefficient database queries and lack of caching, and approaches for improvement like query optimization, caching, and infrastructure changes. The key messages are that performance issues are best identified through measurement and profiling, database queries are often the main culprit, and caching can help but adds complexity.
This document discusses various tips and tricks for optimizing Symfony projects. It covers caching with Doctrine, using the Sentry error monitoring service, queueing emails with Swiftmailer, implementing custom voters for access control, and using process managers like PHP-PM and PHPFastCGI to improve performance by keeping the framework bootstrapped across requests. The document provides code examples and benchmarks to demonstrate how these techniques can enhance a Symfony application.
Cloud Native Night June 2019, Munich: Talk by Moritz Kammerer (Software Architect at QAware)
Join our Meetup: www.meetup.com/cloud-native-muc
Abstract: Startup-Zeiten von Containern werden bei elastischer Skalierung in der Cloud immer wichtiger – wer möchte schon 2 Minuten warten, bis eine neue Instanz des Services erscheint? Hier kann der Shooting Star von Java-basierten Microservices, Spring Boot, nicht glänzen. Systembedingt steigt die Startzeit des Containers mit der Menge der Klassen auf dem Classpath. Auch der Speicherverbrauch einer Spring Boot Anwendung ist nicht gerade gering.
Micronaut, erschaffen von den Machern des Grails-Frameworks, behauptet, diese Probleme in den Griff zu bekommen. In dem Talk sehen wir uns an, wie sich Microservices mit Micronaut entwickeln lassen und prüfen, ob es die Versprechen hält.
Bonus: Da Micronaut kaum Reflection verwendet, sollte es sich mit dem GraalVM AOT Compiler in ein natives Image kompilieren lassen. In dem Vortrag werden wir dies ausprobieren und die Performance dieses Native Images messen.
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...wallyqs
The NATS Go client is the canonical implementation of a client for the NATS Messaging System, and from the beginning it was designed for high performance. In this talk, we will cover its APIs and dissect how the client internal engine works to get the most out of Go to achieve maximum throughput.
The document summarizes a transition from a LAMP stack (Linux, Apache, MySQL, PHP) to a LNLP stack (Linux, Nginx, NoSQL, PHP-FPM). It discusses moving from Apache to Nginx as the web server for improved performance under load. It also discusses moving from MySQL to a NoSQL database like MongoDB for flexibility with data structures and large datasets. Finally, it discusses moving from mod_php to PHP-FPM to improve PHP performance and flexibility. Steps are provided to install and configure Nginx, PHP-FPM and MongoDB on Ubuntu. Benchmark results show improved request throughput and reduced response times with the new stack configuration.
Ville Lautanala describes different transport channels that allow pushing data from servers to clients in real time.
He also introduces a case study of Flowdock's experience with socket.io and WebSockets.
Presentation from Frontend Finland meetup, March 14th. A slightly modified version was presented at SFJS, April 3rd.
اِنجیناِکس (به انگلیسی: nginx) یک کارساز وب با حجم پایین و کارایی بالا است که تحت مجوز بیاسدی منتشر میشود. این کارساز وب در یونیکس، گنو/لینوکس، بیاسدی، مک او اس و ویندوز اجرا میشود. بر طبق گفتهٔ نتکرافت، در حال حاضر ۱۲.۰۷٪ از دامنههای اینترنت از این کارساز استفاده میکنند.
این پروژه در سال ۲۰۰۱ بنیان نهاده شد و توسط یک توسعهدهنده مستقل به نام ایگور سیسووف (به انگلیسی: Igor Sysoev) به مرحله اجرا درآمد تا در یکی از وبسایتهای پرترافیک به نام رامبرلر به خدمت گرفته شود که این وبسایت در تاریخ سپتامبر ۲۰۰۸، روزانه بیش از ۵۰۰ میلیون درخواست HTTP داشته است. در حال حاضر وبسایتهای سرشناسی همچون فیسبوک، نتفلیکس، وردپرس، سورسفورج و ... از انجیناکس استفاده میکنند.[۶] در نسخه ۵٫۲ اوپنبیاسده که در نوامبر ۲۰۱۲ عرضه شد هم نرمافزار انجیناکس به صورت پیشفرض در سیستم قرار داده شد تا جایگزینی باشد برای آپاچی ۱٫۳. در نهایت در سال ۲۰۱۴ آپاچی از درخت کد منبع اوپنبیاسدی حذف شد.
Communication in Python and the C10k problemJose Galarza
Talk at the Codemotion Spain 2014 about how to handle communication (polling, long polling, websockets, SSE), concurrency (processes, threads, coroutines, green threads) and the C10K problem in python
Node.js is a JavaScript runtime built on Chrome's V8 engine that allows building scalable network applications using JavaScript on the server-side. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, suitable for data-intensive real-time applications that run across distributed devices. Common uses of Node.js include building web servers, file upload clients, ad servers, chat servers, and any real-time data applications. The document provides an introduction to Node.js concepts like callbacks, blocking vs non-blocking code, the event loop, streams, events, and modules.
The document discusses using alternative infrastructures like Nginx and Redis instead of traditional Apache and MySQL. It describes building a Twitter clone called "Retwis" using Sinatra and Redis, and compares the performance of Nginx to Apache when serving static and dynamic content. Nginx generally outperforms Apache, especially for static files, due to its asynchronous and event-based architecture avoiding context switches. Load testing revealed issues with current practices for MySQL dumps and load testing that do not properly simulate high concurrency or isolate variables.
A language for the Internet: Why JavaScript and Node.js is right for Internet...Tom Croucher
Increasingly we want to do more with the web and Internet applications we build. We have more features, more data, more users, more devices and all of it needs to be in real-time. With all of these demands how can we keep up? The answer is choosing a language and a platform that are optimized for the kind of architecture Internet and web applications really have. The traditional approach prioritises computation, assigning server resources before they are actually needed. JavaScript and Node.js both take an event driven approach only assigning resources to events as they happen. This allows us to make dramatic gains in performance and resource utilization while still having an environment which is fun and easy to program.
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...Tom Croucher
Node.js allows JavaScript to be used for server-side programming. It is a popular choice because JavaScript programmers can reuse code and libraries on both the client-side and server-side. Node.js is also fast and non-blocking which allows for high concurrency levels. The Node.js ecosystem includes many libraries like Express for building web servers and Mustache.js for templating that make building server-side JavaScript applications easy.
“Node's goal is to provide an easy way to build scalable Network programs”
Asynchronous i/o framework
Core in c++ on top of v8
Rest of it in javascript
Swiss army knife for network Related stuffs
Can handle thousands of Concurrent connections with Minimal overhead (cpu/memory) on a single process
It’s NOT a web framework, and it’s also NOT a language
• Created by Ryan Dahl in 2009
• Development && maintenance sponsored by Joyent
• License MIT
• Last release : 0.10.31
• Based on Google V8 Engine
• +99 000 packages
Jeff Miccolis discusses how node.js is better than PHP/Drupal for handling asynchronous tasks like sending large numbers of emails, processing feed items, and handling big file uploads/long sessions. Node.js uses an event loop and non-blocking I/O which allows it to process requests much faster than blocking languages like PHP. It also has a thriving package ecosystem like npm that makes it easy to reuse code.
John presents several tools and techniques he uses to automate tasks and maintain consistency across systems in order to maximize his productivity while developing software. Some of the key tools and strategies he discusses include: App::MiseEnPlace for managing directory structures and symlinks; smartcd for running scripts when entering or leaving directories; building critical tools like Perl, Node.js, and Git from source instead of relying on system versions; and keeping his entire $HOME directory under revision control with GitGot. He emphasizes automating repetitive tasks, maintaining consistency across systems, and not having to think about tools or environments.
Node.js is well-suited for applications that require lightweight concurrency and asynchronous I/O. It uses an event-driven, non-blocking model that makes it efficient for real-time applications with high concurrency needs, such as chat, live data feeds, and web site monitoring dashboards. While Node.js performs well for lightweight operations, heavier CPU-intensive tasks may be better suited for Java/J2EE due to its multi-threading capabilities. The Node.js ecosystem is growing rapidly but still less mature than Java/J2EE's established ecosystem.
This document provides a complete guide to Node.js, covering installation methods, checking installation, modules, NPM, events, streams, and persisting data. It discusses installing Node.js from nodejs.org, using a version manager like NVM, or compiling from source. It also covers creating a basic web server, reading and writing files, uploading files, and using Socket.IO for real-time applications.
This document summarizes tools and techniques for open source network testing, including testing routers and Wi-Fi networks with multiple concurrent clients to evaluate performance under real-world conditions. It describes using tools like net-hydra, netburn, and whenits to automate testing across multiple client devices and collect throughput and latency statistics. The document advocates an approach of testing networks with multiple concurrent activities like downloading, browsing, VoIP calls, and streaming to evaluate how equipment handles collision domains under more challenging real-world loads.
Solving some of the scalability problems at booking.comIvan Kruglov
This document summarizes how Booking.com solved scalability issues with their Event Graphite Processor (EGP) system. The EGP processes large volumes of event data to generate metrics but was limited by high RAM usage. A new approach was developed that uses event streaming and parallelization, reducing processing time from over 120 seconds to 80 seconds while using much less RAM. This was achieved through a hackathon that rewrote 260 monitors in one day. The new system uses 56-core servers, processes events in parallel groups, and requires only 500MB of RAM compared to the previous 15GB.
A quick introduction to Python's Twisted networking library, given at a NZPUG meeting in April 2009.
Covers some of the stuff you can do with Twisted really easily, like an XMPP bot and an SSH/Telnet shell into your running applications.
This document discusses adding context support to the NATS client library. It begins with an overview of NATS and context in Go. It then describes enhancing the Subscription.NextMsg method to support context, avoiding blocking indefinitely. This allows building a RequestWithContext method for cancelling requests. The key steps are selecting on the subscription channel or context being done, and returning the context's error on cancellation. Learning from standard library patterns like validating contexts helps make the API clearer.
Introduction to performance tuning perl web applicationsPerrin Harkins
This document provides an introduction to performance tuning Perl web applications. It discusses identifying performance bottlenecks, benchmarking tools like ab and httperf to measure performance, profiling tools like Devel::NYTProf to find where time is spent, common causes of slowness like inefficient database queries and lack of caching, and approaches for improvement like query optimization, caching, and infrastructure changes. The key messages are that performance issues are best identified through measurement and profiling, database queries are often the main culprit, and caching can help but adds complexity.
This document discusses various tips and tricks for optimizing Symfony projects. It covers caching with Doctrine, using the Sentry error monitoring service, queueing emails with Swiftmailer, implementing custom voters for access control, and using process managers like PHP-PM and PHPFastCGI to improve performance by keeping the framework bootstrapped across requests. The document provides code examples and benchmarks to demonstrate how these techniques can enhance a Symfony application.
Extreme HTTP Performance Tuning: 1.2M API req/s on a 4 vCPU EC2 InstanceScyllaDB
In this talk I will walk you through the performance tuning steps that I took to serve 1.2M JSON requests per second from a 4 vCPU c5 instance, using a simple API server written in C.
At the start of the journey the server is capable of a very respectable 224k req/s with the default configuration. Along the way I made extensive use of tools like FlameGraph and bpftrace to measure, analyze, and optimize the entire stack, from the application framework, to the network driver, all the way down to the kernel.
I began this wild adventure without any prior low-level performance optimization experience; but once I started going down the performance tuning rabbit-hole, there was no turning back. Fueled by my curiosity, willingness to learn, and relentless persistence, I was able to boost performance by over 400% and reduce p99 latency by almost 80%.
Writing Networking Clients in Go - GopherCon 2017 talkNATS
Talk by Wally Quevedo at GopherCon 2017 on writing networking clients in Go, based on our experience with Go on the NATS team. The full talk is available on YouTube: https://www.youtube.com/watch?v=QoetRI2KHvc
The document summarizes lessons learned from running software on a 2000-core cluster. Key issues included:
- RabbitMQ started refusing connections when there were too many, requiring establishing a RabbitMQ cluster.
- Third-party libraries like Enyim for memcached access failed under high load and were replaced with custom code.
- Tasks were split too finely, overwhelming RabbitMQ; larger-grained tasks improved performance.
- A global event logging system ("Greg") contained bugs that slowed debugging, showing the importance of tools. Fixing issues like unbounded buffers and clock synchronization bugs improved its usefulness.
The document discusses a TCP server and client example for looking up zip codes. It provides code for a server that listens for connections on port 6000 and responds to "ZipCode" and "Quit" commands by looking up zip codes from a file and disconnecting. It also provides code for a client that connects to the server, sends zip code lookup requests, reads the responses, and disconnects. Key aspects covered include using blocking sockets, threading models in Indy servers, and how the examples can be tested using Telnet.
This document discusses Real Time applications using Node.js. It begins with an overview of Node.js and how it enables non-blocking I/O and parallel execution. Examples are given to illustrate blocking vs non-blocking I/O. The event loop model is explained as the underlying mechanism that makes Node.js asynchronous. Common use cases like APIs and real-time apps are highlighted. The presentation concludes with a proposed code along example to build a basic CRUD app with real-time capabilities.
This document discusses using Node.js in a multi-core environment through clustering. It explains that Node.js is single-threaded, so clustering allows utilizing multiple CPU cores. Approaches include single VM with multiple processes or clustering Node.js processes. Clustering involves a master process that manages worker processes to distribute load. Tests show clustering improves throughput and reduces response times compared to single-core. The cluster module simplifies clustering Node.js across CPU cores.
This document summarizes a presentation on debugging front-end performance related to TLS and HTTPS. It discusses optimizing the TLS handshake to reduce round trips, using session resumption, OCSP stapling, TLS false start, and dynamic record sizing. It also covers TLS debugging tools like istlsfastyet.com and security headers like HSTS, CSP, and HPKP. The presentation aimed to provide practical techniques and checks to improve TLS performance in practice.
Pipelining understandingPipelining is running multiple stages of .pdfarasanlethers
Pipelining understanding:
Pipelining is running multiple stages of the same process in parallel in a way that efficiently uses
all the available hardware while respecting the dependencies of each stage upon the previous
stages. In the laundry example, the stages are washing, drying, and folding. By starting a wash
stage as soon as the previous wash stage is moved to the dryer, the idle time of the washer is
minimized. Notice that the wash stage takes less time than the dry stage, so the wash stage must
remain idle until the dry stage finishes: the steady state throughput of the pipeline is limited by
the slowest stage in the pipeline. This can be mitigated by breaking up the bottleneck stage into
smaller sub-stages. For those less concerned with laundry-based examples, consider a video
game. The CPU computes the keyboard/mouse input each frame and moves the camera
accordingly, then the GPU takes that information and actually renders the scene; meanwhile, the
CPU has already begun calculating what\'s going to happen in the next frame.
How Pipelining will done:
In class, we mentioned that interpreting each computer instruction is a four step process: fetching
the instruction, decoding it and reading the register, executing it, and recording the results. Each
instruction may take 4 cycles to complete, but if our throughput is one instruction each cycle,
then we would like to perform, on average, $n$ instructions every $n$ cycles. To accomplish
this, we can split up an instruction\'s work into the 4 different steps so that other pieces of
hardware work to decode, execute, and record results while the CPU performs the fetch. The
latency to process each instruction is fixed at 4 cycles, so by processing a new instruction every
cycle, after four cycles, one instruction has been completed and three are \"in progress\" (they\'re
in the pipeline). After many cycles the steady state throughput approaches one completed
instruction every cycle.
An assembly line in a auto manufacturing plant is another good example of a pipelined process.
There are many steps in the assembly of the car, each of which is assigned a stage in the pipeline.
Typically the depth of these pipelines is very large: cars are pretty complex, so there need to be a
lot of stages in the assembly line. The more stages, the longer it takes to crank the system up to a
steady state. The larger the depth, the more costly it is to turn the system around: A branch
misprediction in an instruction pipeline would be like getting one of the steps wrong in the
assembly line: all the cars affected would have to go back to the beginning of the assembly line
and be processed again.
OnLive Example[Realtime]:
OnLive is a company that allows gamers to play video games in the cloud. The games are run on
one of the company\'s server farms, and video of the game is sent back to your computer. The
idea is that even the lamest of computers can run the most highly intensive games because all the
computer does .
Writing Serverless Application in Java with comparison of 3 approaches: AWS S...Andrew Zakordonets
This presentation is from my Meetup talks about how we were building Serverless Application using Java and Step Functions. It contains some comparison of 3 different approaches on how you can build Java with Serverless : AWS SDK, Micronaut and Spring.
Service discovery like a pro (presented at reversimX)Eran Harel
So you want to auto scale your services, and use service oriented architecture, eh?
Want to reduce the cost of managing your clusters, and discover them dynamically?
In this talk we shall see how consul helps you do that very efficiently, explain how it works, demonstrate spinning up several interconnected services, and show how we can achieve seamless discovery, HA, and fault tolerance.
Presented at SF SlackDevs Meetup on April 11, 2016
[Record of presentation]
http://www.ustream.tv/recorded/85566064 (0:26:00~)
[GitHub page of slacktee]
https://github.com/course-hero/slacktee
The detail architecture of the most relevant consumer drones will be introduced, continuing with the communications protocol between the pilot (app in the smartphone or remote controller) and the drone. Manual reverse engineering on the binary protocol used for this communication will lead to identifying and understanding all the commands from each of the drones, and later inject commands back.
Learning Objectives:
1: Understand whenever a protocol between drone and pilot is secure.
2: Learn about a new reverse engineering methodology for these protocols.
3: Review a set of good practices to secure the environment surrounding a drone.
(Source: RSA Conference USA 2018)
44CON 2014 - Switches Get Stitches, Eireann Leverett & Matt Erasmus44CON
44CON 2014 - Switches Get Stitches, Eireann Leverett & Matt Erasmus
This 2 hour workshop will introduce you to Industrial Ethernet Switches and their vulnerabilities. These are switches used in industrial environments, like substations, factories, refineries, ports, or other other homes of industrial automation equipment. In other words, scada and ICS switches. You will gain familiarity with the basic usage of these switches, and do some very light traffic analysis and firmware reverse engineering.
Not only will vulnerabilities be disclosed for the first time (exclusively at 44CON), but the methods of finding those vulnerabilities will be shared. If you have never done any reverse engineering or firmware analysis, this might be a good place to start.
You will need to be familiar with a linux commandline, and the usage of tools such as BURP and wireshark. If you are an IDA Pro wizard we welcome your attendance, but we won’t be teaching you anything new. However, we will examine firmware and device embedded webservers with tools such binwalk, strings, grep, xxd, python, scapy, and compression utilities.
All vulnerabilities taught/disclosed will be in the default configuration state of the devices. While these vulnerabilities have been responsibly disclosed to the vendors, SCADA/ICS patching in live environments tends to take 1-3 years. So this work will be fresh and useful for your penetration tests in the future.
You might even find new vulnerabilities with the chance to play with these devices (which are being brought to 44CON for this workshop)!
This document discusses techniques for achieving low latency in Java applications. It begins by defining latency as the time interval between stimulation and response. For applications, total response time equals service time plus waiting time for service. Latency requirements of less than 100ms are given as an example of low latency. The document then explores specific techniques for reducing latency, such as avoiding context switching through thread pooling, optimizing logging through asynchronous approaches, addressing DNS lookup delays, and monitoring and tuning garbage collection. Overall it provides guidance on analyzing and improving various aspects of application performance to meet strict low latency goals.
The document outlines various case studies and techniques for debugging web applications, including using tools like Performance Monitor, Process Explorer, and Message Analyzer to troubleshoot issues with high memory usage, unexplained exceptions, and failures in SSL/TLS communication. It provides examples of debugging slow or hanging services, tracking down errors only seen under heavy loads, and identifying memory leaks in .NET applications.
No Callbacks, No Threads - RailsConf 2010Ilya Grigorik
Multi-threaded servers compete for the global interpreter lock (GIL) and incur the cost of continuous context switching, potential deadlocks, or plain wasted cycles. Asynchronous servers, on the other hand, create a mess of callbacks and errbacks, complicating the code. But, what if, you could get all the benefits of asynchronous programming, while preserving the synchronous look and feel of the code – no threads, no callbacks?
maXbox Starter 42 Multiprocessing Programming Max Kleiner
The document discusses multiprocessing and multithreading programming. It begins by explaining the difference between multiprocessing and multithreading. Multiprocessing uses separate processes that are isolated from each other by the OS, while multithreading runs multiple threads within the same process. It then provides an example code showing how to launch multiple processes asynchronously on different CPU cores using the ExecuteProcess and ExecuteMultiProcessor API calls. The document continues explaining concepts like blocking vs non-blocking calls, threads, and playing sounds asynchronously vs synchronously. It provides examples of playing multiple sounds simultaneously using different approaches.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Project Management Semester Long Project - Acuityjpupo2018
Acuity is an innovative learning app designed to transform the way you engage with knowledge. Powered by AI technology, Acuity takes complex topics and distills them into concise, interactive summaries that are easy to read & understand. Whether you're exploring the depths of quantum mechanics or seeking insight into historical events, Acuity provides the key information you need without the burden of lengthy texts.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
1. Yet another Node Vs PHP+Apache
When they said Node JS , they said about performance. They said about concurrency.
They said about non-blocking I/O. I thought of giving a try to visualizing that in
comparing with other languages and see if Node is really better in some way.
I will try here to explore the 2 main features of Node that make it win in certain
scenarios.
1. Non-Blocking I/O: - In a typical application where we need to perform 3 tasks we
simple execute them this way
task1();
task2();
task3();
Now task3() will not be executed until task2() is completed and task2() may take long
time depending on its operation and so execution of task3() will be blocked. So in a
scenario where all these jobs / tasks are independent to each other and can run in
parallel, this sequential paradigm won't fit practically.
Node fits here perfectly. Node supports callbacks, that means calls are asynchronous
and non-blocking. The task2() will not block task3() or in other words "a statement in
Node will never wait for another I/O to be finished."
I created a similar scenario in Node
2. var http = require('http');
var resp = function doResp()
{
console.log("Second task executed..");
}
http.createServer(function (req, res) {
console.log("Task One exeuted.."); // This is task 1
setTimeout(resp,2000); //This is actually how callback is utilized
/* Below statements are task3*//
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end("Page content is loaded but request is yet processing task 2 in back ground...");
console.log("Task three executed..");
}).listen(9999);
The above simple node code has main 3 tasks to do as we planned.
Task one will print a message on console.
Task two is a Time consuming task takes 2 seconds and at the end it will display
message on console.
Task three writes the response to user and also displays a message on console.
This line " setTimeout(resp,2000);" is where actually callback is used. So the actual
function is being passed as parameter to setTimeout function , that means after 2000
millisecond the function doResp() will be invoked. Which is stored in a variable resp. But
the beaut is the whole statement " setTimeout(resp,2000);" gets executed immediately
and next statements start getting executed. Though in parallel sets a timer to execute
the callback function after 2 seconds, it doesn't stop next tasks.
I started the app and hit from browser, and saw on Browser screen the message "
In console I could see the below 2 messages
3. "Task One exeuted.."
"Task three executed.."
and after 2 seconds I did see the another message came up "Second task executed.."
I am happy with the Non-Blocking I/O (or to me asynchronous) of Node.
2. Concurrency: I am done with verifying nonblocking IO feature. Now I have to see
and test concurrency and an overall load test. As suggested by others I used siege for
load test simulation.
Wrote a simple Node which reads from a Mysql table and emmits JSON. Wrote another
PHP file which does the same thing.
Here to make the response content length similar , I purposefully avoided Chunked
transfer Encoding in PHP+Apache.
The table has around 53 records. I did test with few different parameters.
Complete code and database structure is available on Git link provided at the end.
Below are my complete test results. The upper ones are Node and Below are PHP
500 Concurrent users for 5 Minutes with 1 second delay
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c500 -d1 -t5M -
lnode1.log http://localhost:9615
** SIEGE 3.0.5
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 296509 hits
Availability: 100.00 %
Elapsed time: 299.75 secs
Data transferred: 830.79 MB
Response time: 0.00 secs
Transaction rate: 989.19 trans/sec
4. Throughput: 2.77 MB/sec
Concurrency: 4.20
Successful transactions: 296509
Failed transactions: 0
Longest transaction: 0.20
Shortest transaction: 0.00
FILE: node1.log
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c500 -d1 -t5M -
lnphp1.log http://localhost/loadTest/PHP/
** SIEGE 3.0.5
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 298656 hits
Availability: 100.00 %
Elapsed time: 299.92 secs
Data transferred: 836.80 MB
Response time: 0.00 secs
Transaction rate: 995.79 trans/sec
Throughput: 2.79 MB/sec
Concurrency: 2.27
Successful transactions: 298656
Failed transactions: 0
Longest transaction: 0.24
Shortest transaction: 0.00
FILE: nphp1.log
Summary : Not much difference. Concurrency is little higher and Longest transaction is
also slightly better but nothing real impressive.
500 Concurrent users for 10 minutes with 1 second delay
5. anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c500 -d1 -t10M -
lnode1.log http://localhost:9615
** SIEGE 3.0.5
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 594697 hits
Availability: 100.00 %
Elapsed time: 599.95 secs
Data transferred: 1666.28 MB
Response time: 0.00 secs
Transaction rate: 991.24 trans/sec
Throughput: 2.78 MB/sec
Concurrency: 3.84
Successful transactions: 594697
Failed transactions: 0
Longest transaction: 0.20
Shortest transaction: 0.00
FILE: node1.log
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c500 -d1 -t10M -
lnphp1.log http://localhost/loadTest/PHP/
** SIEGE 3.0.5
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 597276 hits
Availability: 100.00 %
Elapsed time: 599.97 secs
Data transferred: 1673.50 MB
Response time: 0.00 secs
Transaction rate: 995.51 trans/sec
Throughput: 2.79 MB/sec
6. Concurrency: 1.94
Successful transactions: 597276
Failed transactions: 0
Longest transaction: 0.20
Shortest transaction: 0.00
FILE: nphp1.log
Summary: Node is still better at concurrency but yet nothing so impressive so far. I am
still in love with my PHP+Apache
500 Concurrent Users for 15 minutes with 1 second delay
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c500 -d1 -t15M -
lnode1.log http://localhost:9615
** SIEGE 3.0.5
** Preparing 500 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 892874 hits
Availability: 100.00 %
Elapsed time: 899.25 secs
Data transferred: 2501.74 MB
Response time: 0.00 secs
Transaction rate: 992.91 trans/sec
Throughput: 2.78 MB/sec
Concurrency: 3.74
Successful transactions: 892874
Failed transactions: 0
Longest transaction: 0.25
Shortest transaction: 0.00
FILE: node1.log
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c500 -d1 -t15M -
7. lnphp1.log http://localhost/loadTest/PHP/
** SIEGE 3.0.5
** Preparing 500 concurrent users for battle.
The server is now under siege...
[error] socket: 1011885824 address is unavailable.: Cannot assign requested address
[error] socket: -213448960 address is unavailable.: Cannot assign requested address
[error] socket: -3631360 address is unavailable.: Cannot assign requested address
Lifting the server siege... done.
Transactions: 893948 hits
Availability: 99.96 %
Elapsed time: 899.70 secs
Data transferred: 2504.75 MB
Response time: 0.00 secs
Transaction rate: 993.61 trans/sec
Throughput: 2.78 MB/sec
Concurrency: 2.25
Successful transactions: 893948
Failed transactions: 335
Longest transaction: 1.01
Shortest transaction: 0.00
FILE: nphp1.log
Summary: PHP breaks for these long running large number of concurrent
requests.Server stopped creating threads when it created enough before max outing
server's RAM. But node is standing straight here. Node looks even steady in terms of
the parameters.
1K Concurrent users for 10 minutes with 1 Second delay
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c1000 -d1 -t10M
-lnode1.log http://localhost:9615
** SIEGE 3.0.5
** Preparing 1000 concurrent users for battle.
8. The server is now under siege...
Lifting the server siege... done.
Transactions: 862079 hits
Availability: 100.00 %
Elapsed time: 599.92 secs
Data transferred: 2415.46 MB
Response time: 0.20 secs
Transaction rate: 1436.99 trans/sec
Throughput: 4.03 MB/sec
Concurrency: 281.62
Successful transactions: 862079
Failed transactions: 0
Longest transaction: 0.55
Shortest transaction: 0.00
FILE: node1.log
anirbanb2004@Anisoft-Corporation:~/www/loadTest/siegeLog$ siege -c1000 -d1 -t10M
-lnphp1.log http://localhost/loadTest/PHP/
** SIEGE 3.0.5
** Preparing 1000 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 1193412 hits
Availability: 100.00 %
Elapsed time: 599.82 secs
Data transferred: 3343.82 MB
Response time: 0.00 secs
Transaction rate: 1989.62 trans/sec
Throughput: 5.57 MB/sec
Concurrency: 5.58
Successful transactions: 1193412
Failed transactions: 0
9. Longest transaction: 0.54
Shortest transaction: 0.00
FILE: nphp1.log
Summary: This shows the real advantage of node in terms of concurrency. See here
with increase in number of concurrent users how the concurrency level increased for
Node(281.62) where as for PHP+Apache it is 5.58 still.
Conclusion: So I am convinced from the above test that Node is good at when high
very high concurrency is demanded. Also saw in first part that the nonblocking IO gives
Node an edge for event based application.
At the same time realized that until unless a real huge concurrency is required no need
for Node. The cost at-least at this moment will be higher for the below reason
1. Getting Node experienced people or training your developer to Pro level is
costlier
2. PHP+Apache stack will consume more swap memory (RAM) when
concurrency is more, but Node will be expensive on Processor (CPU) when
performing CPU intensive jobs. Scaling up a server is cheaper when only dealing
with memory or RAM (obviously within thresold) but if we need processor upgrade
(on physical servers) that will be real tough and expensive job.
3. If you are not owning dedicated server hosting Node on cloud is costlier
than any other options
Someone in some forum wrote " You no need to bother and think about the concurrency
of Node until you are managing sites like Google,Facebook or Amazon.
So it is upto Webmasters , depending on their load and traffic and also budget what
they want to use and implement.
GIT link for source codes and Database table
Complete discussion on Node JS forum during this whole test
*Please note:i used mysql_() functions for ease of writing instead of using pdo or
mysqli_() functions.