php-fpm performance tweaks

High performance Apache with mpm-event and PHP-FPM   Next, we edit config file for mpm-event at /etc/apache2/mod-available/mpm-event.conf : # event MPM # StartServers: initial number of server processes to start # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum […]

php: generate random number

function UniqueRandomNumbersWithinRange($min, $max, $quantity) { $numbers = range($min, $max); shuffle($numbers); return array_slice($numbers, 0, $quantity); } // $productsViewed = UniqueRandomNumbersWithinRange(1,500000,10); // print_r($productsViewed);