Web Hosting Talk







View Full Version : Scalable control panels?


djbob
12-13-2008, 10:55 PM
Scalable control panels?

Hello all,
I am a major free host that is currently hosting more than 10,000 accounts with about one new account signup every minute on one server. The server is a Core 2 Quad with 8 GB RAM and 1 TB HDD.
We are currently using cPanel. Obviously, this creates scalability issues. We have most of them covered, but there is one major issue that stands out: every time a new account is created, Apache is forced to restart. On our server, this takes a good amount of time.
We currently have account creation daemonized, ie. the new account queue is processed every ten minutes to create new accounts. This results in about a 45 second downtime every ten minutes on the server.
Are there any control panels out there that do NOT restart Apache after every new account creation, or do not utilize vhosts, or are in some way relevant way more scalable than cPanel (please be specific)?
Furthermore, do these control panels support PHP, MySQL, PostgreSQL, Ruby (on Rails), Python/Django, Perl, and ASP.NET (mod_mono)?
Thanks,
djbob

ericgregory
12-15-2008, 02:36 PM
Hi djbob,
Just out of curiousity, what build of cPanel are you currently running? Granted, even our most current builds restart apache, everything in 11.24 (EDGE

TonyB
12-15-2008, 02:55 PM
Have you made sure to opimize the vhost template in cPanel? The default one does a lot of includes which can slow down processing dramatically.
What I am talking about is something like this:
Code:
Include "/usr/local/apache/conf/userdata/*.conf"
Include "/usr/local/apache/conf/userdata/*.owner-root"
Include "/usr/local/apache/conf/userdata/std/*.conf"
Include "/usr/local/apache/conf/userdata/std/*.owner-root"
Include "/usr/local/apache/conf/userdata/std/2/*.conf"
Include "/usr/local/apache/conf/userdata/std/2/*.owner-root"
Include "/usr/local/apache/conf/userdata/std/2/username/*.conf"
It's great for a low number of accounts and adds a lot of flexibility but it can cause problems when you have 1000+ vhosts.
In /var/cpanel/templates/apache(1|2)/ (select the version so for apache2 it would be /var/cpanel/templates/apache2/) you have template files. Make a copy of vhost.default and name it vhost.local. Then modify vhost.local with the following changes:
You can remove the following sets of files from it:
Code:
[% IF file_test('d', '/usr/local/apache/conf/userdata/') -%]
Include "/usr/local/apache/conf/userdata/*.conf"
[% IF vhost.owner -%]
Include "/usr/local/apache/conf/userdata/*.owner-[% vhost.owner %]"
[% END -%]
[% END -%]


Also
Code:
[% IF file_test('d', '/usr/local/apache/conf/userdata/std') -%]
Include "/usr/local/apache/conf/userdata/std/*.conf"
[% IF vhost.owner -%]
Include "/usr/local/apache/conf/userdata/std/*.owner-[% vhost.owner %]"
[% END -%]
[% END -%]
Also
Code:
Include "[% vhost_include_base %]*.conf"
Finally you remove this one as well
Quote:


Include "[% vhost_include_base %]*.owner-[% vhost.owner %]"


Then you just need to run:
Code:
/scripts/rebuildhttpdconf


This should get rid of all the includes and dramatically improve the apache restart times. I do not guarantee it'll work 100% I tested it on one problematic machine. This was quite a while ago so I don't know if it'll still work but it should. This came from our blog so if I missed anything I'm sure it's mentioned in the post http://www.hawkhost.com/blog/2008/01...panel-servers/






__________________Quality Shared, Reseller and VPS SolutionsCpanel/WHM • RvSkins • Fantastico de Luxe • 24/7 SupportPHP5 • Zend Framework • PDO • Ruby On Rails • Subversion • TracHawk Host Inc. Quality Web Hosting Since 2004

djbob
12-15-2008, 09:16 PM
Quote:



Originally Posted by ericgregory


Just out of curiousity, what build of cPanel are you currently running? Granted, even our most current builds restart apache, everything in 11.24 (EDGE

TonyB
12-16-2008, 12:47 AM
Quote:



Originally Posted by djbob


Thanks for your attention Eric. I am running the CURRENT build - version 11.24.2.
Thanks for the response TonyB. However, my VirtualHosts have Includes disabled, along with CustomLogs disabled. Here is an example VirtualHost:
Code:
<VirtualHost 1.1.1.1:80>
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /home/user/public_html
ServerAdmin webmaster@domain.com
UseCanonicalName Off
## User user # Needed for Cpanel::ApacheConf
UserDir disabled
UserDir enabled user
<IfModule mod_suphp.c>
suPHP_UserGroup user user
</IfModule>
<IfModule concurrent_php.c>
php4_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
php5_admin_value open_basedir "/home/user:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule !concurrent_php.c>
<IfModule mod_php4.c>
php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/local/lib/php:/tmp"
</IfModule>
<IfModule sapi_apache2.c>
php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
</IfModule>
</IfModule>
<IfModule !mod_disable_suexec.c>
SuexecUserGroup user user
</IfModule>
ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/


# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/user/domain.com/*.conf"

</VirtualHost>
Would it increase processing time significantly to get rid of all the PHP IfModules and just leave the relevant directives (for suPHP, in my case)?


The includes are the only real heavy hitter. There is litespeed as a replacement to apache that might be worth trying. It works with cPanel so if you like to stick with cPanel it might be a decent solution. It costs some money but I believe it's suppose to have true graceful restarts so it may not have these issues. You do not need a license to match the # of cores especially if you're doing a lot of php. So you could get away with a single or dual license I imagine.





__________________Quality Shared, Reseller and VPS SolutionsCpanel/WHM • RvSkins • Fantastico de Luxe • 24/7 SupportPHP5 • Zend Framework • PDO • Ruby On Rails • Subversion • TracHawk Host Inc. Quality Web Hosting Since 2004

djbob
12-16-2008, 02:44 AM
Thanks for the suggestion. I have heard of litespeed before, but I fear that it would break compatibility with a number of features we offer, ie. Mono, Tomcat, etc. You don't happen to have heard of anyone using litespeed in conjunction with either of those services, have you?

TonyB
12-16-2008, 03:16 AM
Their 4.0 road map has mono listed as a feature and JSP I think they support it but not positive.





__________________Quality Shared, Reseller and VPS SolutionsCpanel/WHM • RvSkins • Fantastico de Luxe • 24/7 SupportPHP5 • Zend Framework • PDO • Ruby On Rails • Subversion • TracHawk Host Inc. Quality Web Hosting Since 2004

HD Fanatic
12-16-2008, 03:24 AM
Try asking them on their official forum: http://www.litespeedtech.com/support/forum/

dazmanultra
12-16-2008, 11:20 AM
I think you're basically finding the limit of cPanel - cPanel isn't really designed to be used in the way you want. It may be you'll need to look into customizing a control panel that already exists or indeed writing your own.





__________________
Darren Lingham - UK Webhosting Ltd. - (0800) 024 2931Clustered Load-Balanced Shared Web Hosting - cloud hosting for everyonehttp://www.tsohost.co.uk - affordable UK based shared web hosting since 2003

DaveDark
12-19-2008, 12:46 PM
Quote:



Originally Posted by dazmanultra


I think you're basically finding the limit of cPanel - cPanel isn't really designed to be used in the way you want. It may be you'll need to look into customizing a control panel that already exists or indeed writing your own.


This is really more so of an issue with Apache. Any box with 10,000 domains in httpd.conf will take the same amount of time to reboot regardless of whether it is running cPanel or not. If your server specs can handle 10,000 users/domains then there should be no issues with any of the cPanel applications on the system.
As pointed out before, using an alternate web server is hitting the root of the issue. If you want to achieve higher density, you're going to have to ditch Apache for something more lightweight and focused on speed. Otherwise, you'll need to put in a second server. If you decide to go with a different control panel, be warned: if it's using Apache, you'll run into the same issues.





__________________
-Dave
cPanel Inc.
Need to submit a support request for your cPanel server? Go here