1

I'm very new to hosting/server administration and my employer ask me to use this chance to learn and find a way to update our current hosting setup.

Our current setup was one EC2 instance that hosted multisite, it was being manage through Cpanel.

I did some research on AWS and this was new setup I'm trying to implement. On a high level this is the setup: We have a Load Balancer to round robin between two EC2 instances, the files for the website(s) is on a Network File System. The instances are also connected to a Relational Database. I might be over my head on this, but if there's a better solution please let me know.

Mini question on Load Balancer:

My Load balancer is listening on port 80 and 443. I added multiple SSL Certification into the https listener and it should be able to determine which certificate through SNI. Both of them are forwarding it to the same target group which the health check protocol is http. Something doesn't seem to sit well with me for this. If traffic come from port 443 connection wouldn't I just forward it to one of instance through port 80 instead of 443? It seem to be working for a very simple website (it just redirect to another website) though, so I didn't put too much thought on it.

This is the test result from webpagetest.com. I'm not sure on how to fix the TTFB given the ideal time is < 100ms where mine is 3036ms.

I think it might be because the EC2 instance I'm using now is the micro (free tier), so it might just be hardware issue. But given I only have one website running right now, I don't think this is an issue?

Or it might be because I've set the virtual host wrong? I've setup a virtual host configuration file like so:

<VirtualHost *:80>
ServerName purpose-built.com
ServerAlias www.purpose-built.com
DocumentRoot /var/www/html/efs-mount-point/purpose-built/public_html
ServerAdmin admin@purpose-built.com
<Directory /var/www/html/efs-mount-point/purpose-built/public_html>
AllowOverride All
</Directory>
</VirtualHost>

Any direction on how to tackle this issue would be appreciated.

Radizzt
  • 11
  • 1
  • 2
  • I've tried to optimize the page more through [google page insight](https://developers.google.com/speed/pagespeed/insights/?url=purpose-built.com&tab=desktop) (was like an 8/100 before). It did help a little bit, but not enough obviously. In terms on thing on the server itself, nothing really outside of updating all the package through `yum update -y`. Not that I don't want to, I'm just not sure where/how to start. Any advice? – Radizzt Oct 25 '17 at 14:17
  • Good to hear you made some progress on your issue! I'd recommend taking a look at some of the other AWS services for hosting your site if you want to keep learning. If everything was static (i.e. no database needed) then I'd have recommended serving your site via S3. However, one good option that might work and would require less maintenance from yourself is Elastic Beanstalk. This makes it much easier to build and manage a service whilst avoiding some common pitfalls of doing it yourself. It depends on your site though - you haven't mentioned what the site is, tech it uses, or other info. – shearn89 Dec 21 '21 at 15:14

1 Answers1

0

So it turned out that my instance was at 90% steal time from the top command. Stopping the instance and rebooting it fixed the issue.

It's still slow, but is workable (down to 2.4 seconds)

Radizzt
  • 11
  • 1
  • 2