503 Service Unavailable error in AWS ec2 instance without load balancer - laravel

I'm pretty new to AWS. I have created an instance of ec2 and separate RDS. I have deploy my code. Sometimes I'm getting 503 error Service Unavailable (The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later) from API.
Note1: I'm not using load balancer.
Note2: Sometimes I got the my required response (200 status). But most of the time its 503.
How I have to fix that error please?
Help will be appreciated.
Thanks.

Related

Amazon e2 free tier 503 error

I am using the amazon aws e2 to host a parse server database. It was working fine for the last couple of weeks, but today I got an error 503 saying: The server is temporarily unable to service your request due to maintenance downtime or capacity problems. My question is: is it because I'm using the free t2.micro tier and I have run out of quota? Or can there be some other problem? I just launched another instance and it seems to be working fine for now.
Have you set up a load balancer? Checkout Elastic Beanstalk, which manages EC2 instances to automatically spin servers up and down as your needs require it. Your server may have just crashed and nothign was set up to automatically redeploy it.

Varnish keeps crashing on EC2

I have installed Magneto 2 on EC2 with a MySQL database hosted separately on a RDS instance. I have configured the varnish on my EC2 server.
Whenever I open multiple tabs on the website, the varnish server crashes on a couple of product pages with the following error:
Error 503 Backend fetch failed"
Varnish version: 4.0.4 on Centos 6
I had the same problem and finally figured out what the reason was. We had the website silently running for testing without problems for a week. When we pointed our domain to the amazon EC2 instance - varnish crashed after some hours.
But that was maybe a coincidence. I found out someone was scraping the ip to find some access. logs were full of access tries to /sql /phpmyadmin /administrator ...and so on.
That caused varnish crashing.

Performance Testing in AWS using jmeter tool returns 403 error after a duration of 45- 60 minutes duration

I am running a performance test in AWS environment using jmeter tool. we have a cluster with auto scaling enabled and having memcache session failover jars. we are using jmeter master slave so we don't get the response data from the JTL file. The response code returned after 45 minutes of test durations:
Response code: 403
Response message: Forbidden
How to resolve the issue?
After researching more I found the cause ca be session failover jars of the memcache I have upgraded the jars version to 1.6.5 but still facing the same problem.
Are you using an ELB? If so, read here: http://community.blazemeter.com/knowledgebase/articles/94060-testing-amazon-elbs
It looks like you are using an ELB. An ELB has a CNAME attached to it. AWS changes the IP attached to the CNAME. This happens quite often.
When your test starts, JMeter does a DNS lookup for the ELB CNAME. The response is then cached. From this point onwards, the test sends traffic to the IP address that was in the response that is now cached.
The result is that at some point (after the IP changed) you are testing an old IP that can now belong to a different server or belong to NO server. This is probably why you are getting the 403.
To resolve this, you need to set Cache TTL to 0 (zero). This will instruct JMeter to NOT cache the DNS lookup response and always do it again (which is more realistic in any case). You should add the following to your JMeter line: -Dsun.net.inetaddr.ttl=0.
More info here: http://community.blazemeter.com/knowledgebase/articles/94060-testing-amazon-elbs

503 error in tomcat deployed in ec2

I have deployed tomcat 6.0.28 on two amazon ec2 instances and they share a common mysql 5.5 database. I have also made use of the elastic load balancer. When I run the program using the tomcat in my local machine, everything is fine.
But when i use the ones in EC2, i get the following error,
java.io.IOException: Server returned HTTP response code: 503 for URL:.
Can somebody help me? Thank you in advance.
Well the problem was with sessions. I did not enable stickiness. Hence the next time the load balancer routed to a different instance. I enabled stickiness in elastic load balancer and everything is fine now.

Amazon Instance Ec2 Connection Timeout

I am using Amazon EC2 services & and its working correctly but suddenly from 3-days before when we try to access our instance using ssh connection we got following error:
"ssh: connect to host ec2----***.compute-1.amazonaws.com port **: Connection timed out"
when I try to access our sites deployed on our EC2 instance, I received the same error ,
"The connection has timed out
The server at ec2----***.compute-1.amazonaws.com is taking too long to respond"
there is no problem in network connection from our side as we are able to access other web site and services smoothly.
I can't even able to access hosted site without this.
I encountered the same problem.
I followed the troubleshooting in http://alestic.com/2010/05/ec2-move-ebs-boot-instance
Then when I tried to start a new instance, I got an message from Amazon:
Server.InsufficientInstanceCapacity: We currently do not have sufficient m1.small capacity in the Availability Zone you requested (us-east-1b). Our system will be working on provisioning additional capacity. You can currently get m1.small capacity by not specifying an Availability Zone in your request or choosing us-east-1d, us-east-1c, us-east-1a.
Maybe, you have an instance is us-east-1b, too.
You can try to access the System Console (either via the amazon web console or elasticfox) and check for any errors/messages that might help you arrive at the cause of this.
In ~/.ssh/config, add the following lines:
ServerAliveInterval 50
This will keep on pinging the server every 50 seconds to keep the connection alive.

Resources