How to Connect to Private EC2 Instances without an AWS Bastion Host

So you’ve got an Amazon Web Services (AWS) EC2 private instance running in a private network. Things are going well until you need to connect to your EC2 instance over the Internet. Now what? You need to set up an AWS bastion host with a public elastic IP address.

But wait, do you actually need a bastion host? Nope. In fact, you can use AWS Systems Manager (SSM) to take the place of a bastion host instance. You can then use the AWS CLI to connect to fleets of EC2 instances without exposing another host to the Internet!

Let’s dig in and see what you can do with SSM to connect to your EC2 instances with the AWS CLI! No jump server necessary.

#cloud #aws #aws ec2

What is GEEK

Buddha Community

How to Connect to Private EC2 Instances without an AWS Bastion Host
Rory  West

Rory West

1621745280

Create EC2 instance from AWS Console

What is EC2 Instance?

Secure and resizable compute capacity in the cloud.

Amazon Elastic Compute Cloud ( Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.

In this article let us see how to create On-demand EC2 instance from Console.

#create-ec2-instance #aws-ec2-instance #ec2-instance #amazon-web-services #aws

How to Connect to Private EC2 Instances without an AWS Bastion Host

So you’ve got an Amazon Web Services (AWS) EC2 private instance running in a private network. Things are going well until you need to connect to your EC2 instance over the Internet. Now what? You need to set up an AWS bastion host with a public elastic IP address.

But wait, do you actually need a bastion host? Nope. In fact, you can use AWS Systems Manager (SSM) to take the place of a bastion host instance. You can then use the AWS CLI to connect to fleets of EC2 instances without exposing another host to the Internet!

Let’s dig in and see what you can do with SSM to connect to your EC2 instances with the AWS CLI! No jump server necessary.

#cloud #aws #aws ec2

Camron  Shields

Camron Shields

1597954680

Amazon EC2 evolution— How Nitro changed everything and Instance type deep dive

Introduction

For those new to EC2, EC2 offers auto-scalable instances with compute, memory, storage and networking, deployable in multiple Availability zones/Regions while targetable by a load balancer along with management / administration tools such as AWS Systems Manager and AWS License Manager. EC2 instances are available under multiple purchase options such as SpotOn-DemandReserved and Savings Plan. It offers a broad choice of processors such as Intel, AMD and Amazon’s very own ARM-based Graviton processors. EC2 also allows the possibility of using Application Specific Integrated-Circuit (ASICs) and Field Programmable Gate-Array (FPGAs).

For those new to terms like ASIC and FPGA, they provide an alternate way to compute than CPU and GPU. Unlike CPU and GPU, which have a predefined instruction set and general purpose or parallel computing optimized , ASICs are dedicated, custom designed and optimized for one specific function (for e.g. bitcoin mining) whereas FPGAs are, as their name suggests, programmable digital logic cells. The hardware can be reprogrammed / repurposed to different workloads. Neither ASICs nor FPGAs have a predefined instruction set.

A very short history

Amazon launched EC2 with one instance type, m1, in the year 2006. This machine offered 1.7 GHz of CPU, 1.75 GB of RAM, 160 GB of disk and 250 Mbps of network bandwidth. This has evolved to 300+ instance types as of July 2020.

EC2 currently offers instance with upto 4.0GHz of CPU(z1d), 24576 GB / 24 TB of RAM(u-24tb1.metal), 48 TB of disk (d2.8xlarge) and 100 Gbps of Network bandwidth (High-Memory instances). Nitro turbo-charged this evolution in 2017 at which time “only” 42 instance types were available. It allowed new CPU architectures (ARM, AMD), bare metal offerings, 100 Gbps networking, EFA etc. So what exactly is Nitro?

Nitro — in english

Nitro refers to a whole fleet of changes, hardware and software, brought about in order to improve two important aspects of the infrastructure: performance and security. The basic idea is about offloading functions that are generally performed in a hypervisor stack to separate dedicated hardware / software component. Before Nitro — Networking, Storage, Security etc. were part of the hypervisor stack and contributed to about 30% of resource consumption that could not be used by customer instances.

Image for post

With Nitro architecture, these components are moved out of the hypervisor stack, allowing for better resource consumption / performance and more controlled security.

#aws #ec2 #ec2-instance #nitro #aws-ec2

Rory  West

Rory West

1622206030

AWS Instance Scheduler Ultimate Cheat Sheet For Devs

AWS Instance Scheduler is a popular option for saving up a large portion of the cost of computing services in situations where there are predictable planned times for operating compute services. In other words, since no clients are accessing particular environments during the period, it’s normal for development environments or workloads to be shut down during non-working times.

By evaluating when the instances are more widely used, you can implement more complex schedules, or even apply an always-stopped schedule and then start up the instances when you need them.

In this article, we will cover a step-by-step guide to create an AWS schedule and apply it to several instances.

Solution Overview

This CloudFormation template creates an environment for the AWS Instance Scheduler. The solution uses the following AWS services:

#aws #aws-cost-optimization #aws-instance-scheduler #aws-savings #aws-guide

PostgreSQL Connection Pooling: Part 4 – PgBouncer vs. Pgpool-II

In our previous posts in this series, we spoke at length about using PgBouncer  and Pgpool-II , the connection pool architecture and pros and cons of leveraging one for your PostgreSQL deployment. In our final post, we will put them head-to-head in a detailed feature comparison and compare the results of PgBouncer vs. Pgpool-II performance for your PostgreSQL hosting !

The bottom line – Pgpool-II is a great tool if you need load-balancing and high availability. Connection pooling is almost a bonus you get alongside. PgBouncer does only one thing, but does it really well. If the objective is to limit the number of connections and reduce resource consumption, PgBouncer wins hands down.

It is also perfectly fine to use both PgBouncer and Pgpool-II in a chain – you can have a PgBouncer to provide connection pooling, which talks to a Pgpool-II instance that provides high availability and load balancing. This gives you the best of both worlds!

Using PgBouncer with Pgpool-II - Connection Pooling Diagram

PostgreSQL Connection Pooling: Part 4 – PgBouncer vs. Pgpool-II

CLICK TO TWEET

Performance Testing

While PgBouncer may seem to be the better option in theory, theory can often be misleading. So, we pitted the two connection poolers head-to-head, using the standard pgbench tool, to see which one provides better transactions per second throughput through a benchmark test. For good measure, we ran the same tests without a connection pooler too.

Testing Conditions

All of the PostgreSQL benchmark tests were run under the following conditions:

  1. Initialized pgbench using a scale factor of 100.
  2. Disabled auto-vacuuming on the PostgreSQL instance to prevent interference.
  3. No other workload was working at the time.
  4. Used the default pgbench script to run the tests.
  5. Used default settings for both PgBouncer and Pgpool-II, except max_children*. All PostgreSQL limits were also set to their defaults.
  6. All tests ran as a single thread, on a single-CPU, 2-core machine, for a duration of 5 minutes.
  7. Forced pgbench to create a new connection for each transaction using the -C option. This emulates modern web application workloads and is the whole reason to use a pooler!

We ran each iteration for 5 minutes to ensure any noise averaged out. Here is how the middleware was installed:

  • For PgBouncer, we installed it on the same box as the PostgreSQL server(s). This is the configuration we use in our managed PostgreSQL clusters. Since PgBouncer is a very light-weight process, installing it on the box has no impact on overall performance.
  • For Pgpool-II, we tested both when the Pgpool-II instance was installed on the same machine as PostgreSQL (on box column), and when it was installed on a different machine (off box column). As expected, the performance is much better when Pgpool-II is off the box as it doesn’t have to compete with the PostgreSQL server for resources.

Throughput Benchmark

Here are the transactions per second (TPS) results for each scenario across a range of number of clients:

#database #developer #performance #postgresql #connection control #connection pooler #connection pooler performance #connection queue #high availability #load balancing #number of connections #performance testing #pgbench #pgbouncer #pgbouncer and pgpool-ii #pgbouncer vs pgpool #pgpool-ii #pooling modes #postgresql connection pooling #postgresql limits #resource consumption #throughput benchmark #transactions per second #without pooling