Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Hayden James:
PHP-FPM tuning: Using ‘pm static’ for max performance
Oct 13, 2017 @ 11:28:13

Hayden James has a post on his site sharing a method he's found for getting better performance out of PHP-FPM with the help of a configuration change. In this tutorial he shows how to use the pm static setting to squeeze the best performance out of your web server.

Lets take a very quick look at how best to setup PHP-FPM for high throughput, low latency and a more stable use of CPU and memory. By default, most setups have PHP-FPM’s PM (process manager) string set to dynamic and there’s also the common advice to use ondemand if you suffer from available memory issues.

He starts by defining the three "pm" settings and what they do: dynamic, ondemand and static. He then talks some about how the PHP-FPM process manager is similar to CPUFreq Governor and the settings it allows. Finally he gets into talking about the "pm static" handling, how it relates to available memory and when it makes more sense to use "dynamic" over "static".

tagged: phpfpm tuning performance static dynamic ondemand tutorial memory

Link: https://haydenjames.io/php-fpm-tuning-using-pm-static-max-performance/

SitePoint PHP Blog:
Glide: Easy Dynamic on-Demand Image Resizing
Mar 03, 2016 @ 10:52:59

On the SitePoint PHP blog editor Bruno Skvorc has posted a tutorial showing you how to use Glide, an image manipulation library that's a part of the League of Extraordinary Packages.

Glide is an image processing library built on top of Intervention. Its purpose is to facilitate on-demand image processing. That’s a fancy way of saying it creates images as they’re requested if they don’t exist.

He gives the example of the need to manipulate the image based on the user's device - like desktop versus mobile clients. He shows how to get the library installed (via Composer) and how to configure it with cache and source directories. He then integrates the library into a "no framework"-based application, passing the missing image request to the "image" controller for handling. However a basic implementation like this leaves it open to exploit. He shows how to restrict the allowed sizes with an allowedWidths data set. He ends the article with a look at image saving and caching with the possibility of writing the resulting file to the local drive (caching) if re-requested later.

tagged: glide image manipulation library theleague ondemand tutorial

Link: http://www.sitepoint.com/easy-dynamic-on-demand-image-resizing-with-glide/

IBM developerWorks:
Setting up your own on-demand video site with PHP, Part 1
Apr 02, 2008 @ 17:48:03

In this first article of a new series on the IBM developerWorks site introduces you to their method for creating your own "on-demand video website" with PHP:

In Part 1 of a three-part series on creating an on-demand video site with PHP, we begin by looking at the different flavors of digital video and their particular nuances. When creating video for the Web, the overarching issue you need to keep in mind is whether you want your video to be small and easy to download or whether you want it to be the best quality possible.

They'll also show you how to convert the video into the Flash Video format to make it easy to pull into an in-page Flash player. You'll need to register or log in to get to the article.

tagged: ondemand video tutorial series flash

Link: