This document provides an overview of PHP memory usage and management. It introduces key concepts like the Zend Memory Manager (ZendMM), which handles memory allocation and freeing for each PHP request. The document demonstrates how to monitor memory usage from PHP using functions like memory_get_usage() and from the OS perspective using /proc. It also discusses potential memory issues like references and circular references, and how to track reference counts. The goal is to help understand and optimize PHP memory consumption.
Arrays allow storing multiple values in a single variable. There are indexed arrays which use numeric indices and associative arrays which use named keys. Arrays can be defined using the array() function or by directly assigning values. Arrays can be looped through using foreach loops or functions like sizeof() to get the size. Multidimensional arrays store arrays within other arrays.
The document provides an introduction and overview of PHP including:
- PHP is a widely-used open source scripting language especially for web development.
- It was created by Rasmus Lerdorf in 1995 and is free to use.
- PHP typically runs on web servers and is installed on over 20 million websites.
- Features include being free, easy to learn, supporting databases and object-oriented programming.
- Common tools for PHP development include XAMPP, Notepad++, and Eclipse IDE.
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Amazon Web Services
Your AMI is one of the core foundations for running applications and services effectively on Amazon EC2. In this session, you'll learn how to optimize your AMI, including how you can measure and diagnose system performance and tune parameters for improved CPU and network performance. We'll cover application-specific examples from Netflix on how optimized AMIs can lead to improved performance.
HTML structures web documents and defines the semantics, or meaning, of content. CSS handles presentation and styling. HTML uses tags to define headings, paragraphs, lists, links and other content. CSS allows styling of elements using selectors, properties and values. External CSS files allow separation of concerns and reuse of styles across pages.
The document discusses various control structures in PHP including if/else statements, loops (while, do/while, for, foreach), and jumping in and out of PHP mode. It provides examples of how to use each control structure and also discusses adding comments to PHP scripts.
Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of HTML and XML documents. CSS separates document content from document presentation, enabling control over elements like layout, colors, and fonts. This separation improves accessibility, flexibility, and maintenance of web pages. CSS can format pages for different rendering methods like on-screen, in print, and for speech-based browsers.
The document provides an introduction to PHP basics including:
- PHP code is embedded in HTML using tags and the server executes the PHP code and substitutes output into the HTML page.
- PHP supports variables, data types, operators, control structures like if/else statements and loops. Useful built-in functions allow working with forms, cookies, files, time and date.
- Server-side programming alternatives like CGI, ASP, Java Servlets, and PHP are discussed. PHP was created in 1995 and is now widely used as a free, open-source scripting language for server-side web development.
This document provides an overview of cookies and sessions. It defines cookies as small text files stored on a user's computer that contain information about a website visit. Sessions are a combination of a server-side cookie containing a unique session token and client-side cookie. The document discusses setting, retrieving, and deleting cookies using JavaScript, as well as the advantages of storing session data on the server rather than in client-side cookies.
Arrays allow storing multiple values in a single variable. There are indexed arrays which use numeric indices and associative arrays which use named keys. Arrays can be defined using the array() function or by directly assigning values. Arrays can be looped through using foreach loops or functions like sizeof() to get the size. Multidimensional arrays store arrays within other arrays.
The document provides an introduction and overview of PHP including:
- PHP is a widely-used open source scripting language especially for web development.
- It was created by Rasmus Lerdorf in 1995 and is free to use.
- PHP typically runs on web servers and is installed on over 20 million websites.
- Features include being free, easy to learn, supporting databases and object-oriented programming.
- Common tools for PHP development include XAMPP, Notepad++, and Eclipse IDE.
Your Linux AMI: Optimization and Performance (CPN302) | AWS re:Invent 2013Amazon Web Services
Your AMI is one of the core foundations for running applications and services effectively on Amazon EC2. In this session, you'll learn how to optimize your AMI, including how you can measure and diagnose system performance and tune parameters for improved CPU and network performance. We'll cover application-specific examples from Netflix on how optimized AMIs can lead to improved performance.
HTML structures web documents and defines the semantics, or meaning, of content. CSS handles presentation and styling. HTML uses tags to define headings, paragraphs, lists, links and other content. CSS allows styling of elements using selectors, properties and values. External CSS files allow separation of concerns and reuse of styles across pages.
The document discusses various control structures in PHP including if/else statements, loops (while, do/while, for, foreach), and jumping in and out of PHP mode. It provides examples of how to use each control structure and also discusses adding comments to PHP scripts.
Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation of HTML and XML documents. CSS separates document content from document presentation, enabling control over elements like layout, colors, and fonts. This separation improves accessibility, flexibility, and maintenance of web pages. CSS can format pages for different rendering methods like on-screen, in print, and for speech-based browsers.
The document provides an introduction to PHP basics including:
- PHP code is embedded in HTML using tags and the server executes the PHP code and substitutes output into the HTML page.
- PHP supports variables, data types, operators, control structures like if/else statements and loops. Useful built-in functions allow working with forms, cookies, files, time and date.
- Server-side programming alternatives like CGI, ASP, Java Servlets, and PHP are discussed. PHP was created in 1995 and is now widely used as a free, open-source scripting language for server-side web development.
This document provides an overview of cookies and sessions. It defines cookies as small text files stored on a user's computer that contain information about a website visit. Sessions are a combination of a server-side cookie containing a unique session token and client-side cookie. The document discusses setting, retrieving, and deleting cookies using JavaScript, as well as the advantages of storing session data on the server rather than in client-side cookies.
PHP is a server-side scripting language used to create dynamic web pages. It allows embedding PHP code within HTML pages and interacting with databases. Key elements of PHP include variables, control structures, functions, and sessions. Sessions store user data on the server instead of the client to avoid cookies and allow tracking users across multiple pages.
A brief overview of caching mechanisms in a web application. Taking a look at the different layers of caching and how to utilize them in a PHP code base. We also compare Redis and MemCached discussing their advantages and disadvantages.
An ASP object is something that typically has methods, properties, and collections. The main ASP objects are the Request, Response, Session, Server, and Application objects. The Request object collects data sent from the client to the server, including form data and query strings. Form data is collected using either the GET method, where data is appended to the URL, or the POST method, where data is sent as a separate bit stream. The Request.Form collection retrieves values of form elements submitted via a POST request. It can be used to display captured form values on subsequent pages.
The document discusses the Lightweight Directory Access Protocol (LDAP) which provides a method for accessing and updating directory services based on the X.500 model. It describes LDAP's lightweight alternative approach compared to X.500, how information is structured and named in an LDAP directory, the functional operations that can be performed, security considerations, and how the protocol is encoded for transmission.
Cascading Style Sheets (CSS) is used to separate a document's semantics from its presentation. CSS allows content to be displayed differently on different devices. CSS rules consist of selectors and declarations blocks. The CSS box model represents elements as boxes that can be sized and positioned with properties like width, height, padding, borders, and margins. CSS handles conflicts between rules through specificity, source order, and inheritance to determine which styles get applied.
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItNikhil Mittal
The talk I gave at Black Hat USA 2016 on Anti Malware Scan Interface. The talk looks at what good AMSI brings to Windows 10 and various methods of avoiding/bypassing it.
This document provides an introduction to PHP, including:
- What scripting languages and PHP are, and how PHP works as a server-side scripting language
- The history and origins of PHP
- How to set up a PHP development environment using XAMPP
- PHP programming fundamentals like syntax, operators, and control structures
- How to handle forms and files in PHP
- How to connect to and manipulate databases like MySQL from PHP
- Several tasks as examples of working with forms, files, and databases in PHP
Apache is an open source web server that is very popular, secure, fast, and reliable. It implements many features including CGI, SSL, virtual domains, and plug-in modules for extensibility. Apache uses simple text configuration files like httpd.conf to configure settings and is run from the command line using scripts like apachectl to start, stop, and restart the server.
This document provides an overview of PHP and MySQL. It defines PHP as a server-side scripting language that is commonly used with MySQL, an open-source database management system. The document discusses key PHP concepts like PHP files, variables, operators, conditional statements, arrays, loops, and functions. It also covers form handling in HTML and PHP. The intended audience is users looking to learn the basics of PHP and how it integrates with MySQL for database management.
The document discusses PHP, an open-source scripting language commonly used for web development. It can be embedded into HTML pages and is used to dynamically generate webpage content. PHP code is executed on the server and generates HTML that is sent to the browser. The document also discusses using XAMPP, a free and open-source cross-platform web server solution stack, to install and run PHP, MySQL, and Apache on your local computer for testing websites.
XAMPP is a free and open source cross-platform web server package that consists of Apache HTTP Server, MySQL database, and interpreters for PHP and Perl scripts. It allows users to set up a local development environment for web development. XAMPP stands for Cross-platform (X), Apache HTTP Server, MySQL, PHP, and Perl. It provides a simple way for users, especially beginners, to start developing and testing websites locally without needing to install separate programs.
This document discusses connecting to and interacting with MySQL databases from PHP. It covers connecting to a MySQL database server, selecting databases, executing SQL statements, working with query results, and inserting, updating and deleting records. Functions covered include mysql_connect(), mysql_query(), mysql_fetch_row(), mysql_affected_rows(), and mysql_info(). The document provides examples of connecting to MySQL, selecting databases, executing queries, and accessing and manipulating data.
The document provides an overview of caching in ASP.NET, including output caching, fragment caching, and data caching. It discusses using the @OutputCache directive and Cache object to cache page output. Fragment caching allows caching regions of a page defined by user controls. Data caching stores application data in memory for faster retrieval. It also covers cache dependencies, scavenging, and callbacks to automatically remove cached items.
This document provides an introduction to HTML (Hypertext Markup Language) and describes some basic HTML tags and elements. It discusses how to structure an HTML document using tags like <html>, <head>, <title>, and <body>. It also covers text formatting tags, headings, paragraphs, hyperlinks, images, and more. The document contains examples of HTML code and the rendered output to demonstrate how various tags are used.
How to Avoid the Top 5 NGINX Configuration MistakesNGINX, Inc.
When helping NGINX users, we see the same configuration mistakes over and over again. Occasionally, these configurations are even written by fellow NGINX engineers!
Some misconfigurations are worse than others. Minor mistakes might just hurt NGINX performance a bit, but others can introduce serious security vulnerabilities. Not only can those mistakes result in data loss, they have the potential to snowball into countless other negative side effects: data breaches, loss of reputation, and ex‑customers.
In this webinar, we explore five of the most prevalent NGINX misconfigurations. Learn how to detect them and – most importantly – how to avoid and correct them.
This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.
PHP works through a multi-step lifecycle process when handling web requests. It includes:
1. Parsing, compilation, and scanning of PHP code when the web server starts.
2. When a request is made, PHP initializes extensions and populates variables through each extension's MINIT and RINIT methods.
3. PHP executes the requested page's code.
4. After page execution, PHP performs cleanup by calling each extension's RSHUTDOWN method and unseting variables.
5. PHP finally shuts down by calling each extension's MSHUTDOWN method to unregister handlers and free memory.
PHP may seem to be a very easy language but many of don't know how PHP works. We will discuss the less known facts about PHP and we will also cover some common type of software design patterns used with PHP
PHP is a server-side scripting language used to create dynamic web pages. It allows embedding PHP code within HTML pages and interacting with databases. Key elements of PHP include variables, control structures, functions, and sessions. Sessions store user data on the server instead of the client to avoid cookies and allow tracking users across multiple pages.
A brief overview of caching mechanisms in a web application. Taking a look at the different layers of caching and how to utilize them in a PHP code base. We also compare Redis and MemCached discussing their advantages and disadvantages.
An ASP object is something that typically has methods, properties, and collections. The main ASP objects are the Request, Response, Session, Server, and Application objects. The Request object collects data sent from the client to the server, including form data and query strings. Form data is collected using either the GET method, where data is appended to the URL, or the POST method, where data is sent as a separate bit stream. The Request.Form collection retrieves values of form elements submitted via a POST request. It can be used to display captured form values on subsequent pages.
The document discusses the Lightweight Directory Access Protocol (LDAP) which provides a method for accessing and updating directory services based on the X.500 model. It describes LDAP's lightweight alternative approach compared to X.500, how information is structured and named in an LDAP directory, the functional operations that can be performed, security considerations, and how the protocol is encoded for transmission.
Cascading Style Sheets (CSS) is used to separate a document's semantics from its presentation. CSS allows content to be displayed differently on different devices. CSS rules consist of selectors and declarations blocks. The CSS box model represents elements as boxes that can be sized and positioned with properties like width, height, padding, borders, and margins. CSS handles conflicts between rules through specificity, source order, and inheritance to determine which styles get applied.
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItNikhil Mittal
The talk I gave at Black Hat USA 2016 on Anti Malware Scan Interface. The talk looks at what good AMSI brings to Windows 10 and various methods of avoiding/bypassing it.
This document provides an introduction to PHP, including:
- What scripting languages and PHP are, and how PHP works as a server-side scripting language
- The history and origins of PHP
- How to set up a PHP development environment using XAMPP
- PHP programming fundamentals like syntax, operators, and control structures
- How to handle forms and files in PHP
- How to connect to and manipulate databases like MySQL from PHP
- Several tasks as examples of working with forms, files, and databases in PHP
Apache is an open source web server that is very popular, secure, fast, and reliable. It implements many features including CGI, SSL, virtual domains, and plug-in modules for extensibility. Apache uses simple text configuration files like httpd.conf to configure settings and is run from the command line using scripts like apachectl to start, stop, and restart the server.
This document provides an overview of PHP and MySQL. It defines PHP as a server-side scripting language that is commonly used with MySQL, an open-source database management system. The document discusses key PHP concepts like PHP files, variables, operators, conditional statements, arrays, loops, and functions. It also covers form handling in HTML and PHP. The intended audience is users looking to learn the basics of PHP and how it integrates with MySQL for database management.
The document discusses PHP, an open-source scripting language commonly used for web development. It can be embedded into HTML pages and is used to dynamically generate webpage content. PHP code is executed on the server and generates HTML that is sent to the browser. The document also discusses using XAMPP, a free and open-source cross-platform web server solution stack, to install and run PHP, MySQL, and Apache on your local computer for testing websites.
XAMPP is a free and open source cross-platform web server package that consists of Apache HTTP Server, MySQL database, and interpreters for PHP and Perl scripts. It allows users to set up a local development environment for web development. XAMPP stands for Cross-platform (X), Apache HTTP Server, MySQL, PHP, and Perl. It provides a simple way for users, especially beginners, to start developing and testing websites locally without needing to install separate programs.
This document discusses connecting to and interacting with MySQL databases from PHP. It covers connecting to a MySQL database server, selecting databases, executing SQL statements, working with query results, and inserting, updating and deleting records. Functions covered include mysql_connect(), mysql_query(), mysql_fetch_row(), mysql_affected_rows(), and mysql_info(). The document provides examples of connecting to MySQL, selecting databases, executing queries, and accessing and manipulating data.
The document provides an overview of caching in ASP.NET, including output caching, fragment caching, and data caching. It discusses using the @OutputCache directive and Cache object to cache page output. Fragment caching allows caching regions of a page defined by user controls. Data caching stores application data in memory for faster retrieval. It also covers cache dependencies, scavenging, and callbacks to automatically remove cached items.
This document provides an introduction to HTML (Hypertext Markup Language) and describes some basic HTML tags and elements. It discusses how to structure an HTML document using tags like <html>, <head>, <title>, and <body>. It also covers text formatting tags, headings, paragraphs, hyperlinks, images, and more. The document contains examples of HTML code and the rendered output to demonstrate how various tags are used.
How to Avoid the Top 5 NGINX Configuration MistakesNGINX, Inc.
When helping NGINX users, we see the same configuration mistakes over and over again. Occasionally, these configurations are even written by fellow NGINX engineers!
Some misconfigurations are worse than others. Minor mistakes might just hurt NGINX performance a bit, but others can introduce serious security vulnerabilities. Not only can those mistakes result in data loss, they have the potential to snowball into countless other negative side effects: data breaches, loss of reputation, and ex‑customers.
In this webinar, we explore five of the most prevalent NGINX misconfigurations. Learn how to detect them and – most importantly – how to avoid and correct them.
This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.
PHP works through a multi-step lifecycle process when handling web requests. It includes:
1. Parsing, compilation, and scanning of PHP code when the web server starts.
2. When a request is made, PHP initializes extensions and populates variables through each extension's MINIT and RINIT methods.
3. PHP executes the requested page's code.
4. After page execution, PHP performs cleanup by calling each extension's RSHUTDOWN method and unseting variables.
5. PHP finally shuts down by calling each extension's MSHUTDOWN method to unregister handlers and free memory.
PHP may seem to be a very easy language but many of don't know how PHP works. We will discuss the less known facts about PHP and we will also cover some common type of software design patterns used with PHP
The document summarizes the PHP lifecycle when used with Apache. It describes the request process from the client request, Apache parsing the request and handling it, to PHP parsing, compiling and executing the script. It provides code examples from key points in the PHP parsing and execution process within the Zend engine. Sample requests are outlined from client to server processing and the PHP opcodes and execution.
PHP is one of the most popular open source programming languages in the world. It powers some of the highest traffic sites in the world, and at the same time it powers some of the lowest traffic sites in the world. But have you ever wondered how it works under the hood? Have you been overwelmed by the thought of looking at the C code that runs PHP? Well, this talk is for you!
We're going to explore how PHP works under the hood, by looking at a PHP implementation of it: PHPPHP! Have you ever wondered what an OPCODE Cache is really doing? Have you ever wondered what a T_PAAMAYIM_NEKUDOTAYIM is? Have you ever wondered why an interpreted languages has a compiler? We'll explore all of these topics, and more! And the best part of it all? You don't need to know C to understand the details! Using PHPPHP, we can explore the language details in a high level language, where things like memory management don't get in the way of the real content. If you've ever wanted to know how PHP works, this is the talk for you!
PHP 7 provides major improvements to PHP's internals including full 64-bit support, a new optimized memory management system, and redesigned structures and execution engine. These changes make PHP 7 at least twice as fast and half as memory intensive as PHP 5.6 based on benchmarks. The improvements are due to optimizations that reduce CPU cache misses and improve data locality. PHP 7 is now ready for production use.
ارائه «گزارشی از برنامهنویسی موازی در پیاچپی» در اولین همایش پیاچپی ایران
برای کسب اطلاعات بیشتر و یا سوالی در زمینه این اسلاید میتوانید به آدرس زیر مراجعه کنید.
http://goo.gl/C9pYi8
The document discusses building custom PHP extensions. It covers setting up a development environment, creating extension skeletons using automated tools, building and installing extensions, and key extension internals like implementing and exposing C functions and PHP parameter parsing. The talk provides an example of a URI template extension the speaker created, explaining what it does, how to use it, and why extensions are important. It also discusses PHP_FUNCTION macro expansion, available parameter types for functions, and how to return values from extensions.
This document discusses extending PHP with custom extensions. It provides an overview of PHP internals like zvals, hash tables, and classes. It then walks through the steps to create a basic PHP extension, including file structure, build scripts, and implementing an initial function that outputs a string. The document also demonstrates adding integer and array arguments to extension functions. It recommends resources for learning more about PHP internals and extension development.
The document discusses PHP objects internally. It covers how objects are represented as zvals and stored in an object store. Objects use a unique handle to reference their data in the store. Creating a new object only happens through new or clone, which add it to the store. Objects are not duplicated even if the zval is duplicated. The garbage collector helps free circular references. Object handlers define object behaviors, and can be overridden to customize objects.
ارائه «استفاده از شبکه عصبی مصنوعی» در همایش کدرکانف - مرداد ۱۳۹۵
در این ارائه ابتدا در زمینه یادگیری ماشین توضیحاتی ارائه داده شد و در ادامه راجعبه شیوه کارکرد الگوریتم صحبت شد. در این ارائه سعی شد بدون توجه به زبان برنامهنویسی خاص تنها مقدمات استفاده از این الگوریتم شرح داده شود
در صورت علاقه به این مبحث میتوانید مقاله منتشر شده در همایش را از آدرس زیر دریافت کنید.
(آدرس به زودی معرفی میشود)
A talk I gave at WordCamp Sofa 2016 on measuring and optimizing memory usage, dealing with memory related errors, as well as monitoring server memory health.
This document contains notes from a PHP extensions workshop. It introduces Julien Pauli, the workshop presenter, and outlines what attendees should bring and know, such as C skills and a Linux environment. The document then covers various topics around PHP extensions, including compiling PHP with debugging, creating an extension skeleton, extension APIs and versions, memory management using Zend Memory Manager, and working with zvals (PHP variables). Attendees will learn how to create, build, and load their first PHP extension.
The document discusses the internals of how PHP compiles and executes code. It covers the main stages of lexical analysis, syntax analysis, bytecode generation, and bytecode execution. Lexical analysis scans code and turns it into tokens. Syntax analysis parses tokens to determine structure. Bytecode is generated based on the analyzed code. This bytecode is then executed by the Zend engine.
PHP 7, 8, HHVM and other implementations and compilers like QB and Zephir provide major performance improvements and new features to PHP. PHP 7 focused on speed increases through a reworked engine and true 64-bit support. PHP 8 adds a JIT compiler for additional gains. Alternative implementations like HHVM, QB and Zephir use compilation and optimization to provide native execution speeds. Future areas of focus include extending PHP using PHP itself, and integrating other languages for extensions.
Mysqlnd, an unknown powerful PHP extensionjulien pauli
The document discusses mysqlnd, a PHP extension that replaces libmysql. Mysqlnd provides significant memory savings when processing result sets by avoiding duplicating result data in memory. It also includes detailed statistics collection and an extensible plugin architecture. Mysqlnd is now the default MySQL connector used by PHP.
This document discusses various strategies for optimizing MySQL performance, including:
1. Using partitioning, indexes, and caching to improve query performance. Functional and multi-level partitioning techniques are described.
2. Denormalizing data, adding columns, and flagging rows to reduce the number of joins and optimize for read-heavy workloads.
3. Monitoring tools like the slow query log, server status, and InnoTOP are recommended for identifying bottlenecks and tracking improvements over time. Testing and an iterative process of addressing the biggest problems is advised.
The document discusses monitoring tools Nagios and Sensu. It notes several limitations with Nagios, including a lack of active-active clustering and needing to restart after adding hosts. Sensu is presented as an alternative that supports active-active clustering, automatic host registration, distributing check execution across clients, and easier configuration using JSON files. The document provides an overview of Sensu's architecture, modes of operation, handlers, mutators, extensions, and some remaining limitations.
PHP & Performance document discusses various techniques to improve PHP and web server performance. Some key points:
- Compilation of PHP scripts can consume significant time, opcode caches like APC reduce this.
- Profiling tools like APD and XDebug help identify bottlenecks in PHP code. Optimizations like output buffering, reducing output, content compression and database tuning can improve performance.
- Server configuration like Apache optimizations for file I/O, syscalls and KeepAlive headers also impact performance. PHP settings like disabling register_globals and using opcaches help.
- Application techniques like avoiding unnecessary functions, using class constants, and reducing regex usage in PHP code provide performance benefits.
This document provides an overview and introduction to PHP extensions. It discusses compiling PHP with debugging enabled, creating a basic extension skeleton, configuring and installing extensions, and activating extensions. It also covers extension lifetime, PHP memory management using the Zend Memory Manager, PHP variables called zvals which are containers for data, and zval types. The document is intended to provide attendees with the necessary background knowledge to participate in a workshop about PHP extensions.
Here are some ways to optimize the code:
1. Use strtr() instead of preg_replace() since it avoids the overhead of regular expressions.
2. Define the replacement array outside the loop to avoid redefining it on each iteration.
3. Use direct string concatenation instead of sprintf() for better performance.
4. Avoid function calls inside the loop like sizeof(). Define the length before the loop for better performance.
5. Consider using string replacement/manipulation functions like str_replace() instead of redefining/reconcatenating strings on each loop iteration.
So in summary, the optimized code would be:
$rep = ['-' => '*', '.' => '*
Linux memory consumption - Why memory utilities show a little amount of free RAM? How does Linux kernel utilizes free RAM? What is the real amount of free RAM in the system?
Advanced caching techniques with ehcache, big memory, terracotta, and coldfusionColdFusionConference
Rob Brooks-Bilson is a senior director at Amkor Technology who has been involved with ColdFusion for 18 years. He is the author of two books on ColdFusion programming and an Adobe Community Professional for ColdFusion. The document outlines his agenda for a presentation on caching in ColdFusion, which will cover caching tags and functions, Ehcache, replicating caches, BigMemory Go, and distributed caching with Terracotta. It provides legal disclaimers about the third-party applications discussed and their lack of official Adobe support.
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
This presentation discusses using Terracotta Ehcache to scale ColdFusion applications. It covers caching basics and options like on-heap, off-heap, and distributed caching. Attendees will learn how to configure Ehcache and Terracotta to enable distributed caching for ColdFusion to improve performance and scalability. Real-world customer examples are provided that demonstrate how Terracotta Ehcache helped online payment processors detect fraud faster and assisted Healthcare.gov in reducing response times.
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Shailendra Prasad
1. How to scale – options (pros and cons)
2. Caching basics (various options available)
3. Recent updates of Open source Ehcache project.
4. Scaling your existing application with Ehcache, Terracotta OSS
5. Advance caching techniques for scaling using Terracotta BigMemory
6. Customer use cases where caching was mission critical
Magento is an open-source e-commerce platform built on PHP. The document discusses various ways to optimize and scale a Magento application, including:
- Optimizing server settings like PHP-FPM, Nginx, Redis, and MySQL configurations
- Ensuring the Magento application code is clean and optimized before scaling
- Having a rigorous development process in place including continuous integration, testing, code reviews, and documentation
Let's look at ways how to make PHP applications remember what your user did on the last web page.
The first half will be about the classic PHP sessions, what the SessionHandlerInterface is about and why all of it's methods are important for a successful alternative implementation.
The second half will explore alternatives to the problems created using PHP sessions, including alternatives to sessions: Splitting the problem on the server or moving the data to the client.
Simics is a full system simulation platform that allows users to simulate an entire machine at the instruction level. It provides a controlled and deterministic virtual environment to model CPUs, memory systems, and other hardware components. Simics can be used for operating system development, debugging, performance analysis, and computer architecture research by allowing users to run real applications and inspect system behavior.
This document discusses strategies for making Ruby on Rails applications highly available. It covers common architectures using a single server, and moving to distributed systems. Key topics include application modularity, useful gems for asynchronous processing, database replication, session management, application deployment, configuration management, and load balancing. The conclusion emphasizes that porting Rails apps to a highly available environment requires thinking about architecture and distribution early, but is not prohibitively difficult if approached methodically.
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
The document discusses using caching and tuning techniques to improve scalability for websites. It covers caching full pages, parts of pages, SQL queries, and complex processing results. Memcache is presented as a fast and distributed caching solution. The document also discusses installing and using Memcache, as well as replacing Apache with Nginx as a lighter-weight web server that can serve static files and forward dynamic requests.
Memory management best practices in Android include using the sparse array family for collections below 1,000 items, avoiding unnecessary object creation, using StringBuilder for string concatenation, properly closing streams to prevent memory leaks, and using patterns like object pools and flyweights to reduce memory usage. The onTrimMemory callback and memory monitoring tools like Memory Monitor and Heap Viewer can help detect memory issues and leaks in an Android application.
Built-in query caching for all PHP MySQL extensions/APIsUlf Wendel
Query caching boosts the performance of PHP MySQL applications. Caching can be done on the database server or at the web clients. A new mysqlnd plugin adds query caching to all PHP MySQL extension: written in C, immediately usable with any PHP application because of no API changes, supports Memcache, APC, SQLite and main memory storage, integrates itself smoothless into existing PHP deployment infrastructure, helps you to scale by client, ... Enjoy!
Caching and tuning fun for high scalabilityWim Godden
Caching has been a 'hot' topic for a few years. But caching takes more than merely taking data and putting it in a cache : the right caching techniques can improve performance and reduce load significantly. But we'll also look at some major pitfalls, showing that caching the wrong way can bring down your site.
If you're looking for a clear explanation about various caching techniques and tools like Memcached, Nginx and Varnish, as well as ways to deploy them in an efficient way, this talk is for you.
ECECS 472572 Final Exam ProjectRemember to check the errata EvonCanales257
ECE/CS 472/572 Final Exam Project
Remember to check the errata section (at the very bottom of the page) for updates.
Your submission should be comprised of two items: a .pdf file containing your written report and a .tar file containing a directory structure with your C or C++ source code. Your grade will be reduced if you do not follow the submission instructions.
All written reports (for both 472 and 572 students) must be composed in MS Word, LaTeX, or some other word processor and submitted as a PDF file.
Please take the time to read this entire document. If you have questions there is a high likelihood that another section of the document provides answers.
Introduction
In this final project you will implement a cache simulator. Your simulator will be configurable and will be able to handle caches with varying capacities, block sizes, levels of associativity, replacement policies, and write policies. The simulator will operate on trace files that indicate memory access properties. All input files to your simulator will follow a specific structure so that you can parse the contents and use the information to set the properties of your simulator.
After execution is finished, your simulator will generate an output file containing information on the number of cache misses, hits, and miss evictions (i.e. the number of block replacements). In addition, the file will also record the total number of (simulated) clock cycles used during the situation. Lastly, the file will indicate how many read and write operations were requested by the CPU.
It is important to note that your simulator is required to make several significant assumptions for the sake of simplicity.
1. You do not have to simulate the actual data contents. We simply pretend that we copied data from main memory and keep track of the hypothetical time that would have elapsed.
2. Accessing a sub-portion of a cache block takes the exact same time as it would require to access the entire block. Imagine that you are working with a cache that uses a 32 byte block size and has an access time of 15 clock cycles. Reading a 32 byte block from this cache will require 15 clock cycles. However, the same amount of time is required to read 1 byte from the cache.
3. In this project assume that main memory RAM is always accessed in units of 8 bytes (i.e. 64 bits at a time).
When accessing main memory, it's expensive to access the first unit. However, DDR memory typically includes buffering which means that the RAM can provide access to the successive memory (in 8 byte chunks) with minimal overhead. In this project we assume an overhead of 1 additional clock cycle per contiguous unit.
For example, suppose that it costs 255 clock cycles to access the first unit from main memory. Based on our assumption, it would only cost 257 clock cycles to access 24 bytes of memory.
4. Assume that all caches utilize a "fetch-on-write" scheme if a miss occurs on a Store operation. This means that you must always fetch ...
ECECS 472572 Final Exam ProjectRemember to check the errat.docxtidwellveronique
ECE/CS 472/572 Final Exam Project
Remember to check the errata section (at the very bottom of the page) for updates.
Your submission should be comprised of two items:
a
.pdf
file containing your written report and a
.tar
file containing a directory structure with your C or C++ source code. Your grade will be reduced if you do not follow the submission instructions.
All written reports (for both 472 and 572 students) must be composed in MS Word, LaTeX, or some other word processor and submitted as a PDF file.
Please take the time to read this entire document. If you have questions there is a high likelihood that another section of the document provides answers.
Introduction
In this final project you will implement a cache simulator. Your simulator will be configurable and will be able to handle caches with varying capacities, block sizes, levels of associativity, replacement policies, and write policies. The simulator will operate on trace files that indicate memory access properties. All input files to your simulator will follow a specific structure so that you can parse the contents and use the information to set the properties of your simulator.
After execution is finished, your simulator will generate an output file containing information on the number of cache misses, hits, and miss evictions (i.e. the number of block replacements). In addition, the file will also record the total number of (simulated) clock cycles used during the situation. Lastly, the file will indicate how many read and write operations were requested by the CPU.
It is important to note that your simulator is required to make several significant assumptions for the sake of simplicity.
1. You do not have to simulate the actual data contents. We simply pretend that we copied data from main memory and keep track of the hypothetical time that would have elapsed.
2. Accessing a sub-portion of a cache block takes the exact same time as it would require to access the entire block. Imagine that you are working with a cache that uses a 32 byte block size and has an access time of 15 clock cycles. Reading a 32 byte block from this cache will require 15 clock cycles. However, the same amount of time is required to read 1 byte from the cache.
3. In this project assume that main memory RAM is always accessed in units of 8 bytes (i.e. 64 bits at a time).
When accessing main memory, it's expensive to access the first unit. However, DDR memory typically includes buffering which means that the RAM can provide access to the successive memory (in 8 byte chunks) with minimal overhead. In this project we assume an
overhead of 1 additional clock cycle per contiguous unit
.
For example, suppose that it costs 255 clock cycles to access the first unit from main memory. Based on our assumption, it would only cost 257 clock cycles to access 24 bytes of memory.
4. Assume that all caches utilize a "fetch-on-write" scheme if a miss occurs on a Store operation. This means that .
ECECS 472572 Final Exam ProjectRemember to check the err.docxtidwellveronique
ECE/CS 472/572 Final Exam Project
Remember to check the errata section (at the very bottom of the page) for updates.
Your submission should be comprised of two items:
a
.pdf
file containing your written report and a
.tar
file containing a directory structure with your C or C++ source code. Your grade will be reduced if you do not follow the submission instructions.
All written reports (for both 472 and 572 students) must be composed in MS Word, LaTeX, or some other word processor and submitted as a PDF file.
Please take the time to read this entire document. If you have questions there is a high likelihood that another section of the document provides answers.
Introduction
In this final project you will implement a cache simulator. Your simulator will be configurable and will be able to handle caches with varying capacities, block sizes, levels of associativity, replacement policies, and write policies. The simulator will operate on trace files that indicate memory access properties. All input files to your simulator will follow a specific structure so that you can parse the contents and use the information to set the properties of your simulator.
After execution is finished, your simulator will generate an output file containing information on the number of cache misses, hits, and miss evictions (i.e. the number of block replacements). In addition, the file will also record the total number of (simulated) clock cycles used during the situation. Lastly, the file will indicate how many read and write operations were requested by the CPU.
It is important to note that your simulator is required to make several significant assumptions for the sake of simplicity.
1. You do not have to simulate the actual data contents. We simply pretend that we copied data from main memory and keep track of the hypothetical time that would have elapsed.
2. Accessing a sub-portion of a cache block takes the exact same time as it would require to access the entire block. Imagine that you are working with a cache that uses a 32 byte block size and has an access time of 15 clock cycles. Reading a 32 byte block from this cache will require 15 clock cycles. However, the same amount of time is required to read 1 byte from the cache.
3. In this project assume that main memory RAM is always accessed in units of 8 bytes (i.e. 64 bits at a time).
When accessing main memory, it's expensive to access the first unit. However, DDR memory typically includes buffering which means that the RAM can provide access to the successive memory (in 8 byte chunks) with minimal overhead. In this project we assume an
overhead of 1 additional clock cycle per contiguous unit
.
For example, suppose that it costs 255 clock cycles to access the first unit from main memory. Based on our assumption, it would only cost 257 clock cycles to access 24 bytes of memory.
4. Assume that all caches utilize a "fetch-on-write" scheme if a miss occurs on a Store operation. This means that.
This document provides an overview of OPCache, PHP's opcode cache. It begins with introductions to PHP, how PHP works by parsing, compiling and executing code, and the need for an opcode cache. It then discusses what opcodes are and how OPCache works by caching compiled opcodes in shared memory to improve performance by avoiding recompilation. The document outlines various OPCache configuration settings and optimizations like interned strings. It provides examples of opcodes generated from PHP code and discusses tuning OPCache for best performance.
Today's high-traffic web sites must implement performance-boosting measures that reduce data processing and reduce load on the database, while increasing the speed of content delivery. One such method is the use of a cache to temporarily store whole pages, database recordsets, large objects, and sessions. While many caching mechanisms exist, memcached provides one of the fastest and easiest-to-use caching servers. Coupling memcached with the alternative PHP cache (APC) can greatly improve performance by reducing data processing time. In this talk, Ben Ramsey covers memcached and the pecl/memcached and pecl/apc extensions for PHP, exploring caching strategies, a variety of configuration options to fine-tune your caching solution, and discusses when it may be appropriate to use memcached vs. APC to cache objects or data.
Doctrine with Symfony - SymfonyCon 2019julien pauli
This document provides an overview of the Doctrine project, including its ORM and DBAL components. It discusses the architecture of Doctrine, including entities, the entity manager, unit of work, repositories, and metadata. It explains how Doctrine maps objects to the database using its ORM. Key concepts covered include the entity manager methods like find(), persist(), and flush(), managing entity state and changes. The document also discusses Doctrine's DBAL for database abstraction and query building.
This document provides an overview of the inner workings of PHP from three perspectives:
1) The PHP engine consists of the Zend Engine virtual machine, which interprets PHP code, and extensions that add additional features.
2) PHP code is compiled into an intermediate opcode representation before being executed by the Zend Engine.
3) The Zend Engine executes opcode by running each instruction through a handler function in an infinite dispatch loop.
This document provides an introduction to DNS (Domain Name System) in 3 paragraphs:
It explains that DNS was created to address the problems with using a centralized HOSTS.TXT file to map hostnames to IP addresses as the Internet grew. DNS introduced a distributed and hierarchical namespace that maps domain names to IP addresses through a global network of name servers.
It describes the basic structure and functionality of DNS, including that it is organized in a tree structure with top-level domains at the root, each domain can be delegated to different administrators, and name servers contain parts of the distributed database that maps domain names and resource records like A records (IPv4 addresses) and MX records (mail servers).
The
This document provides an overview of PHP's virtual machine. It discusses how PHP works internally, including:
- PHP is interpreted by a software virtual machine written in C called the Zend Engine.
- The Zend Engine compiles PHP code to opcodes, performs optimizations, and then executes the opcodes by interpreting them one by one.
- Key parts of the compilation process include lexical analysis, semantic analysis/parsing, and opcode generation. Optimizations are then performed by the opcache extension.
- Execution involves interpreting each opcode through handler functions. Common opcodes like ZEND_ECHO and ZEND_CONCAT are discussed as examples.
- The opcode cache stores pre-compiled code
Basics of Cryptography - Stream ciphers and PRNGjulien pauli
This document discusses stream ciphers and linear feedback shift registers (LFSRs) for cryptography. It explains that LFSRs can be used to generate long pseudorandom key streams from a short secret key by shifting binary digits and reinjecting some digits. Multiple LFSRs combined together can strengthen encryption by making the output less predictable. Properly initializing the LFSRs with a secret key and IV helps ensure the key stream remains random.
Mastering your home network - Do It Yourselfjulien pauli
The document provides instructions for mastering a home network by replacing the ISP-provided router with professional networking hardware. It recommends throwing away the ISP "box" and using a modem and separate router instead. The router should be a professional SOHO brand like Mikrotik, Ubiquiti or Turris Omnia for features like VLANs, QoS, routing, VPN, and advanced protocols. Basic firewall rules are outlined to secure the WAN connection by accepting ICMP, dropping invalid packets, and accepting established connections.
This document summarizes Julien Pauli's presentation on performance considerations with PHP 7. The key points are:
1) PHP 7 introduced a new compiler based on an AST that performs optimizations like resolving static expressions and function calls at compile time.
2) PHP 7 also introduced optimizations for references, hashtables, strings and encapsed strings. References are copied less, hashtables use less memory, strings are interned and encapsed strings build strings more efficiently.
3) Future versions of PHP will continue optimizing the compiler and intoduce a JIT compiler for further performance improvements. PHP 8 will be released when these optimizations are ready.
This document discusses Zend Thread Safety (ZTS) in PHP. It explains that ZTS provides a layer that abstracts thread libraries and makes PHP core and extensions thread-safe when running in a threaded environment. It does this by using thread-local storage to maintain separate data for each thread. Extensions must be compiled with ZTS to store their global data in this thread-local storage so it is properly separated for each thread. ZTS slows down PHP startup but is important for running PHP on threaded web servers or using threaded extensions. In most cases, PHP applications do not need to be run in a threaded environment.
This document provides an overview of the TCP/IP protocol. It begins with an introduction to TCP and IP, explaining that TCP provides reliable, ordered delivery of data packets over the unreliable IP network layer. It then discusses key TCP concepts like the three-way handshake for connection establishment, ACK packets for reliability, and the sliding window mechanism for efficient data transfer through pipelining of packets. The document is intended to explain the core logic and functionality of the TCP protocol at a high level.
This document discusses performance considerations with PHP 7. It describes how PHP 7 has a new compiler that optimizes code more at compile time compared to PHP 5. PHP 7 also has optimizations for variables, references, hashtables, strings, and encapsed strings that improve performance. These changes make PHP code run faster and be more efficient with memory and CPU cache usage compared to PHP 5.
The document discusses performance improvements in PHP 7 compared to PHP 5. It summarizes profiling results that show PHP 7 code runs 25% faster and uses 30% less memory than PHP 5 code. It then discusses various internal optimizations in PHP 7 that provide these performance gains, such as improved compiler optimizations, more efficient variable, hashtable and string handling. The document provides examples of how these internal changes help optimize CPU cache usage and reduce memory overhead.
This document summarizes Julien Pauli's presentation on PHP 7 performance optimizations compared to PHP 5. It discusses profiling a Symfony application under PHP 5 and PHP 7, showing PHP 7 runs 23% faster with an opcode cache. Key PHP 7 optimizations discussed include a more efficient zval structure reducing variable size, more compact and cache-friendly hashtable design, and optimized string handling with the zend_string structure. Various virtual machine operations like array operations, casts, and concatenations also see significant performance gains in PHP 7.
PHP 7 is scheduled for release in November 2015 and will be a major new version that introduces many new features and changes. Some key points include: PHP 7 will provide improved performance through a new Zend Engine 3.0 and full support for 32-bit and 64-bit platforms. New features include scalar type declarations, return type declarations, new operators like the null coalesce operator and the spaceship operator, and anonymous classes. The release will also change some behaviors and remove deprecated features.
This document provides tips, tricks, and examples of common gotchas in PHP programming. It demonstrates unexpected behaviors that can occur due to PHP's highly dynamic nature and weakly typed system. A series of code snippets are shown with their expected versus actual outputs to illustrate issues one may encounter with variables, strings, arrays, and type coercion. The document also provides best practices for PHP development and an overview of common topics covered in the PHP certification exam.
PHP 5.5 is the latest version of PHP that includes new features like a password hashing API, generators syntax, and a finally keyword for exceptions. It also includes performance improvements and integration with the OPcache for opcode caching. Some changes in PHP 5.5 include deprecating the mysql extension and preg_replace /e modifier.
This document summarizes the history and evolution of PHP from its origins in 1995 as a CGI scripting language through its current version 5.5 released in 2013. It describes some of the major milestones like the introduction of the Zend Engine in PHP 4 that improved performance and compilation, and the transition to a true object model in PHP 5. It highlights new features in PHP 5.5 like the password hashing API and generators. Performance benchmarks show PHP 5.5 is faster than previous versions with speed improvements up to 20% from PHP 5.3. The document promotes contributing to the open source PHP project and lists some of the key areas and ways people can get involved.
The document discusses PHP performance and dives into the internals of how PHP works, including details on the Zend engine, compilation process involving lexing, parsing and compiling to opcodes, and execution through opcode interpretation by the virtual machine. It provides examples and tips on optimizing performance by reducing compilation overhead through opcode caching, profiling execution to find bottlenecks, and analyzing PHP functions at the C level to optimize system calls and memory usage.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
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!
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
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.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
2. Hello everybody
Julien PAULI
Programming with PHP since early 2000s
Programming in C
PHP Internals programmer/reviewer
PHP 5.5 & 5.6 Release Manager
@julienpauli
Tech blog at jpauli.github.io
jpauli@php.net
3. What about you ?
Got some Unix/Linux understandings ?
Have already experienced C programming ?
Have already experienced PHP programming ?
4. What we'll cover together
Memory , what's that ?
bytes, stack, heap, etc.
Measuring a process memory consumption
memory image map analysis
Understanding PHP memory consumption
Zend Memory Manager coming
Measuring PHP memory consumption
from PHP land or from system land
7. Memory in a user process
The Virtual Memory image is divided in segments
text
data
heap
stack
8. Memory usage can grow
Stack will grow as functions will get called
And will narrow as the calls stop and return
Heap will grow as the programmer will decide
Using dynamic allocation functions (malloc, mmap)
Programmer has to free memory by hand
If not : memory leak
10. Linux memory monitoring
'top' or /proc FS
> cat /proc/28754/status
VmPeak: 20452 kB
VmSize: 20324 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 316 kB
VmRSS: 316 kB
VmData: 16440 kB
VmStk: 136 kB
VmExe: 4 kB
VmLib: 1664 kB
VmPTE: 28 kB
VmSwap: 0 kB
Size of the VM map (out of total mem)
Resident Set Size : Size actually in PM
Size of the data segment in VM
Size of the stack segment in VM
Size of the text segment in VM
pid
11. Going even deeper
Let's show the detailed process memory map :
> cat /proc/28754/smaps
shared segment
private mem
shared mem
13. PHP, just a process
PHP is just a process like any other
You then can monitor its memory usage by asking
the OS
<?php
passthru(sprintf('cat /proc/%d/status', getmypid()));
<?php
function heap() {
return shell_exec(sprintf('grep "VmRSS:" /proc/%d/status', getmypid()));
}
15. The PHP model
One same process may treat many requests
If the process leaks memory, you'll suffer from that
Request n+1 must know nothing about request n
Need to "flush" the request-allocated memory
Need to track request-bound memory claims
ZendMM is the layer that does the job
Share-nothing architecture : by design.
17. Why a custom layer ?
ZendMM
Allows monitoring of request-bound heap usage by
basically counting malloc/free calls
Allows the PHP user to limit the heap mem usage
Allows caching of alloced blocks to prevent memory
fragmentation and syscalls
Allows preallocating blocks of well-known-sizes for
PHP internal structures to fit-in in an aligned way
Ease memory leaks debugging in core and exts
18. ZendMM guards and leak tracker
Only works in debug mode PHP
report_memleaks=1 in php.ini
Does NOT replace valgrind
19. Zend MM test script
<?php
ini_set('memory_limit', -1); /* unlimited ZendMM heap */
function heap() {
return shell_exec(sprintf('grep "VmRSS:" /proc/%d/status', getmypid()));
}
echo heap();
$a = range(1, 1024*1024); /* Stress memory by allocating */
echo heap();
unset($a); /* Stress memory by freeing */
echo heap();
20. Zend MM launch test
> time USE_ZEND_ALLOC=1 php zendmm.php
VmRSS: 9640 kB
VmRSS: 159296 kB
VmRSS: 10068 kB
real 0m0.237s
user 0m0.148s
sys 0m0.080s
> time USE_ZEND_ALLOC=0 php zendmm.php
VmRSS: 9608 kB
VmRSS: 148988 kB
VmRSS: 140804 kB
real 0m0.288s
user 0m0.176s
sys 0m0.108s
21. Valgrind tests for Symfony2 command
app/console runs lots of PHP code under SF2
>USE_ZEND_ALLOC=1 valgrind php app/console debug:container
total heap usage: 84,000 allocs, 84,000 frees, 25,966,154 bytes allocated
>USE_ZEND_ALLOC=0 valgrind php app/console debug:container
total heap usage: 813,570 allocs, 813,570 frees, 74,579,732 bytes allocated
23. ZendMM benefits
Better memory management
More memory efficient
Far less malloc/free calls
Less context switches, less Kernel stress
Less CPU usage
Less heap fragmentation / compaction
A PHP ~10% faster with ZendMM enabled
Really depends on use-case
24. Memory manager internals
Layer on top of the heap
Will allocate memory from the heap by chunks of
customizable size (segments)
Will use a customizable low level heap (malloc /
mmap)
25. A quick word on ZendMM internals
ZEND_MM_SEG_SIZE env variable to customize
segment size
Must be power-of-two aligned
Default value is 256Kb
26. ZendMM in PHP user land
memory_limit (INI setting)
memory_get_usage(true)
Returns the size of all the allocated segments
memory_get_usage()
Returns the occupied size in all the allocated
segments
memory_get_[peak]_usage([real])
Returns the max memory that has been
allocated/used. Could have been freed meantime
30. memory_get_usage() ?
memory_get_usage() tells you how much your
allocated blocs consume
They usually don't fill their segment entirely
Thus memory_get_usage(true) shows more
This doesn't count stack
This does only count request-bound memory
This doesn't count linked libraries present in the
process memory map
This doesn't show non-request-bound memory
34. Recommendations / statements
Understand memory_get_usage()
It only shows request-bound allocations, not
persistent allocations (that reside through requests)
PHP extensions may allocate persistent memory
Do NOT activate extensions you will not use
Libraries used by PHP may also allocate persistent
memory
Use your OS to monitor your process memory
accurately
36. Master your PHP mem usage
In PHP land ...
all variable types consume memory
every script asked for compilation will eat memory
This memory will be allocated using ZendMM
The memory for parsed script is freed when the
request ends
The memory for user variable is freed when the
data is not used any more
And here comes the challenge
When isn't the data needed any more ??
37. Compilation eats memory
Compiling a script eats request-bound memory
If you compile a class, that eats lots of memory
You'd better use that class at runtime
Use an autoloader to be sure
<?php
$mem = memory_get_usage();
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../src/Symfony/Component/DependencyInjection/ContainerBuilder.php'
echo memory_get_usage() - $mem . "n";
php app/bar.php
246,692
39. PHP Variables
What eats memory is what is stored into the zval,
not really the zval itself :
A huge string
Tip : a file_get_contents('huge-file') is a huge string
A complex array or object
Resources don't really consume mem in zval
<?php
/* This consumes sizeof(zval) + 1024 bytes */
$a = str_repeat('a', 1024);
40. PHP Variables
What you want to avoid is have PHP duplicate the
zval
But PHP is kind about that
What you want to happen in PHP freeing the
memory ASAP
Should you know when PHP duplicates or frees zval
, that's the most important !
41. zvals and refcount
PHP simply counts how many symbols (PHP
vars) point to a zval
This is called the refcount
<?php
$a = "foo";
$b = $a;
42. zvals and refcount
PHP uses a CopyOnWrite (COW) system for
zvals
Memory is saved
Memory gets allocated only on changes
<?php
$a = "foo";
$b = $a;
$a = 17;
43. zvals and refcount
PHP frees memory for a zval
when its refcount reaches 0
Yes, unset() just refcount-- ,
that's all
<?php
$a = "foo";
$b = $a;
$c = $b;
$b = "bar";
unset($a);
44. No references needed
You see how smart PHP is with memory ?
It's been designed with that in mind
No references needed to hint PHP !
Don't try to hint PHP with references
References can lead to adverse effects
Force PHP to copy a zval
Prevents PHP from freeing memory of a zval
&
45. Tracking refcount
xdebug_debug_zval()
symfony_zval_info()
namespace Foo;
class A
{
public $var = 'varA';
}
$a = new A();
xdebug_debug_zval('a');
a: (refcount=1, is_ref=0)=class FooA { public $var =
(refcount=2, is_ref=0)='varA'; }
46. Tracking refcount
namespace Foo;
class C
{
public $b;
public function __construct(B $b) {
$this->b = $b;
}
}
$c = new C($b = new B);
xdebug_debug_zval('c');
c: (refcount=1, is_ref=0)=class FooC { public $b = (refcount=2, is_ref=0)=class FooB { } }
namespace Foo;
class B
{
}
unset($b);
xdebug_debug_zval('c');
c: (refcount=1, is_ref=0)=class FooC { }
c: (refcount=1, is_ref=0)=class FooC { public $b = (refcount=1, is_ref=0)=class FooB { } }
unset($c->b);
xdebug_debug_zval('c');
47. Garbage collector ?
As of PHP5.3 , a garbage collector exists
Used to free circular references
And that's all !
PHP already frees itself your vars as their
refcount reaches 0
And it's always been like that
48. Circular references
$a = new A;
$b = new B
(object) 'A'
refcount = 1
$a (object) 'B'
refcount = 1
$b
50. Circular references
Objects are still in memory but no more PHP var
point to them
We can call that a "PHP Userland memory leak"
unset($a, $b);
(object) 'A'
refcount = 1
$b->a (object) 'B'
refcount = 1
$a->b
53. PHP references main line
Using references (&) in PHP can really fool you
They usually force the engine to duplicate memory
containers
Which is bad for performance
Especially when the var container is huge
54. References mismatch
<?php
function foo($data)
{
echo "in function : " . memory_get_usage() . "n";
}
echo "Initial memory : " . memory_get_usage() . "n";
$r = range(1, 1024);
echo "Array created : " . memory_get_usage() . "n";
foo($r);
echo "End of function " . memory_get_usage() . "n";
Initial memory : 227.136
Array created : 374.912
in function : 374.944
End of function 374.944
55. References mismatch
<?php
function foo($data)
{
echo "in function : " . memory_get_usage() . "n";
}
echo "Initial memory : " . memory_get_usage() . "n";
$r = range(1, 1024);
$r2 = &$r;
echo "Array created : " . memory_get_usage() . "n";
foo($r);
echo "End of function " . memory_get_usage() . "n";
Initial memory : 227.208
Array created : 375.096
in function : 473.584
End of function 375.128
56. When does the engine separate ?
In any mismatch case :
zval passed to function arginfo decl. zval received in function separated by engine?
is_ref=0
refcount = 1
pass_by_ref=0 is_ref=0
refcount = 2
NO
is_ref=1
refcount > 1
pass_by_ref=0 is_ref=1
refcount =1
YES
is_ref=0
refcount > 1
pass_by_ref=0 is_ref=0
refcount > 1 ++
NO
is_ref=0
refcount = 1
pass_by_ref=1 is_ref=1
refcount = 2
YES
is_ref=1
refcount > 1
pass_by_ref=1 is_ref=1
refcount > 1 ++
NO
is_ref=0
refcount > 1
pass_by_ref=1 is_ref=1
refcount = 2
YES
57. Symfony_debug to notice mismatches
https://github.com/symfony/debug
function bar($var) { }
$a = "foo";
$b = &$a;
bar($a);
Notice: Separating zval for call to function 'bar' in /tmp/memory.php on line 20
59. Foreach separation behavior
It happens sometimes foreach() duplicates your
variable for iteration
This will eat performances in case of big or
complex arrays being iterated
There is nothing special to say about objects
implementing Traversable
The behavior is then just yours
60. foreach iterating array #1
If the variable has a refcount of 1, no duplication is
performed by foreach()
$a = range(1,1024);
echo memory_get_usage() . "n" ;
foreach ($a as $v) {
if ($v == 1) {
echo memory_get_usage() . "n" ;
}
}
echo memory_get_usage() . "n" ;
373936
374056
374056
61. foreach iterating array #2
If the variable has a refcount >1, foreach() will
duplicate it fully for iteration
$a = range(1,1024);
$b = $a;
echo memory_get_usage() . "n" ;
foreach ($a as $v) {
if ($v == 1) {
echo memory_get_usage() . "n" ;
}
}
echo memory_get_usage() . "n" ;
373936
472512
374056
62. foreach iterating array #3
If the variable is a reference, foreach() will work
onto that array and won't perform duplication
$a = range(1,1024);
$b = &$a;
echo memory_get_usage() . "n" ;
foreach ($a as $v) {
if ($v == 1) {
echo memory_get_usage() . "n" ;
}
}
echo memory_get_usage() . "n" ;
373936
374056
374056
63. Monitoring memory usage
Not much tools exist (for PHP)
memory_get_usage()
OS' help (/proc , pmap , etc...)
Valgrind with massif tool
PHP Extensions
Xdebug
memprof
memtrack
64. Quick intro to memprof
https://github.com/arnaud-lb/php-memory-profiler
$b = range(1, 1024 * 1024); /* a lot of memory */
$b[] = foo();
loader('/Zend/Date.php'); /* a lot of PHP source code */
memprof_dump_callgrind(fopen('/tmp/trace.out', 'w'));