Charles Cooper

Charles Cooper

1610069532

Connecting to Private GCE Instances

Hosting a private application on a virtual machine, but also want it to communicate with your microservices? In this episode of Serverless Expeditions Extended, we show you how to set up a VPC connector using Cloud Functions and Compute Engine. Watch to learn how you can easily create a private connection for your private applications!

Timestamps:

  • 0:00 - Overview
  • 1:23 - Setting up the virtual machine
  • 2:55 - Making the virtual machine private by putting it in a virtual private cloud
  • 5:05 - Setting up the Serverless VPC Connector
  • 6:00 - Write a Cloud Functions that accesses the private virtual machine using the Serverless VPC Connector

#developer #programming #web-development

What is GEEK

Buddha Community

Connecting to Private GCE Instances

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

Ian  Robinson

Ian Robinson

1623250560

An Introduction To Data Connectivity and Data Connectivity Solutions

In this article, we discuss facts about data connectivity, the related concepts, its benefits, as well as a discussion on some data connectivity solutions.

Introduction

In today’s world, data is the crux of major business decisions used by organizations all over the world. As such, it is imperative that the organizations have access to the right data and be able to analyze and make business decisions proactively. This article talks about data connectivity, the related concepts, its benefits, as well as a discussion on some data connectivity solutions.

#big data #data connectivity #data connectivity solutions #connectivity

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

Ray  Patel

Ray Patel

1623309363

Private Constructor in Java: Use Cases Explained with Example

Introduction

A private constructor in Java is used in restricting object creation. It is a special instance constructor used in static member-only classes. If a constructor is declared as private, then its objects are only accessible from within the declared class. You cannot access its objects from outside the constructor class.

Private Constructor Use-Cases

Private constructors in Java are accessed only from within the class. You cannot access a private constructor from any other class. If the object is yet not initialised, then you can write a public function to call the private instructor. If the object is already initialised, then you can only return the instance of that object. A private constructor in Java has the following use-cases:

  • You can use it with static members-only classes.
  • You can use it with static utility or constant classes.
  • You can use it to serve singleton classes.
  • You can use it to assign a name, for instance, creation by utilising factory methods.
  • You can use it to prevent subclassing.

Singleton Class

The private constructor in Java is used to create a singleton class. A singleton class is a class in Java that limits the number of objects of the declared class to one. A private constructor in Java ensures that only one object is created at a time. It restricts the class instances within the declared class so that no class instance can be created outside the declared class. You can use the singleton class in networking and database connectivity concepts.

#full stack development #java #private constructor #private constructor java #private constructor in java: use cases explained with example #use cases explained with example

野村  陽一

野村 陽一

1598215020

EC2 Instance Connect が ABAC に対応しました

コンバンハ、千葉(幸)です。

ネタが被りましてね。

EC2 Instance Connect now supports Attribute Based Access Control (ABAC)

EIC が ABAC に対応した!という発表を受けていそいそとブログの下書きを書いていたのですが、颯爽とあおやぎがブログ化していました。(検証がとても丁寧…)

ほぼ書きあがっていたのでお蔵入りにするのも忍びないと思い、公開します。大筋はどちらも一緒なのですが、細かい部分で違いがあります。同一のソースからアウトプットするときにどこを切り取るかの観点の違いを比較したり、オリジナル・バージョンを楽しんだ後にちょっと別のバージョンも触れたい、という場合にご参照ください(?)

目次

EIC (EC2 Instance Connect) とは

EC2 Instance Connect とは、EC2インスタンスに対するSSH接続の手法の一つとして提供されている機能です。SSHキーの管理が不要になり、IAMを用いてアクセスコントロールが可能になります。また、接続リクエストがCloud Trailに記録されるというメリットもあります。

機能の詳細は以下のエントリに分かりやすくまとまっています。

#aws #amazon ec2 #abac #ec2 instance connect