How to separate the website into different hosts and expand the expansibility? (please enter if you have experience) Linode | Cloudflare | Apache

use Linode host, ubuntu16.04 apache + php + mariadb to set up a website, and cloudflare DNS
currently need to have a shunt mechanism, but I don"t know how to do it.
(currently using Linode 4G scheme)
would like to ask experienced people how to proceed?

there are two different kinds of websites, one is e-commerce and the other is blog (and because the traffic continues to increase, the CPU utilization rate of blog alone has exceeded 33%, and e-commerce has not yet started operation)
while the e-commerce domain is: shop.XXX.com, blog is XXX.com, (implemented using htaccess)
although the two materials themselves are connected, the same host and database There are even a lot of "shared" program scripts (it should be said that it is difficult to "take apart" two different websites)
so it hurts a little bit...
I would like to ask how to move the two sites to two different hosts?
or is there a similar way to achieve a "diversion" mechanism, at least not too much problem when the number of visitors suddenly "explodes"?

have you heard a saying that Facebook may even be a host with a button? )
but it is not impossible. After all, it is reasonable to process 100 million requests per second.
what would you do? Or how to share a lot of experience?


Apache is not suitable for directly handling heavy traffic access. You can do a load balancing layer on top of Apache

.

diversion:
1. I don't know whether the code of your two websites is the same, regardless of the difference. To divert, you need at least two servers
2, server A shop.XXX.com , server B shop.XXX.com , and DNS parse streaming

Traffic skyrocketing:
1. Do a load balancing layer and only do proxy forwarding. Whether it is steady or burst, you can use
2. You can achieve load balancing on DNS , estimate traffic, dynamically expand service resources, resolve to the nearest server according to the nearest principle
3, use containerized deployment, estimate traffic, and dynamically expand service resources

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bc6659-44d89.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bc6659-44d89.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?