CloudLinux is a Linux operating system that is optimized for shared hosting environments. It provides several features that help increase a server’s stability and security, including the ability to set resource limits for individual accounts. In this article, we will discuss how to set Cloudlinux Limits per Package in a cPanel/WHM Server and learn about the limits that can be set using CloudLinux.
There are 3 ways to set Cloudlinux limits per Packages:
- Using cPanel Package Feature
- Using Cloudlinux Manager
- Using the Cloudlinux cli.Â
What are Cloudlinux Limits, and why they are need it
CloudLinux limits are a set of tools that allow administrators to set limits on the number of resources that each user on a shared hosting server can use. These limits prevent a single user from monopolizing the server’s resources and causing other users to experience slowdowns.
Several types of limits can be set with CloudLinux, including:
- CPU limits: Control the amount of CPU time a user can consume.
- Memory limits: Control the amount of RAM that a user can consume.
- I/O limits: Control the amount of disk I/O a user can consume.
- Process limits: Control the number of processes that a user can run.
- Entry process limits: Control the number of concurrent connections a user can have.
By setting these limits, administrators can ensure that no single user can monopolize the server’s resources, which can cause slowdowns for other users. This can help to improve the overall performance and stability of the server, and ensure that all users have a fair and consistent experience.
CPU Limits (SPEED): CloudLinux allows administrators to limit the amount of CPU a user can consume. This can be useful in preventing a single user from monopolizing the server’s resources and causing other users to experience slowdowns. Administrators can set limits for both the number of CPU cores that a user can utilize as well as the percentage of CPU that a user can consume.
Memory Limits: CloudLinux also allows administrators to limit the amount of memory a user can consume. This can help to prevent a single user from using up all of the server’s memory and causing other users to experience slowdowns. Administrators can set limits for both the amount of physical and virtual memory that a user can consume.
I/O Limits: CloudLinux allows administrators to limit the amount of disk I/O a user can perform. This can help to prevent a single user from using up all of the server’s I/O resources and causing other users to experience slowdowns. Administrators can set limits for the number of I/O operations per second and the amount of data transferred per second.
IOPS (Input/Output Operations Per Second):Â IOPS limits allow administrators to set limits on the number of I/O operations that a user can perform per second. This can help to prevent a single user from using up all of the server’s I/O resources and causing other users to experience slowdowns.
Process Limits: CloudLinux allows administrators to limit the number of processes a user can run. This can help to prevent a single user from running too many processes and causing other users to experience slowdowns. Administrators can set limits for both the number of processes and the number of child processes that a user can run.
Entry Processes Limits: CloudLinux allows administrators to limit the number of entry processes a user can run. This can help to prevent a single user from running too many entry processes and causing other users to experience slowdowns. Administrators can set limits for both the number of entry processes and the number of child entry processes that a user can run.
Setting Cloudlinux Limits using cPanel/WHM Package Feature.
Setting CloudLinux limits in cPanel for an individual package can be done in a few simple steps:
- Log in to your cPanel account.
- In the “Account Information” section, click on “Package”.
- Select the package that you want to set limits for.
- In the “Edit Package” section, scroll down to the “CloudLinux Resource Limits” section.
- In this section, you will see the various limits that can be set using CloudLinux, such as CPU limits, memory limits, I/O limits, process limits, and entry process limits.
- To set a limit, simply enter the desired value in the appropriate field. For example, to set a CPU limit of 50%, you would enter “50” in the “CPU Limit” field.
- Once you have set all of the desired limits, click on the “Save” button.
- The new limits will be applied to the package immediately.
Setting Cloudlinux limits per package using the "Cloudlinux Manager."
Setting CloudLinux limits per package in WHM (Web Host Manager) using CloudLinux Manager can be done in a few simple steps:
- Log in to your WHM account.
- In the “CloudLinux” section, click on “CloudLinux Manager.”
- In the CloudLinux Manager interface, navigate to the “Limits” tab.
- In this tab, you will see the various limits that can be set using CloudLinux, such as CPU limits, memory limits, I/O limits, process limits, and entry process limits.
- To set a limit for a specific package, select the package from the list and click on “Edit”.
- In the “Edit Package” section, you will see the various limits that can be set for the selected package.
- To set a limit, enter the desired value in the appropriate field. For example, to set a CPU limit of 100%, you would enter “100” in the “SPEED Limit” field.
- Once you have set the desired limits, click on the “Save” button.
- The new limits will be applied to the package immediately.
Setting Cloudlinux limits per package using the Cloudlinux CLI
Setting CloudLinux limits per package in cPanel using the CloudLinux CLI (Command Line Interface) can be done by running the appropriate commands in the terminal. Here are the basic steps:
- Log in to your server via SSH.
- Run the command “lvectl package-list to see the package’s current limits.
- To set a limit for a specific package, run the command:Â
lvectl set --
- For example, to set a CPU limit of 100% for a package named “mypackage,” you would run the command:
lvectl set mypackage --cpu 100
- To view the limits for a specific package, run the command:
lvectl package-list |grep
- To remove a limit for a specific package, run the command:
- Repeat steps 3-5 as needed to set limits for additional packages.
lvectl unset --
- Repeat steps 3-5 as needed to set limits for additional packages.
lvectl unset --
Tips
Setting the proper limits can be a little tricky.
- For Shared Hosting, 100% Speed and 1 GB Memory are more than enough for low-cost packages and is a good number to start.
- Premium Packages will work fast with two cores (200% Speed) and 2 GB of Memory
- Remember not all users will use all resources all the time, so is OK to over-allocate resources responsibly.
- IOPS and I/O depend on your storage speed; you can be more generous in resources if you have a fast NVME storage and more restrive if you are using slow disks.