Giter Club home page Giter Club logo

php-on-kubernetes's Introduction

PHP on Kubernetes

There's no single way to run and operate an application on Kubernetes. As a general purpose and flexible containers orchestrator, different people ends up with different solutions and it's usually a trade-off between features, complexity, performances, which you balance based on your needs.

This repository doesn't aim to provide a one-fits-all solution, but offering options with pros and cons from which you can pick the one that works better to your use case and business.

Application Logs

For a comparison between the following approaches, please see the blog post:
PHP on Kubernetes: application logging via unix pipe

Option 1: log to php://stdout or php://stderr and enable catch_workers_output in php-fpm

  • Pro: easy.
  • Con: application logs are wrapped by php-fpm and it makes parsing more complicated.
  • Con: application logs are truncated to 1024 bytes and splitted into multiple messages. Long logs are not unusual if you use structured logging and you log contextual information on errors (ie. stack trace).
  • Con: application logs are mixed with php-fpm logs into the same stream.

See a working example at app-log-php-fpm-via-catch-workers-output/.

Option 2: log to unix pipe and tail it in a sidecar container

See a working example at app-log-php-fpm-via-unix-pipe/.

  • Pro: application logs are not wrapped by php-fpm.
  • Pro: application logs are not limited by length (no splitting / truncating).
  • Pro: application logs and php-fpm error logs are not mixed together in the same stream.

php-on-kubernetes's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.