Managing active processes on Shared and Reseller hosting

Understanding active processes
Reasons to terminate active processes
How to identify and end active processes on Shared and Reseller Hosting
Possible consequences of killing processes in cPanel
Best practices to minimize the effect of the consequences

Understanding active processes

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.

Reasons to terminate active processes

Resource overutilization

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.

Security

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.



How to identify and end active processes on Shared and Reseller Hosting

  1. Check you have SSH enabled. Follow our guide on how to enable SSH for your cPanel account for Shared Hosting.
    If you need to enable SSH within your reseller account, contact our customer support team via Live Chat or by submitting a ticket to the Hosting department.

  2. 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

  3. 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:

    ps aux | grep -v 'bin/bash' | awk '{ print $2 }' | grep -v PID | xargs kill -9

    This command uses a combination of ps, awk, grep, and xargs to list all processes' PIDs and then force kill them.

  4. 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.



  5. 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.

Possible consequences of killing processes in cPanel

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. It may be necessary to terminate processes in extreme cases, like resource overuse or hacks, despite the potential negative consequences.


Best practices to minimize the effect of the consequences

  1. 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.

  2. 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.

    You can also try putting your website in maintenance mode to check if the specific processes are not recreated.

  3. Monitor the impact of process termination closely and be prepared to troubleshoot any issues that may arise.

That’s it!
Updated
Viewed
1611 times

Need help? We're always here for you.

notmyip