Creating Subdomains is taking over one minute.

wanted4life

Member
Apr 17, 2010
12
0
51
Romania, bucharest
cPanel Access Level
DataCenter Provider
Hello.
I have a problem with the last cpanel version.
About 8-10 months ago, I was able to create subdomains very fast.
But now, I installed even a fresh centos and a fresh cpanel and I added a domain.
Then I was trying to add subdomains.
From cpanel and with a php script too.

But the only problem is that after I create 500 subdomains, is taking about 90 seconds to complete the adding of one subdomain.
After 1200 subdomains added, it takes about 2 minutes to add one subdomain.

Please give me a solution to be able to add subdomains very gast.
I also used nginx and still the same problem.

I need to add on the server about 2000 domains and each one needs to have about 100 subdomains.
So if I wait 2-3-4-5 minutes for each subdomain, it will be done until 2099.

What is different with the new cpanel?
 

Sys Admin

Well-Known Member
Apr 29, 2007
67
0
156
cPanel Access Level
Root Administrator
Well, cPanel needs to create the vhosts for these subdomains and rebuild your httpd.conf then restarting apache which is going to take sometime considering the number of vhosts you have. What's your current server's available resources/specifications? Can you provide a "top" stat while adding a new subdomain?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Yes, it sounds like this could be a resource issue on your system. Could you let us know the hardware specifics of your server?

Thank you.
 

wanted4life

Member
Apr 17, 2010
12
0
51
Romania, bucharest
cPanel Access Level
DataCenter Provider
Hi. unfortunately i am reinstalling the server at this moment because another problem happend with my cpanel servers.
I must mention that i have 5 different cpanel servers.

The problem above i experiment inside all of the servers.
I also installed a fresh centos with fresh cpanel to make sure that is not from other places and the problem persists.

Regarding the resourcess, the lowest resourcess i use on these servers are:
8 core cpu at 2,4ghz
16GB of DDR3
intel 530 series SSD ( over 500MB/s ) with plenty of space.


So is not a matter of resourcess because i used to have 7000 8000 subdomains on a server with 4 cores and 2gb of ram and i could add over 30 subdomains per minute even when the server had 8000 subdomains already added.

With this server, i installed fresh centos and fresh cpanel, added one domain and started to add subdomains. the first 200 subdomains took 5 seconds each.
After 200 subdomains it takes 15 seconds/subdomain
and after 1200 it takes about two minutes per subdomain.

is there anyway to put all the subdomains insite a file or to generate all the needed files with php and then execute a php script to build them all/
For exemple, i already made a script that generates me /var/cpanel/userdata/user/subdomain.domain.db files when i need them so i don't modify them manyally ( i use this to allocate dedicated IPs to subdomains and this is working just fine.

can i do something similar to create the subdomains?
i mention that adding A entries in /var/named/domain.db is also not an issue.


Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
I would not expect a script to work any faster because the Apache configuration file will still need to be rebuilt. I suggest opening a support ticket for a server with the slowness issue so we can reproduce the problem and look for any specific causes. You can open a support ticket via:

Submit A Ticket

Please post the ticket number here so we can update this thread with the outcome.

Thank you.
 

wanted4life

Member
Apr 17, 2010
12
0
51
Romania, bucharest
cPanel Access Level
DataCenter Provider
Hello.
Thank you for your reply.
When i say a script, i want to make a script that will allow me to give a list of subdomains and that script will fill all the necessarily files and then will rebuild the apache config only once.

So instead of rebuilding apache after every subdomain i create, i want to be able to rebuild the apache once when i create 1000 subdomains or 10.000 subdomains).

Theoretically i know how to do it, but i need confirmation from cPanel that this will work just fine and an advice of what files i must modify and how to modify it exactly.

So what I mean is that I can make a script in PHP or curl or PERL... doesn’t really matter which will modify these files:
/var/cPanel/userdata/username/nameofeachsubdomain.db (so I can generate all these files with everything they need.
/var/named/user.db (to add the a entries
And then I must fill httpd.conf (which one exactly because I have many from cPanel).
So what should I fill in httpd.conf and how exactly (I mean I need exact an example and to tell me where to write it exactly … at the bottom of the file or after certain line/.. etc. . .)
So after I generate 10.000 files in userdata, after I fill a entries, after I fill httpd.conf I run rebuild of apache and voila, I have 10.000 subdomains in a few seconds plus the time of rebuilding apache, which it should not take longer then 2 minutes, but it can also take one hour if necessarily because I don’t care, is way much faster then rebuilding apache 10.000 times if using cPanel to create subdomains.

So the problem would be, which files should I modify exactly? (A list of them and exactly example of what to write inside).
What to do exactly to avoid rewriting of any file in case of I update cPanel or apache
is there any difference if I use NGIX too? If yes, which would be the difference
all I need are the subdomains WITHOUT www in front of each subdomain, without ssl records or any other records that has nothing to do with just a normal access of the subdomains. (To avoid filling httpd.conf with unnecessarily information so I can put more and more subdomains on the server).
Back in the past I was able to put only about 8000 subdomains in one server, how can I put many without using nginx/ if I use nginx for cPanel, how many can I add?


Regarding the support ticket, is not necessarily because is not just my server, you can test it on any server with the latest cPanel. I just tested on an 8 core server with 16GB of ram and a very good SSD and still the same.