PHP Performance w/APC + thaicyberpoint.com thaithinkpad.com thaihi5.com.

Slides:



Advertisements
Similar presentations
MEMCACHE FOR BIGINNERS
Advertisements

Fast Data at Massive Scale Lessons Learned at Facebook Bobby Johnson.
Inside an XSLT Processor Michael Kay, ICL 19 May 2000.
Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.
Network Performance Measurement
R2: An application-level kernel for record and replay Z. Guo, X. Wang, J. Tang, X. Liu, Z. Xu, M. Wu, M. F. Kaashoek, Z. Zhang, (MSR Asia, Tsinghua, MIT),
Copyright © 200\8 Quest Software High Performance PL/SQL Guy Harrison Chief Architect, Database Solutions.
The State of the Art in Distributed Query Processing by Donald Kossmann Presented by Chris Gianfrancesco.
The Definition Of Crazy Insanity Chris Porter D.O netw3rker
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
1 Software Testing and Quality Assurance Lecture 40 – Software Quality Assurance.
A Dynamic Caching Mechanism for Hadoop using Memcached Gurmeet Singh Puneet Chandra Rashid Tahir University of Illinois at Urbana Champaign Presenter:
Lecture 39: Review Session #1 Reminders –Final exam, Thursday 3:10pm Sloan 150 –Course evaluation (Blue Course Evaluation) Access through.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Accelerating SQL Database Operations on a GPU with CUDA Peter Bakkum & Kevin Skadron The University of Virginia GPGPU-3 Presentation March 14, 2010.
Introduction to Symmetric Multiprocessors Süha TUNA Bilişim Enstitüsü UHeM Yaz Çalıştayı
22-Aug-15 | 1 |1 | Help! I need more servers! What do I do? Scaling a PHP application.
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)

DNN Performance & Scalability Planning, Evaluating & Improving : Part 2.
Designing Enterprise Drupal How to scale Drupal server infrastructure ENVIRONMENTS.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
PHP With Oracle 11g XE By Shyam Gurram Eastern Illinois University.
Goodbye rows and tables, hello documents and collections.
Introduction to Hadoop and HDFS
Improving Efficiency of I/O Bound Systems More Memory, Better Caching Newer and Faster Disk Drives Set Object Access (SETOBJACC) Reorganize (RGZPFM) w/
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.
Revolutionizing enterprise web development Memcache Optimization.
Microsoft Azure SoftUni Team Technical Trainers Software University
Personal Computer - Stand- Alone Database  Database (or files) reside on a PC - on the hard disk.  Applications run on the same PC and directly access.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
MATRIX MULTIPLY WITH DRYAD B649 Course Project Introduction.
Srihari Makineni & Ravi Iyer Communications Technology Lab
Log-structured Memory for DRAM-based Storage Stephen Rumble, John Ousterhout Center for Future Architectures Research Storage3.2: Architectures.
INTRODUCTION TO DBS Database: a collection of data describing the activities of one or more related organizations DBMS: software designed to assist in.
Windows Azure Virtual Machines Anton Boyko. A Continuous Offering From Private to Public Cloud.
CS779 Term Project Steve Shoyer Section 5 December 9, 2006 Week 6.
Data Management for Decision Support Session-4 Prof. Bharat Bhasker.
Dispatching Java agents to user for data extraction from third party web sites Alex Roque F.I.U. HPDRC.
IT System Administration Lesson 3 Dr Jeffrey A Robinson.
History & Motivations –RDBMS History & Motivations (cont’d) … … Concurrent Access Handling Failures Shared Data User.
Accelerating PHP Applications Ilia Alshanetsky O’Reilly Open Source Convention August 3rd, 2005.
Scalable Data Scale #2 site on the Internet (time on site) >200 billion monthly page views Over 1 million developers in 180 countries.
CS223: Software Engineering
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
09/13/04 CDA 6506 Network Architecture and Client/Server Computing Peer-to-Peer Computing and Content Distribution Networks by Zornitza Genova Prodanoff.
Parallel IO for Cluster Computing Tran, Van Hoai.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
Dave LinkedIn
Cloud Computing: Pay-per-Use for On-Demand Scalability Developing Cloud Computing Applications with Open Source Technologies Shlomo Swidler.
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
Compute and Storage For the Farm at Jlab
Understanding and Improving Server Performance
NFV Compute Acceleration APIs and Evaluation
WWW and HTTP King Fahd University of Petroleum & Minerals
Spark Presentation.
Unit – 5 JAVA Web Services
Load Balancing Memcached Traffic Using SDN
SQL 2014 In-Memory OLTP What, Why, and How
Microsoft Connect /1/2018 2:36 AM
Overview of big data tools
Query Optimization CS 157B Ch. 14 Mien Siao.
Performance And Scalability In Oracle9i And SQL Server 2000
Fast Accesses to Big Data in Memory and Storage Systems
Web Application Development Using PHP
Presentation transcript:

PHP Performance w/APC + thaicyberpoint.com thaithinkpad.com thaihi5.com

Cache Theory ?

Req Output Cache Compute Miss Hit Store Check Miss - [Store] - Hit

Type ? FastSlow

APC ? Alternative PHP Cache

Code not changes request Opcode Cache and Variables Cache Automatic update w/code changes

Free & Open Source

Simply Installation

PHP Flow Scanning and Lexing (Plain Text to Tokens) Parsing (Tokens to Expressions) Compilation (Translated Expressions to Opcode) Execution (Opcode stacks are processed) Req Output Scanning Lexing Parsing Compilation Scanning Lexing Parsing Compilation Execution

Normal PHP vs APC

Req Output Scanning Lexing Parsing Compilation Scanning Lexing Parsing Compilation Execution

Normal PHP vs APC Req Output Opcode cache Opcode cache Scanning Lexing Parsing Compilation Scanning Lexing Parsing Compilation APC hook Execution Miss Hit Store

Installation Basic PECL ( –pecl install apc Ubuntu –apt-get install php5-apc Windows ( –extension=php_apc.dll Conf extension=apc.so apc.shm_segments=1 apc.shm_size=256 apc.optimization=0 apc.num_files_hint=2048 apc.ttl=3600 apc.user_ttl=3600 apc.enable_cli=1 apc.max_file_size=1M extension=apc.so apc.shm_segments=1 apc.shm_size=256 apc.optimization=0 apc.num_files_hint=2048 apc.ttl=3600 apc.user_ttl=3600 apc.enable_cli=1 apc.max_file_size=1M

Benchmark PHP NativePHP w/APC Concurrency Level10 Time taken for tests60 seconds Complete requests Total transferred 643,149 bytes1,962,675 bytes HTML transferred 516,971 bytes1,582,035 bytes Requests per second 4.91 [#/sec] (mean)15.21 [#/sec] (mean) Time per request [ms] (mean) [ms] (mean) Time per request (mean, across all concurrent requests) [ms] [ms] Transfer rate [KB/s] received31.88 [KB/s] received

Memcached

History “Developed by Danga Interactive for LiveJournal.com”

Memcached ? a distributed memory object caching system with hash table

Memcached ? a distributed memory object caching system with hash table

Memcached ? a distributed memory object caching system with hash table a generic two stage hashing system (clients and servers). Clients are written for specific application languages. Server is written in C

Memcached ? a distributed memory object caching system with hash table a generic two stage hashing system (clients and servers). Clients are written for specific application languages. Server is written in C

Memcached ? a distributed memory object caching system with hash table a generic two stage hashing system (clients and servers). Clients are written for specific application languages. Server is written in C 85% of top 20 sites use memcached; 50%+ of top 5k sites uses Memcached

Memcached ? a distributed memory object caching system with hash table a generic two stage hashing system (clients and servers). Clients are written for specific application languages. Server is written in C 85% of top 20 sites use memcached; 50%+ of top 5k sites uses Memcached

Why Memcached ? Scale-out –Machine –Process (Use different ports) Memory faster than Disk Allows for efficient use of your database Can utilize existing network –Uses non-blocking network I/O (TCP/IP) Very flexible Client libraries in all major languages

Limits (c/Hash Table) Key : max 250 chars. Values: max 1MB

“We use more than 800 servers supplying over 28 terabytes of memory to our users.” “total throughput achieved is 300,000 UDP req/s” by Paul Saab Saturday, December 13, 2008 at 2:43am 8-core machines 20-30% CPU usage. scale memcached to 8 threads on an 8-core system moved to UDP for get operations to reduce network traffic

Architecture practical ?

Architecture practical ? “designing & implementing scalable applications with memcached and mysql”

Architecture practical ?

Coding ? (in PHP) /* OO API */ $memcacheObj = new Memcache; $memcacheObj->connect('memcache_host', 11211); /* set */ $memcacheObj->set('key', 'data', MEMCACHE_COMPRESSED, 50); / * get w/single key */ $var = $memcacheObj->get('key'); / * get w/multiple key */ $var = $memcacheObj->get(array('key1', 'key2')); $memcacheObj->close();

CMS ? Drupal has Memcache API and Integration Wordpress has object cache wordpress-object-cache.html

code optimization is best

Discussion Q&A

Ref. Improving PHP Application Performance with APC performance-with-apc-presentation PHP Accelerators : APC vs Zend vs XCache with Zend Framework xcache-with-zend-framework/ Scaling with memcached Gear6 and Scaling Website Performance: Caching Session and Profile Data with Memcached performance-caching-session-and-profile-data-with-memcached

Ref. (2) PHP: Memcache - Manual

Thank