0

**Hello everybody ,

I making SaaS app like Shopify and ecwid , user create store within 10 mins , once he register he get automatic subdomain with SSL and can add products and payment methods, categories ... etc.

We use Laravel + Mysql + Apache + Cpanel with dedicated server . We have dedicated server with (AMD Ryzen™ 7 3700X,64GB RAM) with Centos 7 + WHM/CPANEL

App now it almost done and it is in test stage . Currently user gets subdomain automatically but if user needs to add his custom domain we add this domain manually as addon domain in app cpanel account or automatically via Cpanel API . I see that when I add one addon domain Apache httpd.conf size increases every store can add up to 5 domains.

For example currently we have 20 addon domains so we httpd.conf size = 144KB if addon domains increased to 200 this means httpd.conf size will be 1440KB (1.2 MB) if addon domains increased to 2000 this means httpd.conf size will be 14400KB (14 MB) if addon domains increased to 10,000 this means httpd.conf size will be 72000KB (72 MB) this mean if we have 10k domains and 10,000 visitor at same time it will request httpd.conf which is 72 MB about 10,000 times it will make server down or very slow .

1.- Am I right with my calculations?

2.- If I decided to make load balance this will solve the problem ? (consider that httpd.conf will be have same addon domains for all server in our network )

3.- If we used Nginx this will solve the problem ?

4.- What is the best server for this type of apps (Nginx or Apache ) ?

thanks**

Edd
  • 47
  • 4
  • Why do you believe that Apache reads httpd.conf on each requests? – vidarlo Mar 04 '22 at 20:53
  • Does this answer your question? [Can you help me with my capacity planning?](https://serverfault.com/questions/384686/can-you-help-me-with-my-capacity-planning) – vidarlo Mar 04 '22 at 20:53
  • by research i see NGinx it caches domains IN hash table in L1 ,L2 or L3 memory , but i don't know how apache works for this point what happen when we have 10k domains ? – mo saleh Mar 04 '22 at 21:42
  • @vidarlo ...... – mo saleh Mar 06 '22 at 10:50
  • @mosaleh Maybe try Google search for 'apache tutorial' ? – Wilson Hauck Mar 07 '22 at 22:45
  • Stop adding domains to httpd.conf. Just have your server send all requests to the same application, and handle the hostname at the application level; look up the correct client for the hostname in your database. – ceejayoz Mar 16 '22 at 16:25

0 Answers0