load balance your workloads for webserver
-
How to make a webserver handle work loads like crazy. Wordpress is the new thing. how do you make these server scream (fast) Like WPENGINE.
-
THere are a lot of steps to this. What we need to do is move to a scalable, modern architecture, which WordPress obviously supports. So first we need to identify our layers; so from the bottom up:
- Raw Storage
- Database
- Application (WordPress)
- Memory Cache
- Front End Proxy (Normally nGinx)
- Load Balancer
-
You have two storage needs, one is for the databases. The other is for files. Commonly you would handle files either by replicating all file storage to each node (fastest but most limiting) or share it from a high reliability NFS environment.
For the databases you want screaming fast local storage, this is where you need SSD. You don't want this replicated in any way.
For NFS file serving, you want something resilient, like Exablox or Gluster.
-
Database. Obviously MariaDB is your platform here. You'll need to cluster this at the database level, Galera is the go to tool here.
-
so right now I am using . easyengine. for my own wordpress site. cpanel for all my shared stuff. the shared websites are slow as crap. I allowcated 4quad 8gb ram to server iops are threw the roof at times.? Granted some are not connected to cdn. but.. still Iops to be very high. How to big compaies run wordpress sites with no problems. and fast as hell.
-
Then you will want application servers. I believe Apache is still preferred for WordPress, but I'm easily wrong here. You want the fastest, accelerated PHP that you can get. Running old PHP will really hurt. You need to tune this layer a lot.
-
Because of the distributed nature of large scale web hosting, you need a distributed memory cache like memchached to keep your systems fast and scalable. In really large hosting, this is its own layer on its own servers.
-
So right now. I am running NGINX, MARIADB, MEMCACHED, And Some other stuff. my website runs pretty fast. i know there is some tweaking.
-
NGinx is commonly used than anything else for front end caching. This is what will handle any local static file serving needs that you might have. Hopefully you will have a good CDN layer to offload as much as possible. Your NGinx proxy layer is basically your own CDN to keep that load from hitting your PHP application servers that are busy generating WP pages.
-
Then out front you need load balancing. If you are on Amazon, they will normally use F5 BigIP gear for that. That's what the biggest shops use. Everyone else uses HA-Proxy. So assume an entire layer of redundant HA-Proxy hosts.
-
ok. I want to build a template and then spin these machines up when ever someone orders new wordpresss hosting.
-
Then, finally, at the DNS layer, you have a DNS host that will round robin amongst your HA-Proxy hosts to keep any single load balancer from being overwhelmed by the load either. Basically load balancing for your load balancers.
-
@matthewaroth35 said in load balance your workloads for webserver:
So right now. I am running NGINX, MARIADB, MEMCACHED, And Some other stuff. my website runs pretty fast. i know there is some tweaking.
How many VMs are you running? A minimal full install is normally fifteen VMs, three for each layer and then you scale up from there.
-
That doesn't include the NFS hosting if you need that. If you go that route, you'd be looking at another two VMs for that. So seventeen to get started.
-
This is the kind of architecture that you use for large, fast, scalable hosting. You start small with just the seventeen then you monitor closely to see which layers are having issues. If the Apache / PHP layer is getting overwhelmed, then you add more nodes to that layer. So if three isn't enough you go up to four or five. You only grow the layers that are bottlenecking.
-
This is where it is really handy to be working with a tool set like Ansible, Chef, Pupper or Salt so that you have simple methods for rapidly building new hosts.
-
@matthewaroth35 said in load balance your workloads for webserver:
I allowcated 4quad 8gb ram to server iops are threw the roof at times.?
How many instances like that do you have? Have you looked to see if that many cores makes sense? It's not a crazy number, but I'd expect dual core web servers, normally.
You did not mention the storage that you are using. IOPS are probably from the database being hit. Is there a heavy write load? Is there enough cache? 8GB could be really tiny depending on how many sites you are trying to host there.
-
And, of course, a huge question is... do you expect to load balance the environment, or each site? A lot of big hosts have each host running on a single node only. So you don't actually load balance the big layers but rather have stacks for them, which is very different. Load balancing would be more common with a single high performance site, rather than a web hoster.