2017 © Pedro Peláez
 

library ocra-hop-hop

Very fast worker-based HTTP Request dispatching for ZF2 that re-uses bootstrapped applications

image

ocramius/ocra-hop-hop

Very fast worker-based HTTP Request dispatching for ZF2 that re-uses bootstrapped applications

  • Tuesday, January 21, 2014
  • by Ocramius
  • Repository
  • 8 Watchers
  • 26 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

OcraHopHop - Worker thread HTTP response dispatching for ZF2

OcraHopHop is a project aimed at reducing latency and resources used by a ZF2 Application while dispatching an HTTP Request., (*1)

Installation

The recommended way to install ocramius/ocra-hop-hop is through composer:, (*2)

{
    "require": {
        "ocramius/ocra-hop-hop": "dev-master@dev"
    }
}

Working concept

The concept behind OCraHopHop is simple, and can be summarized in following pseudo code:, (*3)

init_autoload();
init_config();
// ...
init_application();

while ($request = get_http_request()) {
    $application->serve($request);
}

The idea is to avoid initialization logic by re-using resources across multiple requests., (*4)

PHP was thought for share-nothing architectures, but for greater and more complex applications, such an approach is necessary., (*5)

If you already know FastCGI, this is what it is all about., (*6)

Usage

  1. Replace your public/index.php with the examples/zf2-server.php that you can find in OcraHopHop.
  2. Copy examples/zf2-worker.php to your public/ dir
  3. Open a terminal, cd to your public/ dir and run php zf2-worker.php
  4. Run siege or ab -k against your ZF application
  5. ...?
  6. Profit!

The Versions

21/01 2014

dev-master

9999999-dev https://github.com/Ocramius/OcraHopHop

Very fast worker-based HTTP Request dispatching for ZF2 that re-uses bootstrapped applications

  Sources   Download

MIT

The Requires