Active processes on Shared and Reseller Hosting servers are the running applications and tasks that consume server resources. These processes play a crucial role in the functionality of websites and applications hosted on these servers. However, there are instances where terminating active processes becomes necessary to maintain optimal server performance and prevent resource overuse.
Active processes include running scripts, database queries, and other server-related activities initiated by websites hosted on the server. While these processes are essential for the proper functioning of websites and applications, they can sometimes lead to resource exhaustion, resulting in slow performance and potential service disruptions.
In a shared hosting environment, multiple websites share the same server resources. If a website's active processes consume an excessive amount of CPU, memory, or other server resources, it can negatively impact the performance of other websites in the account. Terminating such resource-intensive processes helps restore balance and maintain improved resource distribution.
Malicious scripts or processes can exploit vulnerabilities and compromise the security of the hosting environment. Terminating suspicious or unauthorized processes is a crucial step in safeguarding the server and its hosted websites from potential security threats. If a hosting account is hacked/compromised, then ending suspicious processes may be required as one of the steps to stop the suspicious activity.
You can employ tools like ps faux or top -c to list active processes on your Shared or Reseller Hosting server. Open Terminal and enter the command to view the list of processes.
Go to cPanel > Terminal > Run one of the following commands:
ps faux
top -c
Before killing any processes while working with a hack-related case, double-check the existing cron jobs in cPanel > Cron Jobs menu. If you notice any suspicious cron jobs (or there are cron jobs you are unsure of), you should remove them to avoid any malicious processes.
Once a specific process causing issues is identified, you can terminate it using the kill -9 PID command. Replace "PID" with the actual Process ID obtained from the previous step. For example:
kill -9 1234
Here, "1234" represents the PID (process ID) of the process to be terminated.
To terminate all processes except the essential system ones, you can use the following command:
This command uses a combination of ps, awk, grep, and xargs to list all processes' PIDs and then force kill them.
Next, we need to identify the MySQL processes running.
It is not technically possible to identify all the MySQL processes running within the account at the same time with Shared and Reseller Hosting, so this needs to be done separately for each MySQL database user.
Go to Terminal in your cPanel, then run the following command:
mysql -u $MYSQL_USER -p -e "SHOW PROCESSLIST;"
Do not forget to change “$MYSQL_USER” to the particular database user.
Then you will need to enter the password related to the database user.
Terminating MySQL processes
The user is not able to end all MySQL processes, so if you need to do this for a particular database user, contact our customer support team via Live Chat or by submitting a ticket to the Hosting department.
While terminating processes in cPanel can help address performance issues, it's important to understand the potential consequences and exercise caution. Here are some considerations regarding the consequences of killing processes in cPanel:
Data integrity. Killing processes abruptly can potentially lead to data integrity issues, especially if a process is in the middle of writing or updating data. Ensure that the processes being terminated do not involve critical database operations.
Incomplete transactions. Terminating a process may result in incomplete transactions, leaving databases in an inconsistent state. In extreme cases, this could lead to data corruption or data loss.
Service disruption. Ending certain processes may temporarily disrupt services associated with those processes. For example, terminating a MySQL process could briefly impact database-related functionalities on your website.
Unsaved changes. If a process is responsible for managing configuration or settings, terminating it abruptly may lead to unsaved changes. This could affect how certain features or applications operate.
Resource allocation. While terminating processes can free up resources, it may not solve the root cause of resource consumption. It's essential to identify and address the underlying issues to prevent similar problems in the future.
Application stability. Terminating processes associated with web applications might affect their stability. It's crucial to understand the relationship between processes and applications to avoid unintended consequences.
Logging and monitoring impact. Ending processes might affect the logging and monitoring capabilities of certain applications. Ensure that critical logs and monitoring systems remain functional after terminating processes.
It may be necessary to terminate processes in extreme cases, like resource overuse or hacks, despite the potential negative consequences.
Always back up your data before making significant changes, especially when dealing with databases. Refer to the following instructions on how to create and restore backups in cPanel.
If possible, consider stopping services gradually rather than forcefully terminating processes in a controlled shutdown. If you are sure that some part of your database/website is creating a malicious process, such as a specific plugin or theme, you can disable it to prevent such processes from spreading. It is recommended to consult a specialist on any suspicious processes.