SlideShare una empresa de Scribd logo
1 de 18
HOW TO OPTIMIZE
CloudLinux OS Limits
• What is LVE
• mod_hostinglimits is Apache
module that:
o detects VH
o puts apache process into LVE
o lets apache server it
o removes apache process from LVE
UNDERSTANDING LVE
• LVE limits don’t depend on hardware
• Default LVE limits optimized for regular shared
hosting account
o More powerful hardware → more clients per server
o Less powerful hardware → less clients
• Low end customers → smaller limits
• High end customers → larger limits
TYPICAL Hosting
Account
SPEED=100%
PMEM=256MB
VMEM=0
IO=1024KB/s
NPROC=100
EP=20
HIGH END Hosting
Account
SPEED=200%
PMEM=512MB
VMEM=0
IO=1024KB/s
NPROC=100
EP=40
Limits <-> Hardware dependency
• PHP/CGI scripts
• SSH sessions
• Cron jobs
What do limits “LIMIT”
• E-Maile Pipes (cPanel only)
• MySQL queries (requires MySQL
Governor, CPU & IO only)
Static content is NOT limited by default
o Noticeable overhead
o Can be changed by setting AllowHandler * in modhostinglimits.conf
LIMITS UNITS DEFAULT VALUE
SPEED % of a core, or HZ 100%
PMEM KB 256MB
VMEM KB 0MB
IO KB/sec 1024KB/sec
IOPS [requires lve1.3+] Operations per second 1024
NPROC number 100
EP number 20
Default Limits
Type RLIMIT LVE Limit
CPU
Per process. Amount of seconds
each process will execute.
Whole account. Total amount of CPU all processes within
account can use at the same time.
Memory
Per process, limits memory
consumption per process.
Total memory consumption for all processes within
accounts.
IO No alternative Amount of data per second that can be read/written
IOPS No alternative Number of IO operations / second allowed
Number of
processes
Max number of processes per
account
Max number of processes per account
Entry processes No alternatives Max number of apache connections for account
Difference between RLimit & LVE Limits
• % of a single core OR # in hz
o speed=150% → 1 and ½ cores
o 2ghz → 2ghz, no matter what the speed of CPU is
• Default → 100% (1 core)
• Recommended SPEED settings → 100% for regular
accounts, 200% for high performance accounts
• Once limit reached, processes slow down
• Hyper threading counts as a separate core
SPEED
(CPU LIMIT)
HZ settings allows to set approximately same performance level
across different hardware
• Single thread can occupy one core
o Using limit < 1 core will cause
automatic throttling of all requests
• ½ core → requests take 2x as slow
• Due to context switching → CPU
usage is higher than without the
limit
DANGER OF LOW LIMIT
• Limits should be at most ½ of all cores
• Better 1/4 of all cores
WHAT IF LIMIT
TOO HIGH
If limit >= ½ cores –
you need just 2 accounts to OVERLOAD server
• Disc throughput
○ Read & Write
○ KB/s
• Default: 1024KB/sec
• Processes throttled on IO
once limit is hit
IO LIMIT
• SSD provides better throughput
○ HDD → 30-100MB/s
○ SSD → 80-500MB/s
○ Limits are still per account / might not have to
be changed
IO limits Standard account High-end account
HDD 1 MB/s 5 MB/s
SSD 4 MB/s 10 MB/s
SSD vs HDD Disks [IO]
• Disc throughput
o Read & Write
• Restricts total number of IO
operations
o Operations stop once limit is reached, until
second expires
• Default: 1024 operations per second
IOPS LIMIT
SSD vs HDD Disks [IOPS]
• SSD provides significantly higher IOPS rate
○ HDD → 100 to 400 IOPS
○ SDD → 5,000 to 100,000 IOPS
 Source: https://en.wikipedia.org/wiki/IOPS
 https://calypsotesters.com/summary-performance-
comparison-hdd-sshd-ssd/
○ Limits are still per account / might not have to be
changed
 Yet, you can…
