The Hive configuration includes several limits that are included by default in it. Some of those can be modified via WHM -> Plugins -> 1H Software -> Hive Configuration. Others you should manually change on the server should you need to do so. It is also possible to apply specific limitations for a single user only. We will address each of the cases below.
Hive Default Limits
As mentioned above there are several limitations imposed by the Hive software. The default limits are listed below:
- CPU Time Limit - 120 CPU ticks. Each user process cannot run more than 120 CPU seconds/ticks. For better understanding what CPU Tick is we recommend to check the CPU Time article.
- Memory Limit - 260 MB. Each user cannot use more than 260MB memory for a single process at any given time.
- Processes Limit - 40. No more than 40 simultaneous processes can be ran by a user.
- Open Files - 30. No more than 30 files can be simultaneously opened by a single process.
- Max File Size - 2000MB. The maximum size of a file that can be created or opened by a user process is 2000MB.
- Maximum Load Limit - Before executing each script the Apache server checks the system load. If it is higher than the MaxLoadLimit value the web page will return Internal Server Error. By default the MaxLoadLimit value is set to 20.0 for mod_hive.
How to Change Default Hive Limits
It is possible to modify most of the options during the Hive Installation. If Hive is already installed limitations can be altered but via WHM or manually editing the configuration file.
Change Global Limits via WHM
The Hive configuration is accessible via WHM -> Plugins -> 1H Software -> Hive configuration
Limits can be easily modified as explained in the Hive Configuration article.
Change Limits Manually
If for some reason you need to manually modify the Hive limits you can do so directly modifying the Hive configuration file. The limits are defined in the following file:
You should also alter this file in case you need to modify limits for a single user only.
Change Limits per User
It is really easy to apply specific limitations per user. All you need to do is add a single line for the user in the Hive limits configuration file. The line should follow this syntax:
- user is the actual username
- mem is the desired Memory limit
- cputime is the desired CPU Time limit for the user
- numprocs is the maximum allowed number of processes for the user
- max_file_size denotes the max File Size
- and max_files is the maximum Files that can be simultaneously opened by the user
# user231 user231:92000000:100:40:200000000:120 # user435 user435:220000000:140:60:800000000:300
The # indicates a comment line.
Change Global Limits Manually
Manually changing the default global limits is very similar to modifying the limits for a single user. The only difference here is that you need to specify 00 as username. The 00 stands for default and if such line is present in the Hive limit configuration file /usr/local/apache/conf/rlimit-config those limits will be applied to each user that does not have a record for custom limits in the file.
# replacing the default limits 00:920000000:120:40:2000000000:256
How to change Maximum Load Limit
The Maximum Load Limit for the server is defined in the /usr/local/apache/conf/includes/1h.conf file. For example:
Important: You can change this value according to your needs. However, please note that it is of utmost importance to not set the value too low. Otherwise you are risking to render websites on the server inaccessible. This value is low enough and it is advisable to consider only increasing it in case a server is temporarily keeping too high load and not lowering below the default value at any circumstances.