Reputation: 21
I have hosted my app on aws ec2 instance with 16 GiB Ram and 8 GB of storage. I used to save logs her and sometimes get "Memory full issue". So can anyone suggest me that how can i increase the storage and how much it will cost.
Upvotes: 0
Views: 4384
Reputation: 411
if you are using docker images or containers using Jenkins so maybe you can use this command to clean up space consumed by unwanted docker images.
sudo docker rmi $(sudo docker images -f "dangling=true" -q)
Upvotes: 0
Reputation: 30083
if you have memory problem then why you want more storage try ?
Which class of ec2 you are using ?
For more you can attach the EBS to ec2 if want to increase the volume and to increase memory you can change the class of ec2 if using t2.micro you change it.
auto scaling can also one option or migrate to another ec2 having a more space and memory.
Upvotes: 0
Reputation: 611
Try following before increasing instance storage and upgrading instance type.
Clear temporary files and Application logs on daily basis.
Execute following command to open crontab,
crontab -e
Enter following line into cron tab.
0 1 * * * sudo find /tmp -type f -atime +10 -delete
Use above command into cron job to clear all application temporary files accessed before 10 days and this command will get get executed at 1AM everyday.
also remove older log files though cronjob.
If you are Using AWS for infrastructure then will suggest you to upload logs on cloudwatch using log agent.
Refer following link for Quickstart for logs Agent. https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html
If you arable Cloudwatch then all of you application logs will get stream to S3 and you will not required even 10 days of logs on instance.
Upvotes: 1
Reputation: 1331
What's the class of the EC2 instance ? You can monitor your instance performance using Cloud Watch and then you can decide (based on the Cpu and memory usage) to which new instance you have to migrate. For costs estimation you can use the link provided by @wayne Phipps
Upvotes: 0