vMEM vs pMEM
• vMEM -- virtual memory (deprecated on CL6 & CL7)
vMEM → allocated memory, often not used. Prevents process from
allocating more memory
• pMEM -- physical memory
pMEM → used memory. Counts actual memory of pages in use. Will
kill (OOM) processes for account, if pMEM limit is reached
• Default: 256MB
• RSS field in ps, RES in top.
○ Includes shared memory
○ Includes disk caches
 Used for account, caches will be freed if user
reached memory limit
pMEM limit
• Number of processes limit
• Default: 100
• Most users will never hit this limit
○ Safe to increases to 1000...
NPROC Limit
PROTECTS AGAINST FORK BOMBS AND
SIMILAR ATTACKS
• Number of entry processes
(Apache connections)
• Default: 20
• Error code 508 response when
limit is reached
• Protects against exhaustion of
Apache slots (MaxClients)
EP LIMIT
Questions?
Twitter.com/CloudLinuxOS Visit CloudLinux.com

Más contenido relacionado

La actualidad más candente

IPFS introduction
IPFS introductionIPFS introduction
IPFS introductionGenta M
 
Backdoors with the MS Office file encryption master key and a proposal for a ...
Backdoors with the MS Office file encryption master key and a proposal for a ...Backdoors with the MS Office file encryption master key and a proposal for a ...
Backdoors with the MS Office file encryption master key and a proposal for a ...MITSUNARI Shigeo
 
Using ScyllaDB for Distribution of Game Assets in Unreal Engine
Using ScyllaDB for Distribution of Game Assets in Unreal EngineUsing ScyllaDB for Distribution of Game Assets in Unreal Engine
Using ScyllaDB for Distribution of Game Assets in Unreal EngineScyllaDB
 
LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance AnalysisBrendan Gregg
 
IPMI is dead, Long live Redfish
IPMI is dead, Long live RedfishIPMI is dead, Long live Redfish
IPMI is dead, Long live RedfishBruno Cornec
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Andriy Berestovskyy
 
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?Kuniyasu Suzaki
 
Benefits of Multi-rail Cluster Architectures for GPU-based Nodes
Benefits of Multi-rail Cluster Architectures for GPU-based NodesBenefits of Multi-rail Cluster Architectures for GPU-based Nodes
Benefits of Multi-rail Cluster Architectures for GPU-based Nodesinside-BigData.com
 
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt AhrensOpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt AhrensMatthew Ahrens
 
Web hdfs and httpfs
Web hdfs and httpfsWeb hdfs and httpfs
Web hdfs and httpfswchevreuil
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Anne Nicolas
 
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~NTT DATA OSS Professional Services
 
Apache Phoenix and HBase: Past, Present and Future of SQL over HBase
Apache Phoenix and HBase: Past, Present and Future of SQL over HBaseApache Phoenix and HBase: Past, Present and Future of SQL over HBase
Apache Phoenix and HBase: Past, Present and Future of SQL over HBaseDataWorks Summit/Hadoop Summit
 
The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...
The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...
The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...t_ivanov
 
Windows Azure の中でも動いている InfiniBand って何?
Windows Azure の中でも動いている InfiniBand って何?Windows Azure の中でも動いている InfiniBand って何?
Windows Azure の中でも動いている InfiniBand って何?Sunao Tomita
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Rhydham Joshi
 

La actualidad más candente (20)

IPFS introduction
IPFS introductionIPFS introduction
IPFS introduction
 
Backdoors with the MS Office file encryption master key and a proposal for a ...
Backdoors with the MS Office file encryption master key and a proposal for a ...Backdoors with the MS Office file encryption master key and a proposal for a ...
Backdoors with the MS Office file encryption master key and a proposal for a ...
 
IPFS: The Permanent Web
IPFS: The Permanent WebIPFS: The Permanent Web
IPFS: The Permanent Web
 
Business plan for moo cow
Business plan for moo cowBusiness plan for moo cow
Business plan for moo cow
 
Using ScyllaDB for Distribution of Game Assets in Unreal Engine
Using ScyllaDB for Distribution of Game Assets in Unreal EngineUsing ScyllaDB for Distribution of Game Assets in Unreal Engine
Using ScyllaDB for Distribution of Game Assets in Unreal Engine
 
LISA17 Container Performance Analysis
LISA17 Container Performance AnalysisLISA17 Container Performance Analysis
LISA17 Container Performance Analysis
 
IPMI is dead, Long live Redfish
IPMI is dead, Long live RedfishIPMI is dead, Long live Redfish
IPMI is dead, Long live Redfish
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Proxmox 5.0
Proxmox 5.0Proxmox 5.0
Proxmox 5.0
 
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
 
Benefits of Multi-rail Cluster Architectures for GPU-based Nodes
Benefits of Multi-rail Cluster Architectures for GPU-based NodesBenefits of Multi-rail Cluster Architectures for GPU-based Nodes
Benefits of Multi-rail Cluster Architectures for GPU-based Nodes
 
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt AhrensOpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
 
Web hdfs and httpfs
Web hdfs and httpfsWeb hdfs and httpfs
Web hdfs and httpfs
 
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
Kernel Recipes 2019 - Marvels of Memory Auto-configuration (SPD)
 
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
 
Apache Phoenix and HBase: Past, Present and Future of SQL over HBase
Apache Phoenix and HBase: Past, Present and Future of SQL over HBaseApache Phoenix and HBase: Past, Present and Future of SQL over HBase
Apache Phoenix and HBase: Past, Present and Future of SQL over HBase
 
The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...
The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...
The Impact of Columnar File Formats on SQL-on-Hadoop Engine Performance: A St...
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
Windows Azure の中でも動いている InfiniBand って何?
Windows Azure の中でも動いている InfiniBand って何?Windows Azure の中でも動いている InfiniBand って何?
Windows Azure の中でも動いている InfiniBand って何?
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1
 

Destacado

Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSCloudLinux
 
Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360CloudLinux
 
How lve stats2 works for you and your customers
How lve stats2 works for you and your customersHow lve stats2 works for you and your customers
How lve stats2 works for you and your customersCloudLinux
 
LVE Manager's New UI
LVE Manager's New UILVE Manager's New UI
LVE Manager's New UICloudLinux
 
Simplify Multi-Tenant Queries in ORM Frameworks
Simplify Multi-Tenant Queries in ORM FrameworksSimplify Multi-Tenant Queries in ORM Frameworks
Simplify Multi-Tenant Queries in ORM FrameworksYuen-Kuei Hsueh
 
Single tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SSingle tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SCloudLinux
 
Database Considerations for SaaS Products
Database Considerations for SaaS ProductsDatabase Considerations for SaaS Products
Database Considerations for SaaS ProductsShawn Hooper
 
How to deploy KuberDock hassle-free
How to deploy KuberDock hassle-freeHow to deploy KuberDock hassle-free
How to deploy KuberDock hassle-freeCloudLinux
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...MongoDB
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture PatternsAmazon Web Services
 
FLASH 1st - The Storage Strategy for the Next Decade ( EMC World 2012 )
FLASH 1st - The Storage Strategy for the Next Decade  ( EMC World 2012 )FLASH 1st - The Storage Strategy for the Next Decade  ( EMC World 2012 )
FLASH 1st - The Storage Strategy for the Next Decade ( EMC World 2012 )EMC
 

Destacado (12)

Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360
 
How lve stats2 works for you and your customers
How lve stats2 works for you and your customersHow lve stats2 works for you and your customers
How lve stats2 works for you and your customers
 
LVE Manager's New UI
LVE Manager's New UILVE Manager's New UI
LVE Manager's New UI
 
Simplify Multi-Tenant Queries in ORM Frameworks
Simplify Multi-Tenant Queries in ORM FrameworksSimplify Multi-Tenant Queries in ORM Frameworks
Simplify Multi-Tenant Queries in ORM Frameworks
 
Single tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SSingle tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8S
 
Database Considerations for SaaS Products
Database Considerations for SaaS ProductsDatabase Considerations for SaaS Products
Database Considerations for SaaS Products
 
How to deploy KuberDock hassle-free
How to deploy KuberDock hassle-freeHow to deploy KuberDock hassle-free
How to deploy KuberDock hassle-free
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns
 
Optimizing Linux Servers
Optimizing Linux ServersOptimizing Linux Servers
Optimizing Linux Servers
 
FLASH 1st - The Storage Strategy for the Next Decade ( EMC World 2012 )
FLASH 1st - The Storage Strategy for the Next Decade  ( EMC World 2012 )FLASH 1st - The Storage Strategy for the Next Decade  ( EMC World 2012 )
FLASH 1st - The Storage Strategy for the Next Decade ( EMC World 2012 )
 

Similar a How to optimize CloudLinux OS limits

Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems Baruch Osoveskiy
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data centerHoward Marks
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data centerHoward Marks
 
Deploying ssd in the data center 2014
Deploying ssd in the data center 2014Deploying ssd in the data center 2014
Deploying ssd in the data center 2014Howard Marks
 
[B4]deview 2012-hdfs
[B4]deview 2012-hdfs[B4]deview 2012-hdfs
[B4]deview 2012-hdfsNAVER D2
 
Thin client server capacity planning for sm es
Thin client server capacity planning for sm esThin client server capacity planning for sm es
Thin client server capacity planning for sm esLimesh Parekh
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadMarius Adrian Popa
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017Ivan Zoratti
 
Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016PostgreSQL-Consulting
 
HBase Low Latency, StrataNYC 2014
HBase Low Latency, StrataNYC 2014HBase Low Latency, StrataNYC 2014
HBase Low Latency, StrataNYC 2014Nick Dimiduk
 
Your 1st Ceph cluster
Your 1st Ceph clusterYour 1st Ceph cluster
Your 1st Ceph clusterMirantis
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Colin Charles
 
Presentation database on flash
Presentation   database on flashPresentation   database on flash
Presentation database on flashxKinAnx
 
Tales from Taming the Long Tail
Tales from Taming the Long TailTales from Taming the Long Tail
Tales from Taming the Long TailHBaseCon
 
Red Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep DiveRed Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep DiveRed_Hat_Storage
 
Ceph on All Flash Storage -- Breaking Performance Barriers
Ceph on All Flash Storage -- Breaking Performance BarriersCeph on All Flash Storage -- Breaking Performance Barriers
Ceph on All Flash Storage -- Breaking Performance BarriersCeph Community
 
Redis trouble shooting_eng
Redis trouble shooting_engRedis trouble shooting_eng
Redis trouble shooting_engDaeMyung Kang
 

Similar a How to optimize CloudLinux OS limits (20)

Oracle Performance On Linux X86 systems
Oracle  Performance On Linux  X86 systems Oracle  Performance On Linux  X86 systems
Oracle Performance On Linux X86 systems
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data center
 
2015 deploying flash in the data center
2015 deploying flash in the data center2015 deploying flash in the data center
2015 deploying flash in the data center
 
Deploying ssd in the data center 2014
Deploying ssd in the data center 2014Deploying ssd in the data center 2014
Deploying ssd in the data center 2014
 
ceph-barcelona-v-1.2
ceph-barcelona-v-1.2ceph-barcelona-v-1.2
ceph-barcelona-v-1.2
 
Ceph barcelona-v-1.2
Ceph barcelona-v-1.2Ceph barcelona-v-1.2
Ceph barcelona-v-1.2
 
[B4]deview 2012-hdfs
[B4]deview 2012-hdfs[B4]deview 2012-hdfs
[B4]deview 2012-hdfs
 
Thin client server capacity planning for sm es
Thin client server capacity planning for sm esThin client server capacity planning for sm es
Thin client server capacity planning for sm es
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy Workload
 
MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017MySQL Performance Tuning London Meetup June 2017
MySQL Performance Tuning London Meetup June 2017
 
Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016
 
HBase Low Latency, StrataNYC 2014
HBase Low Latency, StrataNYC 2014HBase Low Latency, StrataNYC 2014
HBase Low Latency, StrataNYC 2014
 
Your 1st Ceph cluster
Your 1st Ceph clusterYour 1st Ceph cluster
Your 1st Ceph cluster
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 
Running MySQL on Linux
Running MySQL on LinuxRunning MySQL on Linux
Running MySQL on Linux
 
Presentation database on flash
Presentation   database on flashPresentation   database on flash
Presentation database on flash
 
Tales from Taming the Long Tail
Tales from Taming the Long TailTales from Taming the Long Tail
Tales from Taming the Long Tail
 
Red Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep DiveRed Hat Storage Server Administration Deep Dive
Red Hat Storage Server Administration Deep Dive
 
Ceph on All Flash Storage -- Breaking Performance Barriers
Ceph on All Flash Storage -- Breaking Performance BarriersCeph on All Flash Storage -- Breaking Performance Barriers
Ceph on All Flash Storage -- Breaking Performance Barriers
 
Redis trouble shooting_eng
Redis trouble shooting_engRedis trouble shooting_eng
Redis trouble shooting_eng
 

Último

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Último (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

How to optimize CloudLinux OS limits

  • 2. • What is LVE • mod_hostinglimits is Apache module that: o detects VH o puts apache process into LVE o lets apache server it o removes apache process from LVE UNDERSTANDING LVE
  • 3. • LVE limits don’t depend on hardware • Default LVE limits optimized for regular shared hosting account o More powerful hardware → more clients per server o Less powerful hardware → less clients • Low end customers → smaller limits • High end customers → larger limits TYPICAL Hosting Account SPEED=100% PMEM=256MB VMEM=0 IO=1024KB/s NPROC=100 EP=20 HIGH END Hosting Account SPEED=200% PMEM=512MB VMEM=0 IO=1024KB/s NPROC=100 EP=40 Limits <-> Hardware dependency
  • 4. • PHP/CGI scripts • SSH sessions • Cron jobs What do limits “LIMIT” • E-Maile Pipes (cPanel only) • MySQL queries (requires MySQL Governor, CPU & IO only) Static content is NOT limited by default o Noticeable overhead o Can be changed by setting AllowHandler * in modhostinglimits.conf
  • 5. LIMITS UNITS DEFAULT VALUE SPEED % of a core, or HZ 100% PMEM KB 256MB VMEM KB 0MB IO KB/sec 1024KB/sec IOPS [requires lve1.3+] Operations per second 1024 NPROC number 100 EP number 20 Default Limits
  • 6. Type RLIMIT LVE Limit CPU Per process. Amount of seconds each process will execute. Whole account. Total amount of CPU all processes within account can use at the same time. Memory Per process, limits memory consumption per process. Total memory consumption for all processes within accounts. IO No alternative Amount of data per second that can be read/written IOPS No alternative Number of IO operations / second allowed Number of processes Max number of processes per account Max number of processes per account Entry processes No alternatives Max number of apache connections for account Difference between RLimit & LVE Limits
  • 7. • % of a single core OR # in hz o speed=150% → 1 and ½ cores o 2ghz → 2ghz, no matter what the speed of CPU is • Default → 100% (1 core) • Recommended SPEED settings → 100% for regular accounts, 200% for high performance accounts • Once limit reached, processes slow down • Hyper threading counts as a separate core SPEED (CPU LIMIT) HZ settings allows to set approximately same performance level across different hardware
  • 8. • Single thread can occupy one core o Using limit < 1 core will cause automatic throttling of all requests • ½ core → requests take 2x as slow • Due to context switching → CPU usage is higher than without the limit DANGER OF LOW LIMIT
  • 9. • Limits should be at most ½ of all cores • Better 1/4 of all cores WHAT IF LIMIT TOO HIGH If limit >= ½ cores – you need just 2 accounts to OVERLOAD server
  • 10. • Disc throughput ○ Read & Write ○ KB/s • Default: 1024KB/sec • Processes throttled on IO once limit is hit IO LIMIT
  • 11. • SSD provides better throughput ○ HDD → 30-100MB/s ○ SSD → 80-500MB/s ○ Limits are still per account / might not have to be changed IO limits Standard account High-end account HDD 1 MB/s 5 MB/s SSD 4 MB/s 10 MB/s SSD vs HDD Disks [IO]
  • 12. • Disc throughput o Read & Write • Restricts total number of IO operations o Operations stop once limit is reached, until second expires • Default: 1024 operations per second IOPS LIMIT
  • 13. SSD vs HDD Disks [IOPS] • SSD provides significantly higher IOPS rate ○ HDD → 100 to 400 IOPS ○ SDD → 5,000 to 100,000 IOPS  Source: https://en.wikipedia.org/wiki/IOPS  https://calypsotesters.com/summary-performance- comparison-hdd-sshd-ssd/ ○ Limits are still per account / might not have to be changed  Yet, you can…
  • 14. vMEM vs pMEM • vMEM -- virtual memory (deprecated on CL6 & CL7) vMEM → allocated memory, often not used. Prevents process from allocating more memory • pMEM -- physical memory pMEM → used memory. Counts actual memory of pages in use. Will kill (OOM) processes for account, if pMEM limit is reached
  • 15. • Default: 256MB • RSS field in ps, RES in top. ○ Includes shared memory ○ Includes disk caches  Used for account, caches will be freed if user reached memory limit pMEM limit
  • 16. • Number of processes limit • Default: 100 • Most users will never hit this limit ○ Safe to increases to 1000... NPROC Limit PROTECTS AGAINST FORK BOMBS AND SIMILAR ATTACKS
  • 17. • Number of entry processes (Apache connections) • Default: 20 • Error code 508 response when limit is reached • Protects against exhaustion of Apache slots (MaxClients) EP LIMIT

Notas del editor

  1. LVE is a kernel level technology developed by the CloudLinux team. The technology has common roots with container based virtualization and uses cgroups in its latest incarnation. It is lightweight and transparent. The goal of LVE is to make sure that no single web site can bring down your web server as today, a single site can consume all CPU, IO, Memory resources or Apache processes. LVE prevents that. It is done via collaboration of Apache module, PAM module and kernel.   mod_hostinglimits is Apache module that:   •detects VirtualHost from which the request came; •detects if it was meant for CGI or PHP script; •puts Apache process used to serve that request into LVE for the user determined via SuexecUserGroup directive for that virtual host; •lets Apache to serve the request; •removes Apache process from user's LVE. The kernel makes sure that all LVEs get fair share of the server's resources, and that no customer can use more then the limits set for that customer. Today we can limit CPU, Memory (virtual and physical), IO, number of processes as well as the number of entry processes (concurrent connections to apache).
  2. LVE limits do not depends on the power of your server they only depend on how fast you want your hosting accounts to be. Default limits are suitable for 99 percent of shared hosting servers. With more powerful hardware you can host more clients per server. On the right side you can see common limits for low end customers and high end customers, where main difference is increased twice CPUspeed, physical memory limits and entry processes limit.
  3. As of now with CloudLinux features you can limit PHP and CGI scripts, processes launched over ssh session, cron jobs, email pipes, mysql queries (using MySQL governor). Static content is not limited by default however this is controlled with AllowHandler in modhostinglimits config file, if changed to wildcard character we can limit all requests.
  4. Default limits are followig: CPUSpeed 100 percent, physical memory 256Mb , virtual memory 0, input-output 1Mb per second, IOPS one thousand twenty four, Number of processes 100 and entry processes twenty. We strongly recommend disabling VMEM limits as physical memory is a much better and accurate way to limit memory for shared hosting.
  5. The very first purpose of CloudLinux is to limit resources that could be taken by websites. Let compare LVE with apache Rlimits. CPU with RLIMIT you set it per apache process. That is an amount of seconds each process will execute. After that process will be killed. It does not limit amount of CPU that can be used at the same time by account. LVE CPU is for whole user account. Is the total amount of CPU (in fractions of the core) all processes within account can use at the same time. If processes try to use more, they will be throttled. Memory with RLIMIT is limiting memory consumption per process. If you have one hundred processes they can take one hundred multiplied by limit. LVE Memory limit is the total memory consumption for all processes within accounts. Total memory that account can consumed doesn’t depend on number of processes. InputOutput and IOPS limits are not possible with apache Rlimits, input-output limit is amount of data per second that can be read/written by all processes in account. While IOPS is number of input-output operations allowed per second. Number of processes is same with RLIMIT and LVE – that is a maximum number of processes allowed per account. However LVE counts all processes, not only launched by apache. Entry processes limit is not available in apache, while with LVE it means maximum number of apache connections for account.
  6. CPU SPEED limit allows to set CPU limit in terms of % of a single core, or as a fixed number of Hz. Setting speed to 100% means LVE could use one full core. Setting it to one hundred fifteen means 1 and a half core. Speed in herz would automatically detect CPU speed of each core, and adjust the CPU scheduler to make sure user cannot go over that limit. For example on 1ghz CPU, setting of --speed=2ghz would mean 2 cores, while on 4ghz CPU same setting would mean 1/2 of a core. Once limit reached processes are interrupted so slow down. Hyper threading counts as a separate core.
  7. In linux system one thread can occupy one core, if limit is set to less then one core this will cause automatic throttling of all requests. It’s quite dangerous to set speed limit less then one core as in this case system CPU usage will be higher due to context switching needed to fit the limit. You will notice %sys overhead in top output. More accounts with less then 1 core limit will cause higher load average. Half core means requests are two time slower but increasing .
  8. Limits should be not more then a half of all cores. Much better if you keep one quarter of all cores as maximum speed limit for high-end accounts. If limits are higher then a half of all cores you need just two accounts to overload server.
  9. IO limits restrict the data throughput for the customer. They are in KB/s. When limit is reached, the processes are throttled (put to sleep). This makes sure that processes within LVE cannot go over the limit,. Yet don't stop working, nor getting killed - they just work slower when the limit is reached. The IO limits will only affect DISK IO, and will have no effect on network. It also doesn't take into consideration any disk cache accesses. So, even if file is loaded from disk cache 1000 times -- it will not be counted towards IO limits.
  10. SSD provides better throughput, if HDD average speed is 30-100 MB/s then SSH could give 80-500 MB/s . Limits are still set per account. For Hard Disk Drives you may leave default 1MB/second. While for Solid State Drive 4MB/second could be used. For high-end accounts you may want to use 5MB/s with HDD and 10MB/s with SSD.
  11. IOPS limits restrict the total number operations per second. Disk operations are not only read and write, they include open, close, seek, dir.. etcetra. When the limit is reached the operations stops until current second expires. Default is set to one thousand and twenty four operations per second.
  12. SSD provides significantly higher IOPS rate. With HDD normal is from 100 to 400 iops
  13. Memory could be controlled by virtual and physical memory limits. Virtual memory limit corresponds to the amount of memory that processes can allocate within LVE. You can see individual process virtual memory usage by monitoring VIRT column in top output for the process. When process tries to allocate more memory then allowed with vmem limit kernel will not allow doing this and in most cases will cause process to fail. Physical memory limit corresponds to the amount of memory actually used by end customer's processes. You can see individual process physical memory usage by monitoring RES column in top output for the process. Because similar processes (like PHP) share a lot of their memory, physical memory usage is often much lower then virtual memory usage.
  14. Physical memory default limit is set to 256MB. You may check physical memory usage in RSS field in ‘ps’ output or in RES column in ‘top’ output. Additionally physical memory includes shared memory used by the customer, as well as disk cache. When LVE goes over physical memory limit, CloudLinux will first free up memory used for disk cache, and if that is not enough, it will kill some of the processes within that LVE. This usually cause web server to show five-zero-three error page. Physical memory limit is much better way to limit memory for shared hosting. We strongly recommend setting VMEM to zero and use only Physical memory limit.
  15. NPROC controls the total number of processes within LVE. Once limit reached no new process can be created, until another dies. Default limit is one hundred. The limit protects against fork bombs and similar attacks. Most users will never hit this limit under normal circumstances. For high-end users you may set it two hundred, however it is safe to increase even to one thousand.
  16. Entry processes limit control the number of entries into LVE. It is also know as 'Apache concurrent connections' limit as the process enters into LVE when there is a new HTTP request for CGI/PHP. Each time a process 'enters' into LVE, we increment the counter. Each time process exits LVE, we decrement the counter. We don't count processes that are created inside LVE itself. Default limit is twenty. Once limit reached no new processes could enter LVE and will cause web server to show error 508 page (Resource Limit Reached). The limit was created to prevent DoS attacks against web server when attacker tries to reach MaxClients created large amount of slow requests. If MaxClients reached apache will not respond to new connections and from outside it appears to be down. The issue is worsened by CPU limits as once site starts to get slow due to CPU limit – it will respond to requests slower and slower, causing more and more connections to be tied up. With entry processes limit such attack will fail as one site will reach his EP limit while other will keep working.