Date post: | 08-Jan-2017 |
Category: |
Technology |
Upload: | stacey-whitney |
View: | 89 times |
Download: | 0 times |
ABOUT MEOne of lucky former members of Magento 1.x Core TeamI love to optimize performanceI give trainings and independent consultancy
mod_php
Spawns new PHP process
Server Thread
Executes PHP script
PHP Initialization
Executes Business Logic
Application Bootstrap
Rendering thePage
DRAWBACKSDynamic server processes was not limitedPHP process is alive unless all bytes transfered to aremote connectionEvery new PHP process takes time to start
PHP-FPM
Waits for Response
Server Thread
Executes PHP File
Takes runningprocess
FPMFastCGI Process
Manager
Process Pool1..n
Executes Business Logic
Application Bootstrap
Rendering thePage
DRAWBACKNot controlling your memory usage, might results in
memory over-usage by one of the processes
Application Process Manager
Waits for Response
Server Thread
Fork/Re-use Process with Business Logic
ApplicationMaster Process
Rendering thePage
DRAWBACKSYou have to control used memoryYou have to ensure async IO on any operationIf single line of code fails, all app crashes
SESSIONSEvery page load requires I/O operation to cache storageDynamic requests in Varnish bootstrap full application
SESSION APPLICATION
Start ServerGC Inactive
Sessions every 5minutes
Stop Server
IO to Redis IO to Redis
Lazy Load aSession
IO to Redis
STOCK PROCESSINGEvery order place request requires database lock on stocktableYou usually sacrifice stock integrity for performancereasons
LEARN MOREReactPHP: PHPFastCGI: Sample counter server:
http://reactphp.org/http://phpfastcgi.github.io/
http://bit.ly/counter-sample