Igor Seletskiy. CEO, CloudLinux



Similar documents
Securing shared hosting using CageFS

Advanced Settings Oct 10, 2011

CloudLinux is a proven solution for shared hosting providers that:

About CloudLinux. LVE Manager. Industry awards. Ruby Selector. Python Selector. CageFS. Mod_lsapi. MySQL Governor. OptimumCache.

Applying the Benefits of Cloud and Clustering to your Shared Hosting Platform

Wednesday, October 10, 12. Running a High Performance LAMP stack on a $20 Virtual Server

MAGENTO HOSTING Progressive Server Performance Improvements

Drupal Performance Tuning

How To Use Ngnix (Php) With A Php-Fpm (Php-Fmm) On A Web Server (Php5) On Your Web Browser) On An Ubuntu Web Server On A Raspberry Web 2.5 (Net

Layers of Caching: Key to scaling your website. Lance Albertson -- Narayan Newton

PHP web serving study Performance report

Linux Server Support by Applied Technology Research Center. Proxy Server Configuration

Drupal in the Cloud. by Azhan Founder/Director S & A Solutions

HOW TO MAKE WP FLY...

DESIGN AND IMPLEMENTATION OF A WEB SERVER FOR A HOSTING SERVICE

How To Configure Apa Web Server For High Performance

Serving 4 million page requests an hour with Magento Enterprise

Zend Platform TM. White Paper: Zend Download Server. By Zend Technologies, Inc. May Zend Technologies, Inc. All rights reserved.

Performance Evaluation of Shared Hosting Security Methods

E-commerce is also about

Magento Optimised Template CentOS 6 with cpanel/whm V1.0

Comodo Web Application Firewall Software Version 2.11

Common Server Setups For Your Web Application - Part II

Achieving High Throughput. Fernando Castano Sun Microsystems

Magento & Zend Benchmarks Version 1.2, 1.3 (with & without Flat Catalogs)

Performance Tuning and Optimization for high traffic Drupal sites. Khalid Baheyeldin Drupal Camp, Toronto May 11 12, 2007

Web Server Deathmatch

Applications Manager Best Practices document

NetIQ Access Manager 4.1

Software Environment. Options. Service guarantee:. 24/7 Hardware Support. 99% uptime

Comodo Web Application Firewall for Plesk Software Version 2.11

Asia Web Services Ltd. (vpshosting.com.hk)

Application Performance Testing Basics

This document will list the ManageEngine Applications Manager best practices

The current version installed on your server is el6.x86_64 and it's the latest available.

Apache Tomcat & Reverse Proxies

The course will be run on a Linux platform, but it is suitable for all UNIX based deployments.

Management Solution for VTO(VoIP Traffic Optimizer) Service. Smart VTO Overview. AddPac Technology. 2014, Sales and Marketing.

Performance Analysis and Capacity Planning Whitepaper

Web Server (Step 1) Processes request and sends query to SQL server via ADO/OLEDB. Web Server (Step 2) Creates HTML page dynamically from record set

System Requirements Table of contents

Drupal Performance Tips and Tricks. Khalid Baheyeldin. Drupal Camp Toronto 2014

Designing, Scoping, and Configuring Scalable Drupal Infrastructure. Presented by David Strauss

DIABLO TECHNOLOGIES MEMORY CHANNEL STORAGE AND VMWARE VIRTUAL SAN : VDI ACCELERATION

HPSA Agent Characterization

Performance Analysis of Web based Applications on Single and Multi Core Servers

Apache Tomcat. Load-balancing and Clustering. Mark Thomas, 20 November Pivotal Software, Inc. All rights reserved.

Performance test report

owncloud Enterprise Edition on IBM Infrastructure

DMS Performance Tuning Guide for SQL Server

Informatica Data Director Performance

Tuning Tableau Server for High Performance

Enterprise Deployment

Tunebot in the Cloud. Arefin Huq 18 Mar 2010

Effects of Memory Randomization, Sanitization and Page Cache on Memory Deduplication

PARALLELS SERVER 4 BARE METAL README

Apache Tomcat Tuning for Production

PHP vs. Java. In this paper, I am not discussing following two issues since each is currently hotly debated in various communities:

Comodo Web Application Firewall Software Version 2.0

1. What is this? Why would I want it?

Are You Ready for the Holiday Rush?

Novell File Reporter 2.5 Who Has What?

An Oracle White Paper March Load Testing Best Practices for Oracle E- Business Suite using Oracle Application Testing Suite

ACME Intranet Performance Testing

Dedicated Servers InfoGuide

The Benefits of Using VSwap

Semantic based Web Application Firewall (SWAF - V 1.6)

Running Windows on a Mac. Why?

SiteCelerate white paper

e-config Data Migration Guidelines Version 1.1 Author: e-config Team Owner: e-config Team

CentOS Linux 5.2 and Apache 2.2 vs. Microsoft Windows Web Server 2008 and IIS 7.0 when Serving Static and PHP Content

Deployment - post Xserve

Virtual desktops made easy

Ingram Micro Cloud Hosted Services

#9011 GeoMedia WebMap Performance Analysis and Tuning (a quick guide to improving system performance)

Brainlab Node TM Technical Specifications

Geospatial Server Performance Colin Bertram UK User Group Meeting 23-Sep-2014

BEST PRACTICES FOR PARALLELS CONTAINERS FOR LINUX

Brace for 2012 Christoph

Learning To Fly: How Angry Birds Reached the Heights of Store Performance

McAfee Enterprise Mobility Management Performance and Scalability Guide

Dedicated Hosting. The best of all worlds. Build your server to deliver just what you want. For more information visit: imcloudservices.com.

Crank Your BI Performance up to 11 - Sizing, Tuning & Performance Testing. Innovation Center Network, Silicon Valley Active Global Support

System Requirements Date 2014/09/22

Accelerating Wordpress for Pagerank and Profit

Business white paper. HP Process Automation. Version 7.0. Server performance

Kentico CMS 6.0 Performance Test Report. Kentico CMS 6.0. Performance Test Report February 2012 ANOTHER SUBTITLE

BASICS OF SCALING: LOAD BALANCERS

Click to edit Master title style. Click to edit Master text styles. Hedley Aylott. CEO Summit

ZingMe Practice For Building Scalable PHP Website. By Chau Nguyen Nhat Thanh ZingMe Technical Manager Web Technical - VNG

Best Practices for Monitoring Databases on VMware. Dean Richards Senior DBA, Confio Software

Configuring Apache Derby for Performance and Durability Olav Sandstå

UNIVERSAL WEB APPLICATION SERVER MAYUMBO NYIRENDA. Department of Computer Science

Managed WordPress Hosting

2010 Parallels. All Rights Reserved. 2

Which Database is Better for Zabbix? PostgreSQL vs MySQL. Yoshiharu Mori SRA OSS Inc. Japan

Parallels Panel. Deployment Guide. Plesk Automation Revision 1.0

JBoss Seam Performance and Scalability on Dell PowerEdge 1855 Blade Servers

Microsoft Dynamics NAV 2013 R2 Sizing Guidelines for On-Premises Single Tenant Deployments

Liferay Portal Performance. Benchmark Study of Liferay Portal Enterprise Edition

Transcription:

Optimizing PHP settings for Shared Hosting March M h 21 21, 212 Igor Seletskiy CEO, CloudLinux

Type Security Performance Stability bl mod_php Scary Excellent Bad mod_php + mod_ruid2 Questionable Excellent Bad mod_php + MPM_ITK Questionably Excellent if Ok Scary used with nginx mod_suphp Good Ok Excellent mod_fcgid Good Excellent Flaky mod_cgi Good Bad Excellent FPM Good Excellent? LiteSpeed Good Excellent Excellent

5 WordPress sites Hitting each site with: 11 static files (images, css) 3 php files Each site has: Concurrency index: number of times set of URLs is requested Delay between executions All requests are: done in parallel 1ms ramp up between requests. Site #1 is hit with concurrency of 2 and delay of 2 sec. Sites 2-3 are hit with concurrency 3 and delay of 3 sec. Sites 31-5 are hit with concurrency of 4, and delay of 6 sec. 15 minutes per test.

CentOS 5.7 Intel Quad CPU Q94 @ 2.66Ghz 4GB of RAM 5GB WD SATA HD, 72RPM All standard settings Cron disabled

Apache MPM Prefork MaxClients 256 PHP choice: Mod_FCGID Default Plesk Settings FcgidMaxProcesses 2 FcgidIdleTimeout 4 FcgidIdleScanInterval 1 FcgidProcessLifeTime e e 3

#MPM Prefork MaxClients 256 FcgidMaxProcesses 2 FcgidIdleTimeout 4 FcgidIdleScanInterval 1 FcgidProcessLifeTime 3 Terrible Performance PHP pages are served at 15+ seconds / page Static files are served at 2+ seconds/page Lots timeouts for static pages Lots of failures (53, 5) and timeouts for dynamic pages Load Average fluctuated from 2 to 5 About 2GB of RAM free static requests dynamic requests

#MPM Prefork MaxClients 124 ServerLimit 124 FcgidMaxProcesses 1 4 2 1 3 5 7 9 11 13 static ms/req No more timeouts Just 13 failures for PHP pages Static files take up to 4ms to load PHP pages take up to 1 seconds to load Load averages are 15+ Free Memory drops bellow 1GB 1 5 3 2 Free Memory 7 1 3 5 7 9 11 13 dynamic ms/req 1 1 2 3 4 5 6 7 8 9 1 11 12 13 14 Load Averages Free Memory In GB

FcgidMaxProcesses 2 FcgidIdleTimeout 4 FcgidIdleScanInterval 1 FcgidProcessLifeTime 3 FcgidMaxProcessesPerClass 8 FcgidMaxProcesses global limit on number of processes. For example, Plesk s 2 processes limit is too low for high end servers. cpanel s lack of settings uses default 1. The higher the number of processes, the higher memory usage. FcgidMaxProcessesPerClass limit on number of processes per application (user) FcgidIdleTimeout terminate after an idle period (seconds) FcgidIdleScanInterval scan interval for idle timeout process FcgidProcessLifetime terminate after certain lifetime (if idle).. Apache s default value is 36 seconds 8

FcgidMaxProcesses 1 Response time is much better (around 1 sec) FcgidMaxProccessesPerClass 8 FcgidIdleTimeout 24 Static requests are from ~13ms/request FcgidProcessLifeTime 36 Load is much lower (~4) FcgidIdleScanInterval 12 Just 3MB of free memory left Lots of failures (hitting max processes limit) 8 Increasing MaxProcesses to 12 causes system to start swapping (kills performance) 6 4 2 1 2 3 4 5 6 7 8 9 1 11 12 13 14 dyn. ms/req (new) dyn. ms/req (old) 4 2 1 2 3 4 5 6 7 8 9 1 11 12 13 14 Load Averages (new) Load Averages (old) 3 2 dynamic failures 1 9 1 2 3 4 5 6 7 8 9 1 11 12 13 14 static ms/req (new) static ms/req (old) 15 1 5 1 2 3 4 5 6 7 8 9 1 11 12 13 14

FcgidMaxProcesses 12 FcgidMaxProccessesPerClass 2 Very good performance FcgidIdleTimeout 24 A bit better memory footprint (even with higher Max Processes) FcgidIdleScanInterval 12 FcgidProcessLifeTime 36 3 2 1 1 2 3 4 5 6 7 8 9 1 11 12 13 14 4 ms/req (new) ms/req (prev) 13 failures for every 1 requests Still some failures hitting Max Processes Per Class limit. i 6 2 1 2 3 4 5 6 7 8 9 1 11 12 13 14 15 Load (new) Load (prev) 1 5 3, 1 2 3 4 5 6 7 8 9 1 11 12 13 14 failures (new) failures (prev) 2, 1,, 1 2 3 4 5 6 7 8 9 1 11 12 13 14 Free Mem (new) Free Mem (prev)

Caches PHP opcode so that php source wouldn t have to be re compiled every time. Free, Open Source, Easy to Install Server wide configuration Very good performance (sub 1ms response time) Significantly lower load average Uses lots of RAM 8 6 4 2 1 2 3 4 5 6 7 8 9 111121314 6 4 2 1 2 3 4 5 6 7 8 9 1 11 12 13 14 ms/req (new) ms/req (prev) load (new) load (prev) 15 1 3, 5 2, 1 2 3 4 5 6 7 8 9 111121314 success (new) success (prev) 1,, 1 2 3 4 5 6 7 8 9 1 11 12 13 14 Free Mem (new) Free Mem (prev) 11

FcgidMaxProcesses 25 FcgidMaxProccessesPerClass 8 FcgidIdleTimeout 12 FcgidIdleScanInterval 4 FcgidProcessLifeTime 3 4 CPU, 8GB RAM (4GB free) server with 4 customers (~15 activate at peak hour) CPU usage is at ~1%us, ~5%wa. LA: <.5 Max Processes depend on available RAM Max Processes Per Class defines number of concurrent php executions. default value of 8 is good, but more is better for site responsiveness. IdleTimeout depends on number of active sites on the server (bigger the number, smaller the timeout). Try playing with 1 to 15 minutes timeout, and see the server behavior. Increasing IdleTimeout means that you have to increase MaxProcesses as well. 12

15 Load Averages CPU usage approached 1% Terrible performance Server completely overloaded 1 5 1 2 3 4 5 6 7 8 9 1 11 12 13 14 mod_php fcgid 4 ms/req 35 3 25 4, 2,, 2, Memory 1 2 3 4 5 6 7 8 9 1 11 12 13 14 2 15 1 5 1 2 3 4 5 6 7 8 9 1 11 12 13 14 mod_php fcgid mod_php fcgid

1GB memory for eaccelerator 1 max clients 6 4 2 ms/req 1 2 3 4 5 6 7 8 9 1 11 12 13 14 mod_php fcgid Free Memory Load Averages 3 15 2 1 1 5 1 2 3 4 5 6 7 8 9 1 11 12 13 14 1 2 3 4 5 6 7 8 9 1 11 12 13 14 fcgid mod_php fcgid mod_php

ms/req Load Average 3 3 2 2 1 1 1 2 3 4 5 6 7 8 9 1 11 12 13 14 1 2 3 4 5 6 7 8 9 1 11 12 13 14 mod_ruid mod_php mod_ruid mod_php 3 Free Memory 2 1 1 2 3 4 5 6 7 8 9 1 11 12 13 14 mod_ruid mod_php

HTTPD Request Apache Running As Root fork Find Virtual Host Switch User Serve Request As User DIE HTTPD Request Apache Running As nobody Find Virtual Host Switch User Serve Request As User Switch to nobody

ms/req 1 5 1 2 3 4 5 6 7 8 9 1 11 12 13 14 suphp mod_php Load Average Free Memory 25 4 2 15 1 5 1 2 3 4 5 6 7 8 9 1 11 12 13 14 3 2 1 1 2 3 4 5 6 7 8 9 1 11 12 13 14 suphp mod_php suphp mod_php

Excellent performance Stable Drop in replacement

Run as user Limit exec family of functions often meaningless Cronjobs, CGI scripts Suhoshin WAF (mod_security) Chroot CageFS (CloudLinux)

The PHP safe mode is an attempt to solve the shared server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now. php.net mod_php depends on safe mode Not Reliable Deprecated as of PHP 5.3., removed in PHP 5.4.

Easy with mod_fcgid specify right binary in the wrapper script As many php versions as you need

NGINX HTTP and reverse proxy server Supports caching Live configuration updates Varnish Cache State of the art web accelerator Sophisticated caching VCL Varnish Configuration Language

Single customer is the most common cause of majority of downtimes Limit resource usage per customer will remove spikes and prevent issues for other customers Hard & expensive to track Takes time to track, which results in downtime for the server.

Type CPU Memory IO Number of connections CageFS mod_php Yes No Maybe Yes No* mod_php + mod_ ruid2 ud mod_php + MPM_ITK Yes No Maybe Yes No* Yes Maybe Maybe Yes Yes mod_suphp Yes Yes Apr 212 Yes Yes mod_fcgid Yes Yes Apr 212 Yes Yes mod_cgi Yes Yes Apr 212 Yes Yes FPM Yes Yes Apr 212 Yes Yes LiteSpeed Yes Yes Apr 212 Yes Yes

Better stability Improved security No server slow downs No need to suspend customers due to resource abuse Simplifies up sell to higher plans / VPS Removes the need to upsell to VPS Ability to track usage on per customer bases Less support Improved security Better density

We deployed CloudLinux on our shared hosting servers, and we have seen immediate improvement in reliability. Ditlev Bredah, CEO UK2 Group We deployed CloudLinux on our shared hosting servers, and we have seen immediate improvement in reliability. Now we want to offer the same solution to our dedicated server customers. Emmanuel Vivar, CEO HostDime

Per user, virtualized file system User can see only their own files / safe system files Virtualized /etc /etc, including passwd file No config files with all the users Only one user in /home No presence of other users. Virtualized Vi t li d //proc user can see only l th their i own processes No SUID software Virtualized /dev file system Better then VPS?

Protection against symbolic link attacks. Part of CageFS Better then SymlinksIfOwnerMatch Doesn t suffer from race condition Better Performance This option should not be considered d a security restriction, ti since symlink testing is subject to race conditions that make it circumventable. Apache Documentation http://httpd.apache.org/docs/2.2/mod/core.html

Most Customers Deploy CloudLinux To Existing Production Servers

Visit Us At CloudLinux Booth http://www.cloudlinux.com com