Arquivo da categoria: Amazon

AWS RDS PostgreSQL error “remaining connection slots are reserved for non-replication superuser connections”

Amazon has to set the number of connections based on each model’s right to demand a certain amount of memory and connections

MODEL      max_connections innodb_buffer_pool_size
---------  --------------- -----------------------
t1.micro   34                326107136 (  311M)
m1-small   125              1179648000 ( 1125M,  1.097G)
m1-large   623              5882511360 ( 5610M,  5.479G)
m1-xlarge  1263            11922309120 (11370M, 11.103G)
m2-xlarge  1441            13605273600 (12975M, 12.671G)
m2-2xlarge 2900            27367833600 (26100M, 25.488G)
m2-4xlarge 5816            54892953600 (52350M, 51.123G)

But if you want you can change the max connection size to custom by

From RDS Console > Parameter Groups > Edit Parameters,

You can change the value of the max_connections parameter to a custom value.

For closing the connections periodically you can setup a cron job some thing like this.
[code type=sql]
select pg_terminate_backend(procpid)
from pg_stat_activity
where usename = ‘yourusername’
and current_query = ‘
and query_start < current_timestamp - interval '5 minutes';

Share and Enjoy !

0Shares
0 0

How are EC2 instance-hours billed?

Resolution

EC2 instance-hours are calculated according to the following considerations:

  • You are billed for an EC2 instance-hour for each hour or partial hour that your instance is in the running state. Instances that are in any other state (for example, stoppedpending, etc.) are not billed.
  • Every partial instance-hour is rounded up and calculated as a full instance-hour.
  • Each time your instance enters the running state, a new instance-hour begins.
  • Each instance is billed separately; partial instance-hours for multiple instances of the same type are not combined into one instance-hour.

Note: If you purchase an EC2 Reserved Instance, you are billed at the beginning of the month for every hour in the current month, according to the terms of your Reserved Instance contract. For more information, see How do EC2 Reserved Instances work?

Here are a few examples of how these considerations work in practice:

  • When you run an instance for 30 minutes and then terminate the instance, you are billed for one instance-hour.
  • When you run an instance for 10 minutes, stop the instance, and then start the instance again, you are billed for two instance-hours.
  • When you run two EC2 instances of the same type for 30 minutes each, you are billed for two instance-hours.

For pricing information, see Amazon EC2 Pricing.

https://aws.amazon.com/pt/premiumsupport/knowledge-center/ec2-instance-hour-billing

Share and Enjoy !

0Shares
0 0

AWS ElasticBeanstalk And Rails

https://medium.com/@hugooodias/deploying-a-rails-app-to-amazon-elasticbeanstalk-in-2016-c4e833c687c0

https://hackernoon.com/how-to-setup-and-deploy-a-rails-5-app-on-aws-beanstalk-with-postgresql-redis-and-more-88a38355f1ea

https://medium.com/@jatescher/how-to-set-up-a-rails-4-2-app-on-aws-with-elastic-beanstalk-and-postgresql-3f9f29c046e2

Share and Enjoy !

0Shares
0 0