Questions tagged as ['amazon-ec2']

Amazon Elastic Compute Cloud (EC2) provides self-service, on-demand, pay-for-what-you-use computing infrastructure resources.
Score: 0
Jean-François Kener avatar
Connectivity between two EC2 instances does not work
it flag

I try to ping or ssh between these instances (A to B), neither work, both time out.

  • Instance A (i-0e332d1880c8f93ae) - CentOS
  • Instance B(i-0a1e4a76358059ba3) - Debian

They share VPC, and the security groups and Network ACL are properly configured. The AWS connectivity analysis tool confirmed this for both ICMP and ssh.

(Image: , no enough reputation)

There is ...

Score: 1
Cade Daniel avatar
Why does `hdparm -t` take so long to produce accurate results on my EC2 instance?
ni flag

I'm profiling a data-processing program that I wrote and I want to understand the theoretical throughput of the machine I'm on. Specifically, I want to measure what disk read speed my g4dn EC2 instance is providing my application. This particular instance has an ephemeral NVMe drive, which is what I want to benchmark.

I notice that it takes quite a few runs of hdparm until the throughput it reports stop ...

Score: 0
Rahul Raj avatar
AWS Beanstalk - Website refreshing infinitely during scale up
io flag

I have a configuration in my Elastic Beanstalk where the maximum number of instances can be "3" and minimum is 1.

When the website is running with just one ec2 instance, it loads without any issues. When the website receives traffic and it scale up to more than 1 instance, then the website gets into an infinite refresh loop. I had some testing and this happens irrespective of the underlying code  ...

Score: 0
wirelessben avatar
How do I remount /home as the ec2-user in Ansible?
in flag

I can manually remount /home as the ec2-user by executing these three lines:

$ cd /
$ exec sudo -i
# mount -a

How do I do this in Ansible without rebooting?

Edit: /home is on a separate volume. No other users are on the box. The cd / removes usage of /home. The exec sudo -i kills the ec2-user process, which was using /home, and leaves me logged in as root. Now I can unmount and mount home without p ...

Score: 0
salman_sali avatar
Which ec2 instance should I choose for my mongos(query router)?
in flag

I am hosting a sharded mongodb on ec2. I am planning on going with m4.large for my shard instances and t2.micro for my config servers. Should I go with m4.large for my mongos(query router) instances or can I go with something cheaper.

This is the initial number of instances I am going with:

2 Mongos, 3 Configs, 3 Shards * (2 server per shard) = 11 servers.

Score: 0
HWD avatar
How to set Apache-accessible SELinux policy for EFS mounted user directories?
fj flag

When I mount my EFS to a user directory, the directory policy becomes system_u:object_r:nfs_t:s0, which is too restrictive - I need it to behave more like a typical user directory, which is unconfined_u:object_r:user_home_dir_t:s0.

How do I change this?

Score: 0
Aladdin avatar
AWS set ec2 instance as unhealthy if specific service is down
sk flag

I have couple of instances part of ASG, these are worker ec2 instances not exposed to the public, there is a systemctl service initialized via user-data, sometimes initializing the service fails for a reason or another.

When such case happens I need a way to set the instance is unhealthy so that the ASG replaces it.

I thought if having cronjob running inside the ec2 instance or lambda function and t ...

Score: 0
ECS containers on EC2 cannot mount EFS volumes
cn flag

I have created an ECS cluster backed by an EC2 auto-scaling group and launched a service in it that uses EFS for NFS storage. The service is running in awsvpc network mode so that I'm able to control traffic to and from it. There is a security group that allows access to TCP2049/NFS4 from itself and (for troubleshooting) from, and it is attached to both the EFS mountpoint and the ECS servic ...

Score: 0
Budianto IP avatar
DHCPv6 address xxxx/128 timeout preferred 140 valid 450
cn flag

A couple of days ago, I activated the IPv6 for an EC2 instance. But, yesterday the instance was down twice.

When checking the syslog file, I found these repeated message:

ens5: DHCPv6 address xxxx/128 timeout preferred 140 valid 450

And while doing some research, I found this post, which simply says, the message is normal, but my question is is it?

Also, does it have anything to do with the server ...

Score: 0
Surya H avatar
AWS-EC2 100% CPU Utilization
in flag

I am curious to know about 2 things below about the AWS-EC2 CPU utilization and CPU Credits.

What will happen if my AWS-EC2 instance CPU utilization is constantly 100% and I ran out of CPU credits?

Assume that my EC2 burstable (t-series) instance is in a shared host(which is a 8core CPU) shared by 2 VMs each 4 core. Now both the VMs are utilizing full CPU i.e. 400% each at the same time. Both the VM ...

Score: 1
Instance refresh: "insufficient data to evaluate its health with Amazon EC2"
de flag

The instance refreshes for my autoscaling group are taking a very long time due to instances having "insufficient data to evaluate its health with Amazon EC2."

However, the instances are passing EC2 health checks for 5+ minutes.

There is no other sort of health check, manual or load balancers.

What condition is the instance refresh actually waiting on? Is there any way to satisfy this condition faster,  ...

Score: 0
LuckyLuke avatar
How could I use single elastic IP for multiple instances (AWS)?
et flag

What would be best way to achieve such thing:

I have limited amount of elastic ips, and I have bunch on EC2 instances to launch small apps.

I have an idea to have load-balancer or an EC2 instance that could route traffic to any other EC2 instances.

For example there would be 3 instances:

  • Instance 1 (
  • Instance 2 ( ...
Score: 0
Teckfrekk avatar
AWS EC2 windows instance 1/2 status check
ao flag

I converted my ec2 instance running on windows server 2016 from m5.large to m6a.large, type change successful,

Problem is:

  1. but Instance status checks : failed
  2. verified Get instance screenshot, its showing the windows login screen but I am not able to connect with instance.
Score: 0
node in docker in aws instance is running out of memory, why?
us flag

My NodeJS application is running inside a docker container on an ec2 instance. It is running out of memory way before the server itself is running out of memory. The container is only able to use around 25% of the memory. But why?

The following mechanisms seem not to be the cause:

  • ulimit returns unlimited.
  • cat /sys/fs/cgroup/memory/docker/memory.limit_in_bytes returns 9223372036854771712

I am runn ...

Score: 2
Nikolay Dyankov avatar
Incredibly slow connection to EC2 instance after moving to another region
ni flag

I just moved my instance from Frankfurt to N. Virginia, and now I'm getting really slow loading times for my website. The DOM loads quickly, but then I wait over 40 seconds for a 500kb image. This shouldn't be happening, am I missing a config somewhere?

Score: 2
DilLip_Chowdary avatar
Decrease Size of EBS Volume attached to EC2 Instance
ua flag

I've created an EC2 instance with some 100 GB initial size, thereafter I realized this much size is not required, I've to decrease the size now.

What I tried?

  • Create a new volume with the desired size.
  • Attach new volume to ec2 instance.
  • Setup New volume (grub-install, EFI partition, etc)
  • Copy data from old_volume to new_volume.
  • Detach old volume.

But this process is a little bit complex as this can't  ...

Score: 1
Max Hudson avatar
System architecture for storing sensitive data separately without single point of access
ae flag

We're building a SaSS platform with support for integrations. Each client has multiple integrations. We'd prefer not to store these integration tokens in a centralized location, where there's a single point of access to all tokens for all clients.

Our current approach is to run separate servers for each client, with separate hosting accounts. This means in order to access all N clients accounts y ...

Score: 2
aruuu avatar
AWS CloudWatch Alarm on Max Average CPU from ASG
hu flag

I am trying to create an alarm in CloudWatch which triggers when any node in a given ASG has greater than 90% average CPU utilisation.

I don't want to just do MAX, because we often see short spikes to above 90%, where the AVG would still be ~80% for that time.

I'm only interested if a node in the ASG is consistently over 90% utilisation.

You can do this in Explorer web interface with an "Aggregate" but ...

Score: 4
MyUserName avatar
Windows Server 2019 randomly changes time and date to incorrect values
in flag

In the last two months, we have got quite a few issues with the server time and date occasionally changing to some absolute random values. Sometimes it is a few days in the future or past, sometimes - even several months.

We have got the problem on several VMs, so it is not the problem with one VM unfortunately.

We run Windows Server 2019 (Version 1809 OS Build 17763.3406) on Amazon EC2. We synced  ...

Score: 1
hando han avatar
Is it bad idea that all user and all devices connect to one WireGuard VPN interface?
ca flag

I have few knowledge for network, I need some basic advice.

On my business domain, users is facility manager or system installer. There are not many users and they can have some responsibility for security.

My devices are made by Raspberry Pi that use Web GUI to control. But it is only used when it installed, few hours, no heavy traffic.

I think VPN is enough to handle this with following network descr ...

Score: 0
dill03 avatar
Amazon ec2 OS upgrade/instance type upgrade
sz flag

My company is needing to upgrade the OS of our EC2 instances from AML 1 to AML 2 since end of life is 6/2023. We recently released a significantly large add-on to our application, so we are talking about upgrading the instance type as well... Our current instance size is m3.large, and we have seen some latency recently. To clarify, we need OS upgrade AS WELL as instance type upgrade on production enviro ...

Score: 0
Vlad avatar
How do I keep NGINX directory ownership after installation on Amazon 2 EC2
ca flag

I have NGINX server set up as proxy to a rails application.

In the main config file /etc/nginx/nginx.conf I've set user to be ec2-user, which is the default user for this instance.

Since NGINX server is installed via sudo (root account), I had to change ownership of the lib directory sudo chown -Rf ec2-user:ec2-user /var/lib/nginx this way in order to be able to show the compiled VueJS parts of the a ...

Score: 0
vincecalpari avatar
Using Crontab to run a shell script with SSH
pw flag

I’m trying to use a cronjob to run a shell script on my EC2 instance, which SSH’s to a server to get a mongodump of a database and restore at a given specific time without me having to login.

I’ve already ssh-copy-id id_rsa as well.

So after some research, this is my updated shell script (fake hosts for privacy reasons)

auth=`find /tmp -user $LOGNAME -type s -name "*agent*" -print 2>/dev/null`
S ...
Score: 0
davis1011001 avatar
AWS EC2 Free tier data transfer
vu flag

Does changing t2 micro free tier to unlimited cause also unlimited out internet data transfer?

Score: 1
Citoyen x14 avatar
How to open communication PYTHON socket with a SERVER SOCKET on AWS EC2 to a CLIENT SOCKET on my local pc?
by flag

Sorry my english is not good

I want to established connexion from my client socket on my local pc to a host server socket on AWS EC2 instance.

I'm trying to follow suggestions from here and code from here.

The issue I'm facing is that I do not know how to open a socket and listen to incoming traffic on EC2. My EC2 is a UBUNTU free tier instance. No matter what I try I can't get it to work.

Someone said he ...

Score: 0
jerichofs avatar
Can't run psql backup in user-data script in AWS EC2
ph flag

I have private subnet for my EC2 instance, I use NAT Gateway for it to access internet. I created user-data script for my EC2 where I've created docker-compose.yml with postgres service defined. After defining this i have:

docker-compose up -d
# i use terraform for ${PGPASSWORD} template variable
psql -h localhost -U my_user -p 5432 -d my_db < ./mydump.sql

Insid ...

Score: 0
beNerd avatar
Restarting PM2 when the latency of the API it's serving becomes high
jp flag

I have an EC2 instance running which is housing a nodeJS/GraphQL based API application. The application is managed via PM2.

I want to have a setup/configuration which can continuously ping one endpoint (actual API) on the server to keep monitoring the latency. e.g, it can keep hitting login endpoint with some dummy credentials to make sure server the response is received within given threshold ti ...

Score: 1
somboo avatar
Can't SSH to ec2 instance on shared subnet
US flag

I have a single VPC with one internet gateway and some subnets that are shared across multiple AWS Organization accounts using RAM. The VPC is protected with a Security Group that is managed by Firewall Manager to ensure it is replicated to all of the accounts that are granted access to the shared subnets. And, the subnets are protected by NACLs. The NACLs and SGs are configured to allow bi-direction ...

Score: 0
Jesse P avatar
What Could Cause CloudFront Request To Spikes Once Per Day From Linux User Agent with same IP?
sm flag

Setup is: cloudfront -> load balancer -> ec2 server

CloudFront logs shows the request are coming from these IP's and User Agent.

c-ip =

cs(User-Agent) = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36

Score: 0
Teckfrekk avatar
Swap memory discrepancy
ao flag

I want to know the status of swap memory on my system, to understand the same tried different commands, each command thrown different output, could someone help to understand the situation better

command 1: free -m

command 1 output:

          total  used  free  shared  buff/cache  available
Mem:       7661  1152  1820    69         4687       6359
Swap:        0       0     0

command 2: swapon --s ...