Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Swoole

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Avatar for Gabriel Oliveira Gabriel Oliveira
June 03, 2024
5

 Swoole

Avatar for Gabriel Oliveira

Gabriel Oliveira

June 03, 2024

Transcript

  1. WHO AM I? - Software Engineer at CFP Energy -

    Started programming in 2022 - Working with PHP +2 Years - Functional Programming Enthusiast - I love to study about compilers and low-level topics 1 GABRIEL DE OLIVEIRA
  2. INTRODUCTION Swoole is a PHP extension, high-performance network framework based

    on an event-driven, asynchronous, non-blocking I/O coroutine programming model for PHP.
  3. USING MULTI THREADS/PROCESSES 5 Why we can't just spawn threads

    and fork processes if run programs in parallel are faster?
  4. 6 • Race Conditions • Mutex • Deadlock • Debugging

    & Testing • Memory Overhead Why we can't just spawn threads and fork processes if run programs in parallel are faster? USING MULTI THREADS/PROCESSES
  5. 9 WHAT IS I/O? • Database - ( Connection, Queries

    ) • Sockets - ( TCP/UDP ) • File System - ( Read/Write ) • Unix Sockets
  6. FILE DESCRIPTORS 13 File descriptors are numerical identifiers used by

    operating systems to represent input/output (I/O) resources.
  7. FILE DESCRIPTORS File descriptors are numerical identifiers used by operating

    systems to represent input/output (I/O) resources. • select • pool • epool Syscalls
  8. 16

  9. CONCLUSION 18 • Swoole uses a concurrency model in order

    to increase our PHP performance, using non-blocking I/O. • Parallelism is actually faster but it triggers several problems. • Concurrency tries to find a balance between performance and memory/processing consumption. • Swoole can be used instead of PHP-FPM, having their own trade-offs.
  10. THANK YOU FOR WATCHING 19 References: "Swoole - Tudo sobre

    o PHP Swoole" https://www.youtube.com/watch?v=DSjVJWi67V4 "PHP assíncrono com Swoole - Leo Cavalcante" https://www.youtube.com/watch?v=qgXj4eyrT-Q&t=966s "Event Loop" https://en.wikipedia.org/wiki/Event_loop "Open Swoole Documentation" https://openswoole.com/docs "Swoole Whimsical" https://whimsical.com/swoole-TAwK2BCs1Gg3Eow5KYzxk8