Creating and terminating user account taking too long

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

I am encountering an issue with the creation and deletion of accounts on a few servers. I removed one account using the command line. The line that the process was stuck is:


Removing HTTP Virtual Hosts......

Here is the output from the command line:

Code:
[[email protected] logs]# time /scripts/removeacct somethingdomain
Are you sure you want to remove the account "somethingdomain", and DNS zone files for the user? [y/N]? y
Running pre removal script (/usr/local/cpanel/scripts/prekillacct)......Done
Collecting Domain Name and IP...info [removeacct] rebuild_files: working on domain (something.domain.com)
info [removeacct] php-fpm: rebuild_files: restart fpm services for Apache
info [removeacct] php-fpm: fpm services restarted
...Done
Locking account and setting shell to nologin......Done
Removing Sessions.........Done
Killing all processes owned by user......Done
Removing Suspended Info.........Done
Removing Web Logs......Done
Removing Bandwidth Files......Done
Removing any unneeded pending interface locks......Done
Removing Email Sending Limits Cache......Done
Removing DKIM keys......Done
Removing Crontab......Done
Removing IPv6......Done
Removing external authentication links …......Done
Running AutoSSL account deletion logic …......Done
Removing domain TLS resources …......Done
Removing HTTP Virtual Hosts......Done
Removing ftp Virtual Hosts......Done
Removing user's web content directory symlinks......Done
Removing MySQL databases and users......Done
Revoking MySQL Privs.......Done
Removing PostgreSQL databases and users......Done
Removing Two-Factor Authentication entries..........Done
Removing API Token entries..........Done
Removing User & Group..........Done
Removing DNS Entries......Done
Removing Email Setup......Done
Removing mailman lists......Done
Updating Databases......Done
Removing bandwidth limits......Done
Removing Counter Data......Done
Adding IP back to the IP address pool......Done
Removing user's cPanel Databases & Updating......Done
Reloading Services......Done
Removing mail and service configs......Done
Sending Contacts......Done
Updating internal databases......Done
Running post removal scripts (/usr/local/cpanel/scripts/legacypostkillacct, /usr/local/cpanel/scripts/postkillacct)......Done
Account Removal Complete!!!......Done
info [removeacct] User 'somethingdomain' removed.
User: somethingdomain
Domain: something.domain.com
Removed the following non-SSL virtual hosts: something.domain.com
Removed the following SSL virtual hosts:

Listing MySQL dbs for removal.
Fetching MySQL DB Owner information.

Successsomething.domain.com => deleted from server04.
something.domain.com => deleted from dns2.

something.domain.com => deleted from dns1.

Removing /etc/valiases/something.domain.com
System has 8 free ips.

somethingdomain account removed

real    1m57.376s
user    0m0.615s
sys    0m0.419s


The same thing applies when creating new accounts. I've added a screenshot from the WHM interface that shows the same httpd.conf problem.

Is anybody experiencing the same issue? Is there a solutions to this? The problem is not reproducible each time. Sometimes it takes 10 seconds, sometimes 100.

Thank you.
 

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

This applies even if I create a new account and then try to delete it, so there is no selective treatment only for some users (no chattr permission set). The account is new, so this means no chattr and no load on server (as there are only a few users). My `uptime` command outputs the following:

Code:
 13:44:20 up 89 days,  1:50,  2 users,  load average: 0.90, 0.95, 0.99
Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

Could you verify which version of cPanel is installed on this system? You can check with the following command:

Code:
cat /usr/local/cpanel/version
Thank you.
 

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

Sorry for the delayed answer. The version is:

11.64.0.22

I just recreated the account and removed it. Both operations were done from the command line. It took over 1 min to erase one empty account. The server runs only SSDs, so there isn't an I/O bottleneck.


Code:
[[email protected] ~]# time /scripts/removeacct subdomain
Are you sure you want to remove the account "subdomain", and DNS zone files for the user? [y/N]? y
Running pre removal script (/usr/local/cpanel/scripts/prekillacct)......Done
Collecting Domain Name and IP...info [removeacct] rebuild_files: working on domain (subdomain.mydomain.com)
info [removeacct] php-fpm: rebuild_files: restart fpm services for Apache
info [removeacct] php-fpm: fpm services restarted
...Done
Locking account and setting shell to nologin......Done
Removing Sessions.........Done
Killing all processes owned by user......Done
Removing Suspended Info.........Done
Removing Web Logs......Done
Removing Bandwidth Files......Done
Removing any unneeded pending interface locks......Done
Removing Email Sending Limits Cache......Done
Removing DKIM keys......Done
Removing Crontab......Done
Removing IPv6......Done
Removing external authentication links …......Done
Running AutoSSL account deletion logic …......Done
Removing domain TLS resources …......Done
Removing HTTP Virtual Hosts......Done
Rebuilding Mail SNI configuration......Done
Removing ftp Virtual Hosts......Done
Removing user's web content directory symlinks......Done
Removing MySQL databases and users......Done
Revoking MySQL Privs.......Done
Removing PostgreSQL databases and users......Done
Removing Two-Factor Authentication entries..........Done
Removing API Token entries..........Done
Removing User & Group..........Done
Removing DNS Entries......Done
Removing Email Setup......Done
Removing mailman lists......Done
Updating Databases......Done
Removing bandwidth limits......Done
Removing Counter Data......Done
Adding IP back to the IP address pool......Done
Removing user's cPanel Databases & Updating......Done
Reloading Services......Done
Removing mail and service configs......Done
Sending Contacts......Done
Updating internal databases......Done
Running post removal scripts (/usr/local/cpanel/scripts/legacypostkillacct, /usr/local/cpanel/scripts/postkillacct)......Done
Account Removal Complete!!!......Done
info [removeacct] User 'subdomain' removed.
User: subdomain
Domain: subdomain.mydomain.com
Removed the following non-SSL virtual hosts: subdomain.mydomain.com
Removed the following SSL virtual hosts: subdomain.mydomain.com

Listing MySQL dbs for removal.
Fetching MySQL DB Owner information.

Successsubdomain.mydomain.com => deleted from server04.
subdomain.mydomain.com => deleted from dns2.

subdomain.mydomain.com => deleted from dns1.

Removing /etc/valiases/subdomain.mydomain.com
System has 8 free ips.

subdomain account removed

real    1m7.879s
user    0m0.627s
sys    0m0.384s


Thank you.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

The ticket # is 8520305.

Thank you.
To update, it looks like the delay stems from CageFS functionality taking an extended amount of time during the account termination process.

Thank you.
 

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

I also replied to the cPanel ticket and I don't think that CageFS is the one that delays the account termination. Please see my answer from the ticket.

Regards.
 

i-Strategi

Member
Mar 14, 2016
13
1
3
Denmark
cPanel Access Level
Root Administrator
Twitter
I have the same issue. Also had it before i started using CageFS so im very sure that's not the issue.

Did you manage to locate the issue?

@OP - why answer to ticket? Should have been answered here so we (who has the same issue) can read the solution instead of asking again.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
I have the same issue. Also had it before i started using CageFS so im very sure that's not the issue.
Hi @i-Strategi,

Support ticket 8520305 looks to have been an isolated issue with LiteSpeed that we were unable to reliably reproduce. If you notice delays during the account or termination process, please feel free to open a support ticket using the link in my signature so we can take a closer look at an affected system. You can post the ticket number here and I'll update this thread with the outcome.

Thank you.
 

Havri

Well-Known Member
Oct 28, 2013
86
19
8
cPanel Access Level
Root Administrator
Hello,

I've reviewed the ticket from cPanel support and it seemed that two services were using file-lock on the httpd.conf file. Of course, that was the issue then. After updating cPanel and Litespeed, all went well.

What you can do is strace the account termination process from the command line:


Code:
strace -tt -T -ff -o my_output.file -s 4096 -f /scripts/removeacct my_domain
Of course, this is just an example. You can tweak it as you'd like. Maybe this will help you find the problem.

Good luck.
 
  • Like
Reactions: cPanelMichael

Bidi

Well-Known Member
Oct 3, 2012
108
11
68
Romania, Transilvania
cPanel Access Level
DataCenter Provider
Hello guys,
I`m facing some sort of issue but strange one.
Mine one i think is fast when creating account and delete them but the big problm is when creating/terminate account my entire websites they dont work for aroung 1 minute.

This is start to be big pain when daily make 20-30 operations, the customers start to complain about this and i dont understand why it makes like this in the last mo. Even me i start to get angry cuz i have to allways whait and whait lot of time so the websites start to work again.

This happen even if i make in the night time operations and the load is 1-2% even in the day when load is 3-4%

justtesting account removed

real 0m9.872s
user 0m1.066s
sys 0m0.321s

Can someone give me a hint or sompting where to and what to check ?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello @Bidi,

Can you open a support ticket so we can take a closer look at the affected system? You can post the ticket number here and we will link this thread to the ticket.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello Everyone,

I'd like to follow-up with anyone here that reported poor performance when creating and terminating accounts.

cPanel & WHM version 76 offers significant performance improvements in this area of the product that should alleviate the concerns reported on this thread. We've also made some additional performance improvements in version 78 (available in the CURRENT release tier at this time), with even more improvements planned as part of version 80.

Feel free to reply to this thread with feedback on the performance of account creation and termination upon upgrading to these versions.

Thanks